[MOAB-dev] r4429 - MOAB/trunk/test/parallel

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Tue Jan 11 11:42:47 CST 2011


Author: kraftche
Date: 2011-01-11 11:42:47 -0600 (Tue, 11 Jan 2011)
New Revision: 4429

Modified:
   MOAB/trunk/test/parallel/parallel_hdf5_test.cc
Log:
clean up some code in parallel_hdf5_test and add an additional command line option

Modified: MOAB/trunk/test/parallel/parallel_hdf5_test.cc
===================================================================
--- MOAB/trunk/test/parallel/parallel_hdf5_test.cc	2011-01-11 16:14:37 UTC (rev 4428)
+++ MOAB/trunk/test/parallel/parallel_hdf5_test.cc	2011-01-11 17:42:47 UTC (rev 4429)
@@ -47,12 +47,45 @@
 void test_read_global_tags();
 void test_read_sets();
 
+const char PARTITION_TAG[] = "PARTITION";
+
 bool KeepTmpFiles = false;
 bool PauseOnStart = false;
+bool HyperslabAppend = false;
 const int DefaultReadIntervals = 2;
 int ReadDebugLevel = 0;
 int WriteDebugLevel = 0;
+int ReadBlocks = 1;
 
+enum Mode { READ_PART, READ_DELETE, BCAST_DELETE };
+std::string get_read_options( bool by_rank = false, Mode mode = READ_PART )
+{
+  int numproc;
+  MPI_Comm_size( MPI_COMM_WORLD, &numproc );
+  
+    // do parallel read unless only one processor
+  std::ostringstream str;
+  if (numproc > 1) {
+    str << "PARALLEL=";
+    switch (mode) {
+      case READ_PART: str << "READ_PART"; break;
+      case READ_DELETE: str << "READ_DELETE"; break;
+      case BCAST_DELETE: str << "BCAST_DELETE"; break;
+    }
+    str << ";PARTITION=" << PARTITION_TAG << ";";
+    if (by_rank)
+      str << "PARTITION_BY_RANK;";
+  }
+
+  if (ReadDebugLevel)
+    str << "DEBUG_IO=" << ReadDebugLevel << ";";
+
+  if (HyperslabAppend)
+    str << "HYPERSLAB_APPEND;HYPERSLAB_SELECT_LIMIT=2147483647";
+
+  return str.str();
+}
+
 int main( int argc, char* argv[] )
 {
   int err = MPI_Init( &argc, &argv );
@@ -69,6 +102,12 @@


More information about the moab-dev mailing list