41 extern int read_obj( std::istream &is, vector<double> &coors,
44 int main(
int argc,
char *argv[]) {
48 std::cout <<
"Usage: " << argv[0]
49 <<
" <t1_prefix> <t1_num_blocks> <t1_suffix> <t2_prefix>"
50 <<
" <t2_num_blocks> <t2_suffix>" << std::endl;
60 const int comm_rank=0;
61 const int comm_size=1;
63 const char *t1_prefix = argv[1];
64 const int t1_num_blocks=atoi(argv[2]);
65 const char *t1_suffix = argv[3];
66 assert( t1_num_blocks <= 5);
68 std::vector<double> t1_mesh_coors[5];
69 std::vector<int> t1_mesh_elems[5];
71 for (
int i=0;
i<t1_num_blocks; ++
i)
if (
i%comm_size==comm_rank) {
73 std::sprintf( fname,
"%s%d%s", t1_prefix,
i+1, t1_suffix);
74 std::ifstream is( fname);
76 read_obj( is, t1_mesh_coors[
i], t1_mesh_elems[i]);
80 for (
int i=0;
i<t1_num_blocks; ++
i)
if (
i%comm_size==comm_rank) {
83 COM_set_size(
"tri1.:t3:", i+1, t1_mesh_elems[i].size()/3);
88 const char *t2_prefix = argv[4];
89 const int t2_num_blocks=atoi(argv[5]);
90 const char *t2_suffix = argv[6];
91 assert( t2_num_blocks <= 5);
93 std::vector<double> t2_mesh_coors[5];
94 std::vector<int> t2_mesh_elems[5];
96 for (
int i=0;
i<t2_num_blocks; ++
i)
if (
i%comm_size==comm_rank) {
98 std::sprintf( fname,
"%s%d%s", t2_prefix,
i+1, t2_suffix);
99 std::ifstream is( fname);
101 read_obj( is, t2_mesh_coors[
i], t2_mesh_elems[i]);
104 for (
int i=0;
i<t2_num_blocks; ++
i)
if (
i%comm_size==comm_rank) {
107 COM_set_size(
"tri2.:t3:", i+1, t2_mesh_elems[i].size()/3);
127 "tri1",
"tri2",
"HDF");
129 char prefix1[100], prefix2[100];
130 std::sprintf(prefix1,
"tri1_%d", comm_rank);
131 std::sprintf(prefix2,
"tri2_%d", comm_rank);
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_delete_window(const char *wname)
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)
int read_obj(std::istream &is, vector< double > &coors, vector< int > &elems)
void COM_print_profile(const char *fname, const char *header)
Contains declarations of MPI subroutines used in Roccom.
void COM_window_init_done(const char *w_str, int pane_changed=true)
void COM_new_window(const char *wname, MPI_Comm c=MPI_COMM_NULL)
void COM_set_profiling(int i)
void COM_call_function(const int wf, int argc,...)
void COM_set_array(const char *wa_str, int pane_id, void *addr, int strd=0, int cap=0)
Associates an array with an attribute for a specific pane.
int main(int argc, char *argv[])
void COM_init(int *argc, char ***argv)
#define COM_LOAD_MODULE_STATIC_DYNAMIC(moduleName, windowString)
int COM_get_function_handle(const char *wfname)
#define COM_EXTERN_MODULE(moduleName)