48 std::cout <<
"Usage: " << argv[0]
49 <<
" <str_prefix> <str_num_blocks> <str_suffix> "
50 <<
" <tri_prefix> <tri_num_blocks> <tri_suffix>" << std::endl;
60 const int comm_rank=0;
61 const int comm_size=1;
63 const char *str_prefix = argv[1];
64 const int str_num_blocks=atoi(argv[2]);
65 const char *str_suffix = argv[3];
66 assert( str_num_blocks <= 5);
68 const char *tri_prefix = argv[4];
69 const int tri_num_blocks=atoi(argv[5]);
70 const char *tri_suffix = argv[6];
71 assert( tri_num_blocks <= 5);
73 std::vector<double> str_mesh_coors[5];
74 std::vector<double> str_mesh_nd[5];
75 std::vector<double> str_mesh_npress[5];
76 std::vector<double> str_mesh_fpress[5];
79 for (
int i=0;
i<str_num_blocks; ++
i) {
80 if (
i%comm_size==comm_rank) {
82 std::sprintf( fname,
"%s%d%s", str_prefix,
i+1, str_suffix);
83 std::ifstream is( fname);
85 read_ij( is, str_mesh_coors[
i], dims[i]);
87 str_mesh_nd[
i] = str_mesh_coors[
i];
88 str_mesh_npress[
i].resize( dims[
i][0]*dims[
i][1]*3,3);
89 str_mesh_fpress[
i].resize( (dims[i][0]-1)*(dims[i][1]-1)*3,3);
99 for (
int i=0; i<str_num_blocks; ++
i) {
100 if ( i%comm_size==comm_rank) {
111 std::vector<double> tri_mesh_coors[5];
112 std::vector<int> tri_mesh_elems[5];
113 std::vector<double> tri_mesh_nd[5];
114 std::vector<double> tri_mesh_npress[5];
115 std::vector<double> tri_mesh_fpress[5];
117 for (
int i=0; i<tri_num_blocks; ++
i) {
118 if ( i%comm_size==comm_rank) {
120 std::sprintf( fname,
"%s%d%s", tri_prefix, i+1, tri_suffix);
121 ifstream is( fname); assert( is != NULL);
122 read_obj( is, tri_mesh_coors[i], tri_mesh_elems[i]);
124 tri_mesh_nd[
i] = tri_mesh_coors[
i];
125 tri_mesh_npress[
i].resize( tri_mesh_coors[i].size(),3);
126 tri_mesh_fpress[
i].resize( tri_mesh_elems[i].size(),3);
135 for (
int i=0; i<tri_num_blocks; ++
i) {
136 if ( i%comm_size==comm_rank) {
137 COM_set_size(
"tri.nc", i+1, tri_mesh_coors[i].size()/3);
139 COM_set_size(
"tri.:t3:", i+1, tri_mesh_elems[i].size()/3);
154 if ( comm_size == 1) {
164 "tri",
"str",
"HDF");
166 char prefix1[100], prefix2[100];
167 std::sprintf(prefix1,
"tri_%d", comm_rank);
168 std::sprintf(prefix2,
"str_%d", comm_rank);
172 std::sprintf(prefix1,
"tri_coor%d", comm_rank);
180 std::sprintf(prefix2,
"str_coor%d", comm_rank);
193 std::sprintf(prefix1,
"tri_press%d", comm_rank);
194 std::sprintf(prefix2,
"str_press%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.
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)
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.
void COM_init(int *argc, char ***argv)
void read_ij(std::istream &is, vector< double > &coors, int dims[2])
void COM_new_attribute(const char *wa_str, const char loc, const int type, int ncomp, const char *unit)
Registering an attribute type.
#define COM_LOAD_MODULE_STATIC_DYNAMIC(moduleName, windowString)
int COM_get_function_handle(const char *wfname)