34 int ierr = MPI_Comm_rank( comm, &rank); assert( ierr == 0);
39 int ierr = MPI_Comm_size( comm, &size); assert( ierr == 0);
43 int main(
int argc,
char *argv[]) {
44 MPI_Init( &argc, &argv);
50 std::cout <<
"myrank = " << myrank <<
" and size_of_p = " << size_of_p << std::endl;
53 assert(size_of_p==2 && myrank <2);
56 cout <<
"Reading mesh file \"" << argv[1] <<
'"' << endl;
58 std::string wname(
"surf");
60 cout <<
"Creating window \"" << wname <<
'"' << endl;
64 cout <<
"Loading Rocin" << endl;
67 std::string fname(
"surf000");
73 cout <<
"Reading file " << fname << endl;
76 (
"test/"+fname).c_str(),
81 std::cout <<
"Obtaining the mesh " << endl;
88 std::cout <<
"Resizing the attribute arrays " << endl;
96 std::cout << npanes <<
" panes found" << endl;
99 std::cout<<
"Labeling nodes with pane ids" << endl;
105 for(
int j = 0;
j <npanes; ++
j){
108 for(
int k =0;
k<nitems; ++
k){
109 ptr[
k] = pane_ids[
j];
115 cout <<
"Loading Rocmap" << endl;
119 std::cout <<
"Performing an average-reduction on shared nodes." << endl;
124 std::cout <<
"Updating ghost nodes." << endl;
129 std::cout <<
"finishing up window initialization" << endl;
133 std::cout <<
"loading Rocout" << endl;
136 const string pconn = wname+
".pconn";
139 string newfile =
"smoothed" + fname;
141 std::cout <<
"Outputting window into file " << newfile << endl;
147 (
char*)wname.c_str(),
"0000");
#define COM_assertion(EX)
Error checking utility similar to the assert macro of the C language.
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
int get_comm_rank(MPI_Comm comm)
This file contains the prototypes for Roccom API.
void COM_get_array(const char *wa_str, int pane_id, void **addr, int *strd, int *cap)
Get the address for an attribute on a specific pane.
int COM_get_attribute_handle(const char *waname)
void COM_load_module(const char *libname, const char *winname)
int get_comm_size(MPI_Comm comm)
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_call_function(const int wf, int argc,...)
int main(int argc, char *argv[])
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_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)