[MOAB-dev] r2231 - MOAB/trunk

kraftche at mcs.anl.gov kraftche at mcs.anl.gov
Wed Nov 12 21:40:29 CST 2008


Author: kraftche
Date: 2008-11-12 21:40:29 -0600 (Wed, 12 Nov 2008)
New Revision: 2231

Modified:
   MOAB/trunk/MBCore.cpp
Log:
Add new read option 'PCOMM' used to specify which MBParallelComm instance to use during parallel read

Modified: MOAB/trunk/MBCore.cpp
===================================================================
--- MOAB/trunk/MBCore.cpp	2008-11-13 03:39:44 UTC (rev 2230)
+++ MOAB/trunk/MBCore.cpp	2008-11-13 03:40:29 UTC (rev 2231)
@@ -386,9 +386,19 @@
     // if reading in parallel, call a different reader
   std::string parallel_opt;
   rval = opts.get_option( "PARALLEL", parallel_opt);
-  if (MB_SUCCESS == rval && !parallel_opt.empty()) {
+  if (MB_SUCCESS == rval) {
 #ifdef USE_MPI    
-    return ReadParallel(this).load_file(file_name, file_set, opts,
+    MBParallelComm* pcomm = 0;
+    int pcomm_id;
+    rval = opts.get_int_option( "PCOMM", pcomm_id );
+    if (rval == MB_SUCCESS) {
+      pcomm = MBParallelComm::get_pcomm( this, pcomm_id );
+      if (!pcomm)
+        return MB_ENTITY_NOT_FOUND;
+    }
+    else if (rval != MB_TYPE_OUT_OF_RANGE) 
+      return rval;
+    return ReadParallel(this,pcomm).load_file(file_name, file_set, opts,
                                         block_id_list, num_blocks);
 #else
     mError->set_last_error( "PARALLEL option not valid, this instance"




More information about the moab-dev mailing list