[MOAB-dev] commit/MOAB: danwu: Eliminated compiler warnings ([-Wunused-variable]) in NCHelper classes for serial build.

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Tue Aug 13 13:55:53 CDT 2013


1 new commit in MOAB:

https://bitbucket.org/fathomteam/moab/commits/0c61a19979ec/
Changeset:   0c61a19979ec
Branch:      master
User:        danwu
Date:        2013-08-13 20:55:37
Summary:     Eliminated compiler warnings ([-Wunused-variable]) in NCHelper classes for serial build.

Affected #:  3 files

diff --git a/src/io/NCHelper.cpp b/src/io/NCHelper.cpp
index ebe88b6..0fca661 100644
--- a/src/io/NCHelper.cpp
+++ b/src/io/NCHelper.cpp
@@ -1019,7 +1019,6 @@ ErrorCode ScdNCHelper::read_scd_variable_to_nonset_allocate(std::vector<ReadNC::
   Interface*& mbImpl = _readNC->mbImpl;
   std::vector<int>& dimVals = _readNC->dimVals;
   DebugOutput& dbgOut = _readNC->dbgOut;
-  bool& isParallel = _readNC->isParallel;
 
   ErrorCode rval = MB_SUCCESS;
 
@@ -1045,6 +1044,7 @@ ErrorCode ScdNCHelper::read_scd_variable_to_nonset_allocate(std::vector<ReadNC::
 
 #ifdef USE_MPI
   moab::Range faces_owned;
+  bool& isParallel = _readNC->isParallel;
   if (isParallel) {
     ParallelComm*& myPcomm = _readNC->myPcomm;
     rval = myPcomm->filter_pstatus(faces, PSTATUS_NOT_OWNED, PSTATUS_NOT, -1, &faces_owned);
@@ -1269,7 +1269,6 @@ ErrorCode ScdNCHelper::read_scd_variable_to_nonset(std::vector<ReadNC::VarData>&
 
 ErrorCode ScdNCHelper::create_quad_coordinate_tag() {
   Interface*& mbImpl = _readNC->mbImpl;
-  bool& isParallel = _readNC->isParallel;
 
   Range ents;
   ErrorCode rval = mbImpl->get_entities_by_type(_fileSet, moab::MBQUAD, ents);
@@ -1278,6 +1277,7 @@ ErrorCode ScdNCHelper::create_quad_coordinate_tag() {
   std::size_t numOwnedEnts = 0;
 #ifdef USE_MPI
   Range ents_owned;
+  bool& isParallel = _readNC->isParallel;
   if (isParallel) {
     ParallelComm*& myPcomm = _readNC->myPcomm;
     rval = myPcomm->filter_pstatus(ents, PSTATUS_NOT_OWNED, PSTATUS_NOT, -1, &ents_owned);

diff --git a/src/io/NCHelperHOMME.cpp b/src/io/NCHelperHOMME.cpp
index acee3a5..d6138b2 100644
--- a/src/io/NCHelperHOMME.cpp
+++ b/src/io/NCHelperHOMME.cpp
@@ -216,7 +216,6 @@ ErrorCode NCHelperHOMME::create_mesh(Range& faces)
   Tag& mGlobalIdTag = _readNC->mGlobalIdTag;
   const Tag*& mpFileIdTag = _readNC->mpFileIdTag;
   DebugOutput& dbgOut = _readNC->dbgOut;
-  bool& isParallel = _readNC->isParallel;
   bool& spectralMesh = _readNC->spectralMesh;
   int& gatherSetRank = _readNC->gatherSetRank;
 
@@ -239,6 +238,7 @@ ErrorCode NCHelperHOMME::create_mesh(Range& faces)
 
   int rank = 0, procs = 1;
 #ifdef USE_MPI
+  bool& isParallel = _readNC->isParallel;
   if (isParallel) {
     ParallelComm*& myPcomm = _readNC->myPcomm;
     rank = myPcomm->proc_config().proc_rank();
@@ -247,12 +247,14 @@ ErrorCode NCHelperHOMME::create_mesh(Range& faces)
 #endif
 
 #ifdef PNETCDF_FILE
+#ifdef USE_MPI
   if (isParallel) {
     ParallelComm*& myPcomm = _readNC->myPcomm;
     success = NCFUNC(open)(myPcomm->proc_config().proc_comm(), conn_fname.c_str(), 0, MPI_INFO_NULL, &connectId);
   }
   else
     success = NCFUNC(open)(MPI_COMM_SELF, conn_fname.c_str(), 0, MPI_INFO_NULL, &connectId);
+#endif
 #else
   success = NCFUNC(open)(conn_fname.c_str(), 0, &connectId);
 #endif

diff --git a/src/io/NCHelperMPAS.cpp b/src/io/NCHelperMPAS.cpp
index 042b1f5..9af4571 100644
--- a/src/io/NCHelperMPAS.cpp
+++ b/src/io/NCHelperMPAS.cpp
@@ -269,10 +269,10 @@ ErrorCode NCHelperMPAS::create_mesh(Range& faces)
   Interface*& mbImpl = _readNC->mbImpl;
   Tag& mGlobalIdTag = _readNC->mGlobalIdTag;
   const Tag*& mpFileIdTag = _readNC->mpFileIdTag;
-  bool& isParallel = _readNC->isParallel;
 
   int rank = 0, procs = 1;
 #ifdef USE_MPI
+  bool& isParallel = _readNC->isParallel;
   if (isParallel) {
     ParallelComm*& myPcomm = _readNC->myPcomm;
     rank = myPcomm->proc_config().proc_rank();
@@ -567,7 +567,6 @@ ErrorCode NCHelperMPAS::read_ucd_variable_to_nonset_allocate(std::vector<ReadNC:
   Interface*& mbImpl = _readNC->mbImpl;
   std::vector<int>& dimVals = _readNC->dimVals;
   DebugOutput& dbgOut = _readNC->dbgOut;
-  bool& isParallel = _readNC->isParallel;
 
   ErrorCode rval = MB_SUCCESS;
 
@@ -592,6 +591,7 @@ ErrorCode NCHelperMPAS::read_ucd_variable_to_nonset_allocate(std::vector<ReadNC:
   // Note, for MPAS faces.psize() can be more than 1
 
 #ifdef USE_MPI
+  bool& isParallel = _readNC->isParallel;
   if (isParallel) {
     ParallelComm*& myPcomm = _readNC->myPcomm;
     rval = myPcomm->filter_pstatus(faces, PSTATUS_NOT_OWNED, PSTATUS_NOT, -1, &facesOwned);

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