#include "moab/Core.hpp"
#include <iostream>
#include <ctime>
Go to the source code of this file.
|
int | main (int argc, char **argv) |
|
◆ main()
int main |
( |
int |
argc, |
|
|
char ** |
argv |
|
) |
| |
- Examples
- ReadWriteTest.cpp.
Definition at line 25 of file ReadWriteTest.cpp.
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";
References moab::Core::create_meshset(), ErrorCode, input_file, moab::Core::load_file(), mb, MB_CHK_ERR, MESH_DIR, MESHSET_SET, moab::ParallelComm::proc_config(), moab::ProcConfig::proc_rank(), moab::ProcConfig::proc_size(), and moab::Core::write_file().