25 int main(
int argc,
char** argv )
28 string input_file, output_file, read_opts, write_opts;
30 MPI_Init( &argc, &argv );
35 #ifdef MOAB_HAVE_NETCDF
37 output_file =
"ReadWriteTestOut.h5m";
38 read_opts =
"PARALLEL=READ_PART;PARTITION_METHOD=SQIJ;PARALLEL_RESOLVE_SHARED_ENTS;VARIABLE=T,U";
39 write_opts =
"PARALLEL=WRITE_PART";
41 cout <<
"Usage: mpiexec -n $NP ReadWriteTest [input] [output] -O <read_opts> -o "
49 output_file = argv[2];
57 if( !strcmp( argv[index],
"-O" ) )
58 read_opts = argv[++index];
59 if( !strcmp( argv[index],
"-o" ) ) write_opts = argv[++index];
66 if( NULL ==
mb )
return 1;
79 cout <<
"Reading file " <<
input_file <<
"\n with options: " << read_opts <<
"\n on " << nprocs
87 cout <<
"Time: " << ( clock() - tt ) / (
double)CLOCKS_PER_SEC <<
" seconds" << endl;
96 cout <<
"Writing file " << output_file <<
"\n with options: " << write_opts << endl;
97 cout <<
"Time: " << ( clock() - tt ) / (
double)CLOCKS_PER_SEC <<
" seconds" << endl;
105 std::cout <<
" compile MOAB with mpi for this example to work\n";