49 int main(
int argc,
char *argv[]) {
60 if ( argc < 3 || argc > 3 ) {
61 std::cout <<
"Usage: To test in serial: \n\t" << argv[0]
62 <<
" <input HDF file|Rocin control file> <outputfile>\n"
63 <<
"To test in parallel: \n\t" << argv[0]
64 <<
" -com-mpi <Rocin control file> <output_prefix>\n"
73 const char *file_in = argv[1];
74 const char *file_out = argv[2];
79 const char *lastdot=std::strrchr( file_in,
'.');
80 if ( lastdot && std::strcmp( lastdot,
".hdf")==0) {
87 const char *win_in =
"rocin_win";
88 const char *win_out=
"user_win";
90 std::string win_in_pre( win_in); win_in_pre.append(
".");
91 std::string win_out_pre( win_out); win_out_pre.append(
".");
104 for (
int i=0;
i<np; ++
i) {
111 if ( nconn == 1 && strncmp(cnames,
":st",3)==0) {
114 COM_get_size( (win_in_pre+cnames).c_str(), pane_ids[i], &ndims, &nglayers);
115 COM_set_size( (win_out_pre+cnames).c_str(), pane_ids[i], ndims, nglayers);
119 COM_get_array_const( (win_in_pre+cnames).c_str(), pane_ids[i], &dims);
122 std::cout <<
"Structured information" << endl;
123 cout <<
" ndims = " << ndims << endl;
124 cout <<
" nglayers = " << nglayers << endl;
125 cout <<
" dims[0] = " << dims[0] << endl;
126 if ( ndims>1) cout <<
" dims[1] = " << dims[1] << endl;
127 if ( ndims>2) cout <<
" dims[2] = " << dims[2] << endl;
135 COM_get_size((win_in_pre+
"nc").c_str(), pane_ids[i], &nnodes, &ngnodes);
136 COM_set_size((win_out_pre+
"nc").c_str(), pane_ids[i], nnodes, ngnodes);
137 std::cout <<
"# nodes in dest set to " << nnodes
138 <<
" & # gnodes in dest set to " << ngnodes << std::endl;
142 std::istringstream is( cnames);
143 for (
int k=0;
k<nconn; ++
k) {
147 COM_get_size((win_in_pre+cname).c_str(), pane_ids[i], &nelems, &ng);
148 COM_set_size((win_out_pre+cname).c_str(), pane_ids[i], nelems, ng);
149 std::cout <<
"Connectivity table " << i <<
" has " << nelems <<
" elements and "
150 << ng <<
" ghost nodes" << std::endl;
167 std::istringstream is(atts);
168 for (
int i=0;
i<na; ++
i) {
170 std::string aname; is >> aname;
176 std::cout << (win_in_pre+aname).c_str() <<
" has type " << type << endl;
177 std::cout << (win_in_pre+aname).c_str() <<
" has " << ncomp <<
" components" << endl;
178 std::string waname = win_out_pre+aname;
182 std::cout <<
"Windowed attribute " << endl;
186 COM_get_size((win_in_pre+aname).c_str(), 0, &nitems, &ng);
194 std::cout <<
"Panel attribute" << endl;
197 for (
int i=0;
i<np; ++
i) {
202 COM_get_size((win_in_pre+aname).c_str(), pane_ids[
i], &nitems, &ng);
void Rocin_load_module(const char *name)
Load the module Rocin into Roccom using the given module name.
here we put it at the!beginning of the common block The point to point and collective!routines know about but MPI_TYPE_STRUCT as yet does not!MPI_STATUS_IGNORE and MPI_STATUSES_IGNORE are similar objects!Until the underlying MPI library implements the C version of these are declared as arrays of MPI_STATUS_SIZE!The types and are OPTIONAL!Their values are zero if they are not available Note that!using these reduces the portability of MPI_IO INTEGER MPI_BOTTOM INTEGER MPI_DOUBLE_PRECISION INTEGER MPI_LOGICAL INTEGER MPI_2REAL INTEGER MPI_2DOUBLE_COMPLEX INTEGER MPI_LB INTEGER MPI_WTIME_IS_GLOBAL INTEGER MPI_COMM_WORLD
void COM_get_attribute(const std::string wa_str, char *loc, int *type, int *ncomp, std::string *unit)
void COM_set_size(const char *wa_str, int pane_id, int size, int ng=0)
Set sizes of for a specific attribute.
This file contains the prototypes for Roccom API.
void COM_set_verbose(int i)
int COM_get_attribute_handle(const char *waname)
void COM_get_connectivities(const char *wname, int pane_id, int *nc, std::string &names)
void COM_get_attributes(const char *wname, int *na, std::string &names)
void COM_load_module(const char *libname, const char *winname)
void COM_print_profile(const char *fname, const char *header)
void COM_window_init_done(const char *w_str, int pane_changed=true)
void COM_get_size(const char *wa_str, int pane_id, int *size, int *ng=0)
Get the sizes of an attribute.
void COM_new_window(const char *wname, MPI_Comm c=MPI_COMM_NULL)
void COM_set_array_const(const char *wa_str, int pane_id, const void *addr, int strd=0, int cap=0)
void COM_set_profiling(int i)
void COM_call_function(const int wf, int argc,...)
Rocin creates a series of Roccom windows by reading in a list of files.
int main(int argc, char *argv[])
void Rocout_load_module(const char *name)
Load the module Rocout into Roccom using the given module name.
void COM_init(int *argc, char ***argv)
void COM_new_attribute(const char *wa_str, const char loc, const int type, int ncomp, const char *unit)
Registering an attribute type.
void COM_get_panes(const char *wname, std::vector< int > &pane_ids, int rank=-2)
void COM_free_buffer(int **buf)
void COM_resize_array(const char *wa_str, int pane_id=0, void **addr=NULL, int strd=-1, int cap=0)
Resize an attribute on a specific pane and return the address by setting addr.
int COM_get_function_handle(const char *wfname)
Contains declaration of the base class for Roccom implementations.