[MOAB-dev] r5324 - in MOAB/trunk: src/parallel tools

tautges at mcs.anl.gov tautges at mcs.anl.gov
Thu Jan 19 00:52:49 CST 2012


Author: tautges
Date: 2012-01-19 00:52:45 -0600 (Thu, 19 Jan 2012)
New Revision: 5324

Modified:
   MOAB/trunk/src/parallel/WriteHDF5Parallel.cpp
   MOAB/trunk/tools/convert.cpp
Log:
Adding -M[0 | 1 | 2] option to mbconvert, rolls up all the parallel options
into one easy one (0=read, 1=resolve shared, 2=exchange ghosts.  Also remove a few 
unnecessary settings of MPI requests to null.



Modified: MOAB/trunk/src/parallel/WriteHDF5Parallel.cpp
===================================================================
--- MOAB/trunk/src/parallel/WriteHDF5Parallel.cpp	2012-01-17 15:02:18 UTC (rev 5323)
+++ MOAB/trunk/src/parallel/WriteHDF5Parallel.cpp	2012-01-19 06:52:45 UTC (rev 5324)
@@ -1539,14 +1539,15 @@
                   (unsigned long)(2*n+1), (int)status.MPI_SOURCE );
     
     for (size_t i = 0; i < n; ++i) {
-      EntityHandle handle;
+      EntityHandle handle = 0;
       rval = myPcomm->get_entityset_local_handle( procs[idx], recv_buf[idx][2*i+1], handle );
       CHECK_MB(rval);
+      assert(handle);
       if (!idMap.insert( handle, recv_buf[idx][2*i+2], 1 ).second)
         error(MB_FAILURE); // conflicting IDs??????
     }
     
-    recv_req[idx] = MPI_REQUEST_NULL;
+      //recv_req[idx] = MPI_REQUEST_NULL;
   }
   assert( MPI_SUCCESS == MPI_Waitany( recv_req.size(), &recv_req[0], &idx, &status )
        && MPI_UNDEFINED == idx ); // check that we got them all

Modified: MOAB/trunk/tools/convert.cpp
===================================================================
--- MOAB/trunk/tools/convert.cpp	2012-01-17 15:02:18 UTC (rev 5323)
+++ MOAB/trunk/tools/convert.cpp	2012-01-19 06:52:45 UTC (rev 5324)
@@ -68,6 +68,7 @@
 #ifdef USE_MPI
     << "\t-P             - Append processor ID to output file name" << std::endl
     << "\t-p             - Replace '%' with processor ID in input and output file name" << std::endl
+    << "\t-M[0|1|2]      - Read/write in parallel, optionally also doing resolve_shared_ents (1) and exchange_ghosts (2)" << std::endl
 #endif
     << "\t--             - treat all subsequent options as file names" << std::endl
     << "\t                 (allows file names beginning with '-')" << std::endl
@@ -170,6 +171,7 @@
   bool print_times = false;
   bool generate[] = { false, false, false };
   bool pval;
+  bool parallel = false, resolve_shared = false, exchange_ghosts = false;
   for (i = 1; i < argc; i++)
   {
     if (!argv[i][0])
@@ -177,7 +179,7 @@
       
     if (do_flag && argv[i][0] == '-')
     {
-      if (!argv[i][1] || argv[i][2])
+      if (!argv[i][1] || (argv[i][1] != 'M' && argv[i][2]))
         usage_error(argv[0]);
       


More information about the moab-dev mailing list