[MOAB-dev] commit/MOAB: 2 new changesets
commits-noreply at bitbucket.org
commits-noreply at bitbucket.org
Fri Aug 2 09:53:44 CDT 2013
2 new commits in MOAB:
https://bitbucket.org/fathomteam/moab/commits/ac77a646c30c/
Changeset: ac77a646c30c
Branch: None
User: danwu
Date: 2013-08-02 16:39:52
Summary: Fix some issues for parallel MOAB built WITHOUT pnetcdf. Currently, unit tests in PNETCDF_TESTS are NOT run by make check for this kind of build. These parallel tests (including ucdtrvpart and mpastrvpart) do cover some functions that use netcdf instead of pnetcdf, so they should be tested as well. After test/parallel/Makefile.am was updated to merge PNETCDF_TESTS into NETCDF_TESTS, two tests (ucdtrvpart and mpastrvpart) failed:
1) If PNETCDF_FILE is not defined, rank is set to 0 and procs is set to 1 to create the mesh, despite the fact that USE_MPI is defined and isParallel is true
2) In NCHelperHOMME::read_ucd_variable_to_nonset(), kji_to_jik() is used to transpose data instead of kji_to_jik_stride(), which only works when localGid has psize 1.
These bugs (not reproducible for serial MOAB or parallel MOAB with pnetcdf) have been in the code for a long time (before NCHelpers were introduced), and make check passed after they were fixed.
Affected #: 3 files
diff --git a/src/io/NCHelperHOMME.cpp b/src/io/NCHelperHOMME.cpp
index 058dfaf..0a7802f 100644
--- a/src/io/NCHelperHOMME.cpp
+++ b/src/io/NCHelperHOMME.cpp
@@ -247,9 +247,6 @@ ErrorCode NCHelperHOMME::create_mesh(ScdInterface* scdi, const FileOptions& opts
DebugOutput& dbgOut = _readNC->dbgOut;
bool& isParallel = _readNC->isParallel;
Range& localGid = _readNC->localGid;
-#ifdef USE_MPI
- ParallelComm*& myPcomm = _readNC->myPcomm;
-#endif
bool& spectralMesh = _readNC->spectralMesh;
int& gatherSetRank = _readNC->gatherSetRank;
@@ -270,22 +267,24 @@ ErrorCode NCHelperHOMME::create_mesh(ScdInterface* scdi, const FileOptions& opts
int success;
- int rank, procs;
-#ifdef PNETCDF_FILE
+ int rank = 0, procs = 1;
+#ifdef USE_MPI
if (isParallel) {
- success = NCFUNC(open)(myPcomm->proc_config().proc_comm(), conn_fname.c_str(), 0, MPI_INFO_NULL, &connectId);
+ ParallelComm*& myPcomm = _readNC->myPcomm;
rank = myPcomm->proc_config().proc_rank();
procs = myPcomm->proc_config().proc_size();
}
+#endif
+
+#ifdef PNETCDF_FILE
+ if (isParallel) {
+ 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);
- rank = 0;
- procs = 1;
}
#else
success = NCFUNC(open)(conn_fname.c_str(), 0, &connectId);
- rank = 0;
- procs = 1;
#endif
ERRORS(success, "Failed on open.");
@@ -333,12 +332,7 @@ ErrorCode NCHelperHOMME::create_mesh(ScdInterface* scdi, const FileOptions& opts
// Need to know whether we'll be creating gather mesh later, to make sure we allocate enough space
// in one shot
bool create_gathers = false;
- int proc_rank = 0;
-#ifdef USE_MPI
- if (isParallel)
- proc_rank = myPcomm->proc_config().proc_rank();
-#endif
- if (proc_rank == gatherSetRank)
+ if (rank == gatherSetRank)
create_gathers = true;
// compute the number of local quads, accounting for coarse or fine representation
@@ -888,17 +882,7 @@ ErrorCode NCHelperHOMME::read_ucd_variable_to_nonset(EntityHandle file_set, std:
switch (vdatas[i].varDataType) {
case NC_BYTE:
case NC_CHAR: {
- std::vector<char> tmpchardata(sz);
- success = NCFUNCAG(_vara_text)(_fileId, vdatas[i].varId, &vdatas[i].readStarts[t][0], &vdatas[i].readCounts[t][0],
- &tmpchardata[0] NCREQ);
- if (vdatas[i].numLev != 1)
- // switch from k varying slowest to k varying fastest
- success = _readNC->kji_to_jik(ni, nj, nk, data, &tmpchardata[0]);
- else {
- for (std::size_t idx = 0; idx != tmpchardata.size(); idx++)
- ((char*) data)[idx] = tmpchardata[idx];
- }
- ERRORS(success, "Failed to read char data.");
+ ERRORR(MB_FAILURE, "not implemented");
break;
}
case NC_DOUBLE: {
@@ -935,7 +919,7 @@ ErrorCode NCHelperHOMME::read_ucd_variable_to_nonset(EntityHandle file_set, std:
if (vdatas[i].numLev != 1)
// Switch from k varying slowest to k varying fastest
- success = _readNC->kji_to_jik(ni, nj, nk, data, &tmpdoubledata[0]);
+ success = _readNC->kji_to_jik_stride(ni, nj, nk, data, &tmpdoubledata[0]);
else {
for (std::size_t idx = 0; idx != tmpdoubledata.size(); idx++)
((double*) data)[idx] = tmpdoubledata[idx];
@@ -976,7 +960,7 @@ ErrorCode NCHelperHOMME::read_ucd_variable_to_nonset(EntityHandle file_set, std:
if (vdatas[i].numLev != 1)
// Switch from k varying slowest to k varying fastest
- success = _readNC->kji_to_jik(ni, nj, nk, data, &tmpfloatdata[0]);
+ success = _readNC->kji_to_jik_stride(ni, nj, nk, data, &tmpfloatdata[0]);
else {
for (std::size_t idx = 0; idx != tmpfloatdata.size(); idx++)
((float*) data)[idx] = tmpfloatdata[idx];
@@ -985,31 +969,11 @@ ErrorCode NCHelperHOMME::read_ucd_variable_to_nonset(EntityHandle file_set, std:
break;
}
case NC_INT: {
- std::vector<int> tmpintdata(sz);
- success = NCFUNCAG(_vara_int)(_fileId, vdatas[i].varId, &vdatas[i].readStarts[t][0], &vdatas[i].readCounts[t][0],
- &tmpintdata[0] NCREQ);
- if (vdatas[i].numLev != 1)
- // Switch from k varying slowest to k varying fastest
- success = _readNC->kji_to_jik(ni, nj, nk, data, &tmpintdata[0]);
- else {
- for (std::size_t idx = 0; idx != tmpintdata.size(); idx++)
- ((int*) data)[idx] = tmpintdata[idx];
- }
- ERRORS(success, "Failed to read int data.");
+ ERRORR(MB_FAILURE, "not implemented");
break;
}
case NC_SHORT: {
- std::vector<short> tmpshortdata(sz);
- success = NCFUNCAG(_vara_short)(_fileId, vdatas[i].varId, &vdatas[i].readStarts[t][0], &vdatas[i].readCounts[t][0],
- &tmpshortdata[0] NCREQ);
- if (vdatas[i].numLev != 1)
- // Switch from k varying slowest to k varying fastest
- success = _readNC->kji_to_jik(ni, nj, nk, data, &tmpshortdata[0]);
- else {
- for (std::size_t idx = 0; idx != tmpshortdata.size(); idx++)
- ((short*) data)[idx] = tmpshortdata[idx];
- }
- ERRORS(success, "Failed to read short data.");
+ ERRORR(MB_FAILURE, "not implemented");
break;
}
default:
diff --git a/src/io/NCHelperMPAS.cpp b/src/io/NCHelperMPAS.cpp
index 3fa43c0..469a89d 100644
--- a/src/io/NCHelperMPAS.cpp
+++ b/src/io/NCHelperMPAS.cpp
@@ -277,23 +277,14 @@ ErrorCode NCHelperMPAS::create_mesh(ScdInterface* scdi, const FileOptions& opts,
Tag& mGlobalIdTag = _readNC->mGlobalIdTag;
const Tag*& mpFileIdTag = _readNC->mpFileIdTag;
bool& isParallel = _readNC->isParallel;
-#ifdef USE_MPI
- ParallelComm*& myPcomm = _readNC->myPcomm;
-#endif
- int rank, procs;
-#ifdef PNETCDF_FILE
+ int rank = 0, procs = 1;
+#ifdef USE_MPI
if (isParallel) {
+ ParallelComm*& myPcomm = _readNC->myPcomm;
rank = myPcomm->proc_config().proc_rank();
procs = myPcomm->proc_config().proc_size();
}
- else {
- rank = 0;
- procs = 1;
- }
-#else
- rank = 0;
- procs = 1;
#endif
ErrorCode rval;
diff --git a/test/parallel/Makefile.am b/test/parallel/Makefile.am
index cde37b0..ec647ef 100644
--- a/test/parallel/Makefile.am
+++ b/test/parallel/Makefile.am
@@ -36,8 +36,7 @@ TESTS = pcomm_unit \
uber_parallel_test \
scdtest \
pcomm_serial \
- $(NETCDF_TESTS) \
- $(PNETCDF_TESTS) \
+ $(NETCDF_TESTS) \
$(HDF5_TESTS) \
$(COUPLER_TESTS) \
$(MBCSLAM_TESTS)
@@ -49,15 +48,15 @@ else
endif
if NETCDF_FILE
- NETCDF_TESTS = scdpart
+ NETCDF_TESTS = scdpart read_nc_par ucdtrvpart mpastrvpart
else
NETCDF_TESTS =
endif
if PNETCDF_FILE
- PNETCDF_TESTS = ucdtrvpart read_nc_par mpastrvpart
-else
- PNETCDF_TESTS =
+ if !NETCDF_FILE
+ NETCDF_TESTS = scdpart read_nc_par ucdtrvpart mpastrvpart
+ endif
endif
if ENABLE_mbcoupler
@@ -87,15 +86,13 @@ partcheck_SOURCES = partcheck.cpp
structured3_SOURCES = structured3.cpp
parmerge_SOURCES = parmerge.cpp
scdpart_SOURCES = scdpart.cpp
-if PNETCDF_FILE
- ucdtrvpart_SOURCES = ucdtrvpart.cpp
- read_nc_par_SOURCES=../io/read_nc.cpp
- mpastrvpart_SOURCES = mpastrvpart.cpp
-endif
+read_nc_par_SOURCES = ../io/read_nc.cpp
+ucdtrvpart_SOURCES = ucdtrvpart.cpp
+mpastrvpart_SOURCES = mpastrvpart.cpp
if ENABLE_mbcoupler
- par_coupler_test_SOURCES=par_coupler_test.cpp
- par_coupler_test_LDADD=$(LDADD) ../../tools/mbcoupler/libmbcoupler.la
+ par_coupler_test_SOURCES = par_coupler_test.cpp
+ par_coupler_test_LDADD = $(LDADD) ../../tools/mbcoupler/libmbcoupler.la
endif
if ENABLE_mbcslam
https://bitbucket.org/fathomteam/moab/commits/39a33a567a6c/
Changeset: 39a33a567a6c
Branch: master
User: danwu
Date: 2013-08-02 16:53:13
Summary: Merge branch 'master' of https://bitbucket.org/fathomteam/moab
Affected #: 3 files
diff --git a/configure.ac b/configure.ac
index 24f425b..b08389a 100644
--- a/configure.ac
+++ b/configure.ac
@@ -1146,6 +1146,7 @@ AC_SUBST(CGM_CPPFLAGS)
AC_SUBST(CGM_LDFLAGS)
AC_SUBST(CGM_LTFLAGS)
AC_SUBST(CGM_LIBS)
+AC_SUBST(CGM_DIR)
AM_CONDITIONAL( HAVE_CGM, [test "x$CGM_MISSING" = "xno"] )
diff --git a/tools/Makefile.am b/tools/Makefile.am
index 121a101..0789a83 100644
--- a/tools/Makefile.am
+++ b/tools/Makefile.am
@@ -11,6 +11,10 @@ if ENABLE_imesh
LDADD+= $(top_builddir)/itaps/imesh/libiMesh.la
endif
+if HAVE_CGM
+ LDADD+= ${CGM_DIR}/lib/libcgm.la
+endif
+
# For old (pre 1.10.x) versions of Automake
docdir = @docdir@
diff --git a/tools/dagmc/Makefile.am b/tools/dagmc/Makefile.am
index b8cc771..29d43a5 100644
--- a/tools/dagmc/Makefile.am
+++ b/tools/dagmc/Makefile.am
@@ -31,7 +31,10 @@ CGM_LDFLAGS = @CGM_LDFLAGS@
CGM_LTFLAGS = @CGM_LTFLAGS@
CGM_LIBS = @CGM_LIBS@
-LDADD = libdagmc.la $(top_builddir)/src/libMOAB.la $(CGM_LDFLAGS) $(CGM_LIBS)
+LDADD = libdagmc.la $(top_builddir)/src/libMOAB.la
+if HAVE_CGM
+ LDADD += $(CGM_DIR)/lib/libcgm.la
+endif
TESTS =
if HDF5_FILE
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