[MOAB-dev] r6003 - MOAB/trunk/src/io

iulian at mcs.anl.gov iulian at mcs.anl.gov
Thu Feb 14 11:20:57 CST 2013


Author: iulian
Date: 2013-02-14 11:20:57 -0600 (Thu, 14 Feb 2013)
New Revision: 6003

Modified:
   MOAB/trunk/src/io/ReadNC.cpp
Log:
mbsize and mbconvert for NC files worked only if READ_PART was passed as an option
now, check more carefully for USE_MPI and isParallel flag; 
 local member data myPcomm is not initialized, except if the READ_PART option is used
 so do not use myPcomm if isParallel is false


Modified: MOAB/trunk/src/io/ReadNC.cpp
===================================================================
--- MOAB/trunk/src/io/ReadNC.cpp	2013-02-14 17:04:34 UTC (rev 6002)
+++ MOAB/trunk/src/io/ReadNC.cpp	2013-02-14 17:20:57 UTC (rev 6003)
@@ -488,7 +488,10 @@
 
   if (!isParallel)
   // return success here, since rval still has _NOT_FOUND from not finding option
+  // in this case, myPcomm will be NULL, so it can never be used; always check for isParallel 
+  // before any use for myPcomm
     return MB_SUCCESS;
+  
 
   int pcomm_no = 0;
   rval = opts.get_int_option("PARALLEL_COMM", pcomm_no);
@@ -724,7 +727,8 @@
     // in one shot
   bool create_gathers = true;
 #ifdef USE_MPI
-  if (myPcomm->proc_config().proc_rank() != 0) create_gathers = false;
+  if (isParallel)
+    if (myPcomm->proc_config().proc_rank() != 0) create_gathers = false;
 #endif
 
     // compute the number of local quads, accounting for coarse or fine representation
@@ -866,7 +870,7 @@
   //  if (gatherOpt) {
 
 #ifdef USE_MPI
-  if (myPcomm->proc_config().proc_rank() == 0) {
+  if (isParallel && myPcomm->proc_config().proc_rank() == 0) {
 #endif
     EntityHandle gather_set;    
     rval = mbImpl->create_meshset(MESHSET_SET, gather_set);
@@ -1986,7 +1990,7 @@
 
 #ifdef USE_MPI
   // if serial, use a locally-periodic representation only if local mesh is periodic, otherwise don't
-  if ((myPcomm->proc_config().proc_size() == 1) && globallyPeriodic[0])
+  if ((isParallel && myPcomm->proc_config().proc_size() == 1) && globallyPeriodic[0])
   locallyPeriodic[0] = 1;
 #else
   if (globallyPeriodic[0])
@@ -3335,9 +3339,16 @@
   std::size_t numOwnedEnts = 0;
 #ifdef USE_MPI
   Range ents_owned;
-  rval = myPcomm->filter_pstatus(ents, PSTATUS_NOT_OWNED, PSTATUS_NOT, -1, &ents_owned);
-  ERRORR(rval, "Trouble getting owned QUAD entity.");
-  numOwnedEnts = ents_owned.size();
+  if (isParallel){


More information about the moab-dev mailing list