[MOAB-dev] r3068 - MOAB/trunk/parallel

tautges at mcs.anl.gov tautges at mcs.anl.gov
Wed Jul 29 14:50:14 CDT 2009


Author: tautges
Date: 2009-07-29 14:50:13 -0500 (Wed, 29 Jul 2009)
New Revision: 3068

Modified:
   MOAB/trunk/parallel/ReadParallel.cpp
   MOAB/trunk/parallel/ReadParallel.hpp
   MOAB/trunk/parallel/pcomm_unit.cpp
Log:
Changing ParallelActions and ParallelActionNames to ReadParallel class
members, allowing them to be used from applications.  Updating
pcomm_unit to use the enumerated names instead of hardwired values, to
avoid errors if new actions get inserted.

Fixing call to load_file in pcomm_unit.



Modified: MOAB/trunk/parallel/ReadParallel.cpp
===================================================================
--- MOAB/trunk/parallel/ReadParallel.cpp	2009-07-28 22:07:30 UTC (rev 3067)
+++ MOAB/trunk/parallel/ReadParallel.cpp	2009-07-29 19:50:13 UTC (rev 3068)
@@ -22,16 +22,7 @@
       dynamic_cast<MBCore*>(mbImpl)->get_error_handler()->set_last_error(a); \
       return result;}
 
-enum ParallelActions {PA_READ=0, 
-                      PA_READ_PART, 
-                      PA_BROADCAST, 
-                      PA_DELETE_NONLOCAL,
-                      PA_CHECK_GIDS_SERIAL, 
-                      PA_GET_FILESET_ENTS, 
-                      PA_RESOLVE_SHARED_ENTS,
-                      PA_EXCHANGE_GHOSTS, 
-                      PA_PRINT_PARALLEL};
-const char *ParallelActionsNames[] = {
+const char *ReadParallel::ParallelActionsNames[]; = {
     "PARALLEL READ",
     "PARALLEL READ PART",
     "PARALLEL BROADCAST", 
@@ -50,7 +41,7 @@
                                                   "READ_PART", 
                                                   "", 
                                                   0 };
-      
+
 ReadParallel::ReadParallel(MBInterface* impl, 
                            MBParallelComm *pc) 
         : mbImpl(impl), myPcomm(pc) 

Modified: MOAB/trunk/parallel/ReadParallel.hpp
===================================================================
--- MOAB/trunk/parallel/ReadParallel.hpp	2009-07-28 22:07:30 UTC (rev 3067)
+++ MOAB/trunk/parallel/ReadParallel.hpp	2009-07-29 19:50:13 UTC (rev 3068)
@@ -61,6 +61,18 @@
 
   static const char *parallelOptsNames[];
   
+  enum ParallelActions {PA_READ=0, 
+                        PA_READ_PART, 
+                        PA_BROADCAST, 
+                        PA_DELETE_NONLOCAL,
+                        PA_CHECK_GIDS_SERIAL, 
+                        PA_GET_FILESET_ENTS, 
+                        PA_RESOLVE_SHARED_ENTS,
+                        PA_EXCHANGE_GHOSTS, 
+                        PA_PRINT_PARALLEL};
+
+  static const char *ParallelActionsNames[];
+  
   enum ParallelOpts { POPT_NONE=0, 
                       POPT_BCAST, 
                       POPT_BCAST_DELETE, 

Modified: MOAB/trunk/parallel/pcomm_unit.cpp
===================================================================
--- MOAB/trunk/parallel/pcomm_unit.cpp	2009-07-28 22:07:30 UTC (rev 3067)
+++ MOAB/trunk/parallel/pcomm_unit.cpp	2009-07-29 19:50:13 UTC (rev 3068)
@@ -1871,9 +1871,9 @@
   }
 
   std::vector<int> pa_vec;
-  pa_vec.push_back(0);
-  pa_vec.push_back(4);
-  pa_vec.push_back(2);
+  pa_vec.push_back(ReadParallel::PA_READ);
+  pa_vec.push_back(ReadParallel::PA_GET_FILESET_ENTS);
+  pa_vec.push_back(ReadParallel::PA_DELETE_NONLOCAL);
   MBErrorCode rval;
   std::vector<int> partition_tag_vals;
   bool partition_distrib = false;
@@ -1898,8 +1898,8 @@
     MBEntityHandle tmp_set = 0;
     rval = rp.load_file(fnames, 1, tmp_set, ReadParallel::POPT_READ_DELETE,
                         ptag_name, 
-                        partition_tag_vals, partition_distrib, pa_vec, 
-                        fopts, NULL, NULL, 0, i, false, -1, -1, -1, -1, 0);
+                        partition_tag_vals, partition_distrib, false, pa_vec, 
+                        fopts, NULL, 0, NULL, i, false, -1, -1, -1, -1, 0);
     CHECK_ERR(rval);
   }
   



More information about the moab-dev mailing list