40 extern int read_obj( std::istream &is, std::vector<double> &coors,
41 std::vector<int> &elems);
43 int main(
int argc,
char *argv[]) {
47 std::cout <<
"Usage: " << argv[0]
48 <<
" <quad_prefix> <quad_num_blocks> <quad_suffix> "
49 <<
" <tri_prefix> <tri_num_blocks> <tri_suffix>" << std::endl;
59 const int comm_rank=0;
60 const int comm_size=1;
62 const char *quad_prefix = argv[1];
63 const int quad_num_blocks=atoi(argv[2]);
64 const char *quad_suffix = argv[3];
65 assert( quad_num_blocks <= 5);
67 const char *tri_prefix = argv[4];
68 const int tri_num_blocks=atoi(argv[5]);
69 const char *tri_suffix = argv[6];
70 assert( tri_num_blocks <= 5);
72 std::vector<double> quad_mesh_coors[5];
73 std::vector<int> quad_mesh_elems[5];
74 std::vector<double> quad_mesh_nd[5];
75 std::vector<double> quad_mesh_fd[5];
77 for (
int i=0;
i<quad_num_blocks; ++
i) {
78 if (
i%comm_size==comm_rank) {
80 std::sprintf( fname,
"%s%d%s", quad_prefix,
i+1, quad_suffix);
81 std::ifstream is( fname);
83 int n =
read_obj( is, quad_mesh_coors[
i], quad_mesh_elems[i]);
86 quad_mesh_nd[
i] = quad_mesh_coors[
i];
87 quad_mesh_fd[
i].resize( quad_mesh_elems[i].size()/4);
98 for (
int i=0;
i<quad_num_blocks; ++
i) {
99 if (
i%comm_size==comm_rank) {
102 COM_set_size(
"quad.:q4:", i+1, quad_mesh_elems[i].size()/4);
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_fd[5];
120 for (
int i=0;
i<tri_num_blocks; ++
i) {
121 if (
i%comm_size==comm_rank) {
123 std::sprintf( fname,
"%s%d%s", tri_prefix,
i+1, tri_suffix);
124 ifstream is( fname); assert( is != NULL);
125 int n =
read_obj( is, tri_mesh_coors[
i], tri_mesh_elems[i]);
126 assert( n==3 || n==6);
128 tri_mesh_nd[
i] = tri_mesh_coors[
i];
129 tri_mesh_fd[
i].resize( tri_mesh_elems[i].size()/3,1);
134 COM_set_size(
"tri.nc", i+1, tri_mesh_coors[i].size()/3);
137 std::sprintf( buf,
"tri.:t%d:", n);
153 if ( comm_size == 1) {
164 "tri",
"quad",
"HDF");
166 char prefix1[100], prefix2[100];
167 std::sprintf(prefix1,
"tri_%d", comm_rank);
168 std::sprintf(prefix2,
"quad_%d", comm_rank);
173 std::sprintf(prefix1,
"tri_fields%d", comm_rank);
180 std::sprintf(prefix2,
"quad_fields%d", comm_rank);
195 std::sprintf(prefix2,
"quad_fields%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)
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)
#define COM_EXTERN_MODULE(moduleName)