[MOAB-dev] commit/MOAB: danwu: NC writer without pnetcdf support should return an error if launched in parallel.

commits-noreply at bitbucket.org commits-noreply at bitbucket.org
Tue Apr 22 11:40:03 CDT 2014


1 new commit in MOAB:

https://bitbucket.org/fathomteam/moab/commits/1eeccc88d716/
Changeset:   1eeccc88d716
Branch:      ncwriter
User:        danwu
Date:        2014-04-22 18:39:49
Summary:     NC writer without pnetcdf support should return an error if launched in parallel.

Affected #:  2 files

diff --git a/src/io/WriteNC.cpp b/src/io/WriteNC.cpp
index 2f96223..e665e26 100644
--- a/src/io/WriteNC.cpp
+++ b/src/io/WriteNC.cpp
@@ -185,10 +185,19 @@ ErrorCode WriteNC::parse_options(const FileOptions& opts, std::vector<std::strin
     mWriteIface->report_error("Invalid value for PARALLEL_COMM option.");
     return rval;
   }
+
   myPcomm = ParallelComm::get_pcomm(mbImpl, pcomm_no);
   if (0 == myPcomm) {
     myPcomm = new ParallelComm(mbImpl, MPI_COMM_WORLD);
   }
+
+#ifndef PNETCDF_FILE
+  const int procs = myPcomm->proc_config().proc_size();
+  if (procs > 1) {
+    ERRORR(MB_UNSUPPORTED_OPERATION, "Attempt to launch NC writer in parallel without pnetcdf support.");
+  }
+#endif
+
   const int rank = myPcomm->proc_config().proc_rank();
   dbgOut.set_rank(rank);
 #endif

diff --git a/test/io/write_nc.cpp b/test/io/write_nc.cpp
index 6a1b0be..827b102 100644
--- a/test/io/write_nc.cpp
+++ b/test/io/write_nc.cpp
@@ -74,6 +74,12 @@ void test_eul_read_write_T()
   MPI_Comm_size(MPI_COMM_WORLD, &procs);
 #endif
 
+// We will not test NC writer in parallel without pnetcdf support
+#ifndef PNETCDF_FILE
+  if (procs > 1)
+    return;
+#endif
+
   Core moab;
   Interface& mb = moab;
 
@@ -113,6 +119,12 @@ void test_eul_check_T()
   MPI_Comm_size(MPI_COMM_WORLD, &procs);
 #endif
 
+// We will not test NC writer in parallel without pnetcdf support
+#ifndef PNETCDF_FILE
+  if (procs > 1)
+    return;
+#endif
+
   Core moab;
   Interface& mb = moab;
 
@@ -212,6 +224,12 @@ void test_fv_read_write_T()
   MPI_Comm_size(MPI_COMM_WORLD, &procs);
 #endif
 
+// We will not test NC writer in parallel without pnetcdf support
+#ifndef PNETCDF_FILE
+  if (procs > 1)
+    return;
+#endif
+
   Core moab;
   Interface& mb = moab;
 
@@ -250,6 +268,12 @@ void test_fv_check_T()
   MPI_Comm_size(MPI_COMM_WORLD, &procs);
 #endif
 
+// We will not test NC writer in parallel without pnetcdf support
+#ifndef PNETCDF_FILE
+  if (procs > 1)
+    return;
+#endif
+
   Core moab;
   Interface& mb = moab;
 
@@ -327,6 +351,13 @@ void test_homme_read_write_T()
 #ifdef USE_MPI
   MPI_Comm_size(MPI_COMM_WORLD, &procs);
 #endif
+
+// We will not test NC writer in parallel without pnetcdf support
+#ifndef PNETCDF_FILE
+  if (procs > 1)
+    return;
+#endif
+
   // Only test serial case for the time being
   if (procs > 1)
     return;
@@ -360,6 +391,13 @@ void test_homme_check_T()
 #ifdef USE_MPI
   MPI_Comm_size(MPI_COMM_WORLD, &procs);
 #endif
+
+// We will not test NC writer in parallel without pnetcdf support
+#ifndef PNETCDF_FILE
+  if (procs > 1)
+    return;
+#endif
+
   // Only test serial case for the time being
   if (procs > 1)
     return;

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