#include <Rocin.h>
Public Types | |
typedef void(* | RulesPtr )(const int &pane_id, const int &comm_rank, const int &comm_size, int *is_local) |
Pointer to a function to determine locality of a pane. More... | |
Public Member Functions | |
Rocin () | |
Default constructor. More... | |
User interface | |
void | read_by_control_file (const char *control_file_name, const char *window_name, const MPI_Comm *comm=NULL, char *time_level=NULL, const int *str_len=NULL) |
Create a single Roccom window by reading in the files specified by the given control file. More... | |
void | read_window (const char *filename_patterns, const char *window_name, const MPI_Comm *comm=NULL, RulesPtr is_local=NULL, char *time_level=NULL, const int *str_len=NULL) |
Create a single Roccom window by reading in a list of files. More... | |
void | read_windows (const char *filename_patterns, const char *window_prefix, const char *material_names=NULL, const MPI_Comm *comm=NULL, RulesPtr is_local=NULL, char *time_level=NULL, const int *str_len=NULL) |
Create a series of Roccom windows by reading in a list of files. More... | |
void | obtain_attribute (const COM::Attribute *attribute_in, COM::Attribute *user_attribute, int *pane_id=NULL) |
Fill the destination (second) attribute from files using the data corresponding to the source (first) attribute. More... | |
void | read_parameter_file (const char *file_name, const char *window_name, const MPI_Comm *comm=NULL) |
Read in parameters from a given file into the given window. 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 | |
MemberRulePtr | m_is_local |
std::set< int > | m_pane_ids |
int | m_base |
int | m_offset |
std::map< int32, COM_Type > | m_HDF2COM |
Friends | |
Module loading and unloading | |
void | Rocin_load_module (const char *name) |
Load the module Rocin into Roccom using the given module name. More... | |
void | Rocin_unload_module (const char *name) |
Unload the module Rocin from Roccom. More... | |
Pane distribution | |
typedef void(Rocin::* | MemberRulePtr )(const int &, const int &, const int &, int *) |
void | explicit_local (const int &pid, const int &comm_rank, const int &comm_size, int *il) |
void | cyclic_local (const int &pid, const int &comm_rank, const int &comm_size, int *il) |
void | blockcyclic_local (const int &pid, const int &comm_rank, const int &comm_size, int *il) |
void | register_panes (BlockMM_HDF4::iterator hdf4, const BlockMM_HDF4::iterator &hdf4End, const std::string &window, RulesPtr is_local, const MPI_Comm *comm, int rank, int nprocs) |
|
protected |
typedef void(* RulesPtr)(const int &pane_id, const int &comm_rank, const int &comm_size, int *is_local) |
|
inline |
|
protected |
Definition at line 2458 of file Rocin.C.
References m_base, and m_offset.
Referenced by read_by_control_file().
|
protected |
Definition at line 2452 of file Rocin.C.
References m_offset.
Referenced by read_by_control_file().
|
protected |
Definition at line 2446 of file Rocin.C.
References m_pane_ids.
Referenced by read_by_control_file().
|
staticprotected |
Finalize the module by deregistering it from Roccom.
Definition at line 2417 of file Rocin.C.
References COM_delete_window(), COM_get_object(), and HDF4::finalize().
Referenced by Rocin_unload_module().
|
staticprotected |
Initialize the module by registering it to Roccom with the given module name.
This function is called Rocin_load_module.
This data structure maps HDF4 data types to roccom data types.
Definition at line 2351 of file Rocin.C.
References COM_CHAR, COM_DOUBLE, COM_FLOAT, COM_INT, COM_METADATA, COM_MPI_COMM, COM_new_attribute(), COM_new_window(), COM_OBJECT, COM_RAWDATA, COM_set_member_function(), COM_set_object(), COM_STRING, COM_VOID, COM_window_init_done(), DEBUG_MSG, HDF4::init(), m_HDF2COM, MPI_COMM_SELF, obtain_attribute(), read_by_control_file(), read_parameter_file(), read_window(), read_windows(), and Rocin().
Referenced by Rocin_load_module().
void obtain_attribute | ( | const COM::Attribute * | attribute_in, |
COM::Attribute * | user_attribute, | ||
int * | pane_id = NULL |
||
) |
Fill the destination (second) attribute from files using the data corresponding to the source (first) attribute.
Note that the destination and the source attributes can be the same.
attribute_in | source attribute |
user_attribute | destination attribute |
pane_id | if present, then copy only the specific pane |
Definition at line 2431 of file Rocin.C.
References COM_assertion_msg.
Referenced by init(), plag_initgenxinterface(), rflo_modinterfacessolver::RFLO_InitAvgCoeffs::rflo_initavgcoeffs(), rflo_initflowsolver(), rflo_initgenxinterface(), and rflo_modinterfacesexternal::RFLO_SendBoundaryValuesAlpha::rflo_sendboundaryvaluesalpha().
void read_by_control_file | ( | const char * | control_file_name, |
const char * | window_name, | ||
const MPI_Comm * | comm = NULL , |
||
char * | time_level = NULL , |
||
const int * | str_len = NULL |
||
) |
Create a single Roccom window by reading in the files specified by the given control file.
control_file_name | specifies the control file. |
window_name | the name of the window to be created. |
comm | The MPI communicator to use. If is NULL, the default communicator of Roccom will be used. |
time_level | the time stamp of the dataset to be read. If time level is NULL (default) or "", then the first time_level in the file will be assumed. |
str_len | if present and positive, the time stamp of the dataset will be copied to the time_level string. |
Definition at line 2466 of file Rocin.C.
References blockcyclic_local(), COM_assertion_msg, COM_get_default_communicator(), COMMPI_Initialized(), cyclic_local(), explicit_local(), files(), i, m_base, m_is_local, m_offset, m_pane_ids, min(), rank, read_window(), and sin.
Referenced by init().
void read_parameter_file | ( | const char * | file_name, |
const char * | window_name, | ||
const MPI_Comm * | comm = NULL |
||
) |
Read in parameters from a given file into the given window.
If the window exists, then only read in the values for the attributes which exist in the window. If not, then create the window and define all options as window attributes of base type of character strings. Process 0 of the communicator should read in the parameters, and then broadcast to all the processes. If comm is not specified, then use the communicator of the window as default. If an option is listed more than once in the parameter_file, then the last value for that option will overwrite the others.
file_name | the file containing the parameters to be read in. |
window_name | window where parameters will be placed |
comm | The MPI communicator for parameter broadcast. If NULL, then the communicator of window_name will be used. |
Definition at line 40 of file read_parameter_file.C.
References cimg_library::cimg::atof(), COM_assertion_msg, COM_BOOL, COM_CHAR, COM_DOUBLE, COM_DOUBLE_PRECISION, COM_FLOAT, COM_get_roccom(), COM_get_window_handle(), COM_INT, COM_INTEGER, COM_new_attribute(), COM_new_window(), COM_REAL, COM_resize_array(), COM_set_size(), COM_UNSIGNED, COM_window_init_done(), get_parameter_list(), i, and ni.
Referenced by init().
void read_window | ( | const char * | filename_patterns, |
const char * | window_name, | ||
const MPI_Comm * | comm = NULL , |
||
RulesPtr | is_local = NULL , |
||
char * | time_level = NULL , |
||
const int * | str_len = NULL |
||
) |
Create a single Roccom window by reading in a list of files.
Read in metadata from files, and optionally read in array data as well.
filename_patterns | specifies the patterns of the files to be read in. Patterns take the form of regular expressions in the same format as the shell commands use. Separate multiple patterns with empty space. |
window_name | the name of the window to be created. |
comm | The MPI communicator to use. If is NULL, the default communicator of Roccom will be used. |
is_local | a function pointer which determines wheter a pane should be read by a process. |
time_level | the time stamp of the dataset to be read. If time level is NULL (default) or "", then the first time_level in the file will be assumed. |
str_len | if present and positive, the time stamp of the dataset will be copied to the time_level string. |
filename_patterns | Specifies patterns (reg. expressions) of files to be read in. |
window_name | Specifies a name of the window to be created. |
comm | The MPI communicator to use. If is NULL, the default communicator of Roccom will be used. |
is_local | A function pointer, which determines wheter a pane should be read by a process. |
time_level | the time stamp of the dataset to be read. If time level is NULL (default) or "", then the first time_level in the file will be used. |
str_len | if present and positive, the time stamp of the dataset will be copied to the time_level string. |
Definition at line 2750 of file Rocin.C.
References read_windows().
Referenced by init(), and read_by_control_file().
void read_windows | ( | const char * | filename_patterns, |
const char * | window_prefix, | ||
const char * | material_names = NULL , |
||
const MPI_Comm * | comm = NULL , |
||
RulesPtr | is_local = NULL , |
||
char * | time_level = NULL , |
||
const int * | str_len = NULL |
||
) |
Create a series of Roccom windows by reading in a list of files.
Read in metadata from files, and optionally read in array data as well Read in metadata from files, and optionally read in array data as well.
filename_patterns | specifies the patterns of the files to be read in. Patterns take the form of regular expressions in the same format as the shell commands use. Separate multiple patterns with empty space. |
window_prefix | a prefix of the name(s) of the window(s) to be created. Actual window name is appended by a material name and there can be multiple materials per file. |
material_names | a list of space-separated materials to be read from files. If material name is NULL (default), then "" will be used and it is assumed that files contain only one type of material. |
comm | The MPI communicator to use. If is NULL, the default communicator of Roccom will be used. |
is_local | a function pointer which determines wheter a pane should be read by a process. |
time_level | the time stamp of the dataset to be read. If time level is NULL (default) or "", then the first time_level in the file will be assumed. |
str_len | if present and positive, the time stamp of the dataset will be copied to the time_level string. |
filename_patterns | Specifies patterns (reg. expressions) of files to be read in. |
window_prefix | Specifies a prefix of the name(s) of the window(s) to be created. |
material_names | Spcifies a space-delimited list of materials to be read from the files. |
comm | The MPI communicator to use. If is NULL, the default communicator of Roccom will be used. |
is_local | A function pointer, which determines wheter a pane should be read by a process. |
time_level | the time stamp of the dataset to be read. If time level is NULL (default) or "", then the first time_level in the file will be used. |
str_len | if present and positive, the time stamp of the dataset will be copied to the time_level string. |
Definition at line 2786 of file Rocin.C.
References broadcast_win_attributes(), cast_err_func(), COM_get_default_communicator(), COM_new_window(), COM_window_init_done(), COMMPI_Initialized(), CWD(), DEBUG_MSG, free_blocks(), glob_error(), load_data_HDF4(), m_HDF2COM, new_attributes(), rank, register_panes(), scan_files_HDF4(), cimg_library::cimg::time(), and x.
Referenced by init(), and read_window().
|
protected |
Definition at line 2200 of file Rocin.C.
References COM_DOUBLE, COM_new_attribute(), COM_set_array(), COM_set_size(), DEBUG_MSG, is_local(), Block_HDF4::m_gridInfo, m_is_local, Block_HDF4::m_numGhostNodes, Block_HDF4::m_numNodes, Block_HDF4::m_paneId, Block_HDF4::m_units, Block_HDF4::m_variables, and q.
Referenced by read_windows().
|
friend |
Load the module Rocin into Roccom using the given module name.
This module provides three subroutines: "read_windows", "read_by_control_file", and "obtain_attribute".
Definition at line 3063 of file Rocin.C.
|
friend |
Unload the module Rocin from Roccom.
Definition at line 3066 of file Rocin.C.
|
protected |
Definition at line 243 of file Rocin.h.
Referenced by blockcyclic_local(), and read_by_control_file().
|
protected |
Definition at line 246 of file Rocin.h.
Referenced by init(), and read_windows().
|
protected |
Definition at line 241 of file Rocin.h.
Referenced by read_by_control_file(), and register_panes().
|
protected |
Definition at line 244 of file Rocin.h.
Referenced by blockcyclic_local(), cyclic_local(), and read_by_control_file().
|
protected |
Definition at line 242 of file Rocin.h.
Referenced by explicit_local(), and read_by_control_file().