[MOAB-dev] commit/MOAB: iulian07: backport svn commit 6003 to branch Version4.6

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Sat Apr 13 19:40:25 CDT 2013


1 new commit in MOAB:

https://bitbucket.org/fathomteam/moab/commits/c4fb7a6cfda7/
Changeset:   c4fb7a6cfda7
Branch:      Version4.6
User:        iulian07
Date:        2013-04-14 02:24:06
Summary:     backport svn commit 6003 to branch Version4.6

problem with reading an nc file in serial, if compiled with mpi

Affected #:  1 file

diff --git a/src/io/ReadNC.cpp b/src/io/ReadNC.cpp
index 1d5ef06..d7bcb35 100644
--- a/src/io/ReadNC.cpp
+++ b/src/io/ReadNC.cpp
@@ -488,7 +488,10 @@ ErrorCode ReadNC::parse_options(const FileOptions &opts, std::vector<std::string
 
   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 @@ ErrorCode ReadNC::create_ucd_verts_quads(const FileOptions &opts, EntityHandle t
     // 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 @@ ErrorCode ReadNC::create_ucd_verts_quads(const FileOptions &opts, EntityHandle t
   //  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 @@ ErrorCode ReadNC::init_FVCDscd_vals(const FileOptions &opts, EntityHandle file_s
 
 #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 @@ ErrorCode ReadNC::create_quad_coordinate_tag(EntityHandle file_set) {
   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){
+    rval = myPcomm->filter_pstatus(ents, PSTATUS_NOT_OWNED, PSTATUS_NOT, -1, &ents_owned);
+    ERRORR(rval, "Trouble getting owned QUAD entity.");
+    numOwnedEnts = ents_owned.size();
+  }
+  else
+  {
+    numOwnedEnts = ents.size();
+    ents_owned = ents;
+  }
 #else
   numOwnedEnts = ents.size();
 #endif

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