#include <Rocout.h>
Public Member Functions | |
User interface | |
void | write_attribute (const char *filename_pre, const COM::Attribute *attr, const char *material, const char *timelevel, const char *mfile_pre=NULL, const MPI_Comm *comm=NULL, const int *pane_id=NULL) |
Write a (possibly aggregate) attribute to a file. More... | |
void | put_attribute (const char *filename_pre, const COM::Attribute *attr, const char *material, const char *timelevel, const char *mfile_pre=NULL, const MPI_Comm *comm=NULL, const int *pane_id=NULL) |
Write a (possibly aggregate) attribute to a new file. More... | |
void | add_attribute (const char *filename_pre, const COM::Attribute *attr, const char *material, const char *timelevel, const char *mfile_pre=NULL, const MPI_Comm *comm=NULL, const int *pane_id=NULL) |
Append a (possibly aggregate) attribute to a file. More... | |
void | sync () |
Wait for the completion of an asychronous write operation. More... | |
void | write_rocin_control_file (const char *window_name, const char *file_prefixes, const char *control_file_name) |
Generate a control file for Rocin. More... | |
void | set_option (const char *option_name, const char *option_val) |
Set an option for Rocout, such as controlling the output format. More... | |
void | write_parameter_file (const char *file_name, const char *window_name, const MPI_Comm *comm=NULL) |
Write out the parameters defined in the fiven window into a parameter file. More... | |
void | read_control_file (const char *filename) |
Set options for Rocout via a control file. More... | |
Static Protected Member Functions | |
Initialization and finalization | |
static void | init (const std::string &mname) |
Initialize the module by registering it to Roccom with the given module name. More... | |
static void | finalize (const std::string &mname) |
Finalize the module by deregistering it from Roccom. More... | |
Protected Attributes | |
std::map< std::string, std::string > | _options |
Friends | |
Module loading and unloading | |
void | Rocout_load_module (const char *name) |
Load the module Rocout into Roccom using the given module name. More... | |
void | Rocout_unload_module (const char *name) |
Unload the module Rocout from Roccom. More... | |
Implementation | |
static void * | write_attr_internal (void *attrInfo) |
Does the actual writing to file. More... | |
std::string | get_fname (const std::string &pre, int rank=-1, const int paneId=0, bool check=false) |
Builds a filename from the given prefix and rank. More... | |
void add_attribute | ( | const char * | filename_pre, |
const COM::Attribute * | attr, | ||
const char * | material, | ||
const char * | timelevel, | ||
const char * | mfile_pre = NULL , |
||
const MPI_Comm * | comm = NULL , |
||
const int * | pane_id = NULL |
||
) |
Append a (possibly aggregate) attribute to a file.
Append an attribute to a file.
filename_pre | the prefix of the file name. |
attr | a reference to the attribute to be written. |
material | the name of the material (usually the window name). |
time_level | the time stamp of the dataset. |
mfile_pre | the prefix of the file that contains the mesh data. |
comm | The MPI communicator to use. If is NULL, the default communicator of the Roccom window will be used. |
pane_id | the pane to be written. |
filename_pre | the prefix of the file name. |
attr | a reference to the attribute to be written. |
material | the name of the material (usually the window name). |
time_level | the time stamp of the dataset. |
mfile_pre | the prefix of the file that contains the mesh data. |
pComm | The MPI communicator to use. If is NULL, the default communicator of the Roccom window will be used. |
pane_id | the pane to be written. |
Definition at line 329 of file Rocout.C.
References _options, id(), and write_attr_internal().
Referenced by init().
|
staticprotected |
Finalize the module by deregistering it from Roccom.
Definition at line 213 of file Rocout.C.
References COM_delete_window(), COM_get_object(), and HDF4::finalize().
Referenced by Rocout_unload_module().
|
protected |
Builds a filename from the given prefix and rank.
Build a filename.
pre | Filename prefix. |
rank | The rank of this MPI process. |
pPaneId | A pointer to the pane id. |
check | Check for an existing file. |
Get a file name by appending an underscore, a 4-digit rank id, and an extension to the "localdir" and given prefix. If the pre contains .hdf or .cgns, then use it as the file name.
Definition at line 825 of file Rocout.C.
References _options, ERROR_MSG, cimg_library::cimg::fclose(), cimg_library::cimg::fopen(), MPI_COMM_WORLD, n, rank, s, and sin.
Referenced by write_attr_internal().
|
staticprotected |
Initialize the module by registering it to Roccom with the given module name.
This function is called Rocout_load_module.
Definition at line 139 of file Rocout.C.
References _options, add_attribute(), COM_METADATA, COM_MPI_COMM, COM_new_attribute(), COM_new_window(), COM_RAWDATA, COM_set_member_function(), COM_set_object(), COM_STRING, COM_VOID, COM_window_init_done(), HDF4::init(), MPI_COMM_SELF, put_attribute(), read_control_file(), set_option(), sync(), write_attribute(), write_parameter_file(), and write_rocin_control_file().
Referenced by Rocout_load_module().
void put_attribute | ( | const char * | filename_pre, |
const COM::Attribute * | attr, | ||
const char * | material, | ||
const char * | timelevel, | ||
const char * | mfile_pre = NULL , |
||
const MPI_Comm * | comm = NULL , |
||
const int * | pane_id = NULL |
||
) |
Write a (possibly aggregate) attribute to a new file.
Write an attribute to a new file.
filename_pre | the prefix of the file name. |
attr | a reference to the attribute to be written. |
material | the name of the material (usually the window name). |
time_level | the time stamp of the dataset. |
mfile_pre | the prefix of the file that contains the mesh data. |
comm | The MPI communicator to use. If is NULL, the default communicator of the Roccom window will be used. |
pane_id | the pane to be written. |
filename_pre | the prefix of the file name. |
attr | a reference to the attribute to be written. |
material | the name of the material (usually the window name). |
time_level | the time stamp of the dataset. |
mfile_pre | the prefix of the file that contains the mesh data. |
pComm | The MPI communicator to use. If is NULL, the default communicator of the Roccom window will be used. |
pane_id | the pane to be written. |
Definition at line 286 of file Rocout.C.
References _options, id(), and write_attr_internal().
Referenced by init().
void read_control_file | ( | const char * | filename | ) |
Set options for Rocout via a control file.
filename | the path to the control file. |
Definition at line 580 of file Rocout.C.
References ERROR_MSG, is_option_name(), is_option_value(), and set_option().
Referenced by init().
void set_option | ( | const char * | option_name, |
const char * | option_val | ||
) |
Set an option for Rocout, such as controlling the output format.
option_name | the option name: "format", "async", "mode", "localdir", "rankwidth", "pnidwidth", "separator" or "errorhandle". |
option_val | the option value. |
option_name | the option name: "format", "async", "mode", "localdir", "rankdir", "rankwidth", "pnidwidth", "errorhandle" or "ghosthandle". |
option_val | the option value. |
Definition at line 552 of file Rocout.C.
References _options, COM_assertion_msg, ERROR_MSG, is_option_name(), and is_option_value().
Referenced by genxwritesolution(), init(), mesh2d(), mesh2doverlay(), read_control_file(), and rocfracprep().
void sync | ( | ) |
|
staticprotected |
Does the actual writing to file.
attrInfo | Information on what to write and where to write it. |
Definition at line 670 of file Rocout.C.
References _options, COM_get_panes(), Window::get_communicator(), get_fname(), Window::inherit(), Pane::INHERIT_CLONE, WriteAttrInfo::m_append, WriteAttrInfo::m_attr, WriteAttrInfo::m_cloned, WriteAttrInfo::m_material, WriteAttrInfo::m_meshPrefix, WriteAttrInfo::m_pComm, WriteAttrInfo::m_pPaneId, WriteAttrInfo::m_prefix, WriteAttrInfo::m_rout, WriteAttrInfo::m_timelevel, Window::name(), paneIds, rank, Attribute::window(), write_attr_CGNS(), and write_attr_HDF4().
Referenced by add_attribute(), put_attribute(), and write_attribute().
void write_attribute | ( | const char * | filename_pre, |
const COM::Attribute * | attr, | ||
const char * | material, | ||
const char * | timelevel, | ||
const char * | mfile_pre = NULL , |
||
const MPI_Comm * | comm = NULL , |
||
const int * | pane_id = NULL |
||
) |
Write a (possibly aggregate) attribute to a file.
Write an attribute to file.
filename_pre | the prefix of the file name. |
attr | a reference to the attribute to be written. |
material | the name of the material (usually the window name). |
time_level | the time stamp of the dataset. |
mfile_pre | the prefix of the file that contains the mesh data. |
comm | The MPI communicator to use. If is NULL, the default communicator of the Roccom window will be used. |
pane_id | the pane to be written. |
filename_pre | the prefix of the file name. |
attr | a reference to the attribute to be written. |
material | the name of the material (usually the window name). |
time_level | the time stamp of the dataset. |
mfile_pre | the prefix of the file that contains the mesh data. |
pComm | The MPI communicator to use. If is NULL, the default communicator of the Roccom window will be used. |
pane_id | the pane to be written. |
Definition at line 246 of file Rocout.C.
References _options, id(), and write_attr_internal().
Referenced by init().
USE_COM_NAME_SPACE void write_parameter_file | ( | const char * | file_name, |
const char * | window_name, | ||
const MPI_Comm * | comm = NULL |
||
) |
Write out the parameters defined in the fiven window into a parameter file.
Only process 0 of the communicator writes the parameter file.
file_name | the file to which the parameters will be written. |
window_name | the window to read parameters from |
comm | the MPI_communicator to use. If NULL, then the communicator of the window associated with window_name is used. |
Definition at line 36 of file write_parameter_file.C.
References COM_assertion_msg, COM_CHAR, COM_get_roccom(), COM_get_window_handle(), i, ni, and cimg_library::cimg::option().
Referenced by init().
void write_rocin_control_file | ( | const char * | window_name, |
const char * | file_prefixes, | ||
const char * | control_file_name | ||
) |
Generate a control file for Rocin.
window_name | The name of the Roccom window. |
file_prfixes | The prefixes of the data files. |
control_file_name | The name of the file to be written. |
Definition at line 361 of file Rocout.C.
References _options, COM_assertion_msg, COM_get_default_communicator(), COM_get_panes(), COMMPI_Initialized(), empty(), i, paneIds, rank, and sin.
Referenced by init().
|
friend |
Load the module Rocout into Roccom using the given module name.
This module provides one subroutine: "write_attribute".
Definition at line 934 of file Rocout.C.
|
friend |
Unload the module Rocout from Roccom.
Definition at line 937 of file Rocout.C.
|
protected |
Definition at line 235 of file Rocout.h.
Referenced by add_attribute(), get_fname(), init(), put_attribute(), set_option(), write_attr_internal(), write_attribute(), and write_rocin_control_file().