[MOAB-dev] commit/MOAB: vijaysm: Fix the refiner test case to work in serial when configured with MPI

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Sat Jul 12 02:56:26 CDT 2014


1 new commit in MOAB:

https://bitbucket.org/fathomteam/moab/commits/e672263c179c/
Changeset:   e672263c179c
Branch:      vijaysm/refiner_fixes
User:        vijaysm
Date:        2014-07-12 09:56:04
Summary:     Fix the refiner test case to work in serial when configured with MPI

Affected #:  1 file

diff --git a/tools/refiner/test_mesh_refiner.cpp b/tools/refiner/test_mesh_refiner.cpp
index 2d89131..b7ce7f6 100644
--- a/tools/refiner/test_mesh_refiner.cpp
+++ b/tools/refiner/test_mesh_refiner.cpp
@@ -63,13 +63,18 @@ int TestMeshRefiner( int argc, char* argv[] )
   EntityHandle set_handle;
   std::ostringstream parallel_options;
 #ifdef USE_MPI
-  parallel_options
-    << "PARALLEL=READ_DELETE" << ";" // NB: You can use BCAST_DELETE or READ_DELETE here.
-    //<< "PARALLEL=BCAST_DELETE" << ";" // NB: You can use BCAST_DELETE or READ_DELETE here.
-    << "PARTITION=MATERIAL_SET" << ";"
-    << "PARTITION_DISTRIBUTE" << ";"
-    << "PARALLEL_RESOLVE_SHARED_ENTS" << ";"
-    << "CPUTIME";
+  if (nprocs > 1) {
+    parallel_options
+      << "PARALLEL=READ_DELETE" << ";" // NB: You can use BCAST_DELETE or READ_DELETE here.
+      //<< "PARALLEL=BCAST_DELETE" << ";" // NB: You can use BCAST_DELETE or READ_DELETE here.
+      << "PARTITION=MATERIAL_SET" << ";"
+      << "PARTITION_DISTRIBUTE" << ";"
+      << "PARALLEL_RESOLVE_SHARED_ENTS" << ";"
+      << "CPUTIME";
+  }
+  else {
+    parallel_options << "CPUTIME;";
+  }
 #endif
   ErrorCode rval = imesh->create_meshset(MESHSET_SET, set_handle);
   if (MB_SUCCESS != rval) {
@@ -118,7 +123,8 @@ int TestMeshRefiner( int argc, char* argv[] )
 
   if (do_output) {
     parallel_options.clear();
-    parallel_options << "PARALLEL=WRITE_PART";
+    if (nprocs > 1)
+      parallel_options << "PARALLEL=WRITE_PART";
     omesh->write_file( output_filename.c_str(), NULL, parallel_options.str().c_str() );
   }

Repository URL: https://bitbucket.org/fathomteam/moab/

--

This is a commit notification from bitbucket.org. You are receiving
this because you have the service enabled, addressing the recipient of
this email.


More information about the moab-dev mailing list