[MOAB-dev] r3873 - MOAB/trunk/src/parallel

kraftche at cae.wisc.edu kraftche at cae.wisc.edu
Mon May 10 14:54:02 CDT 2010


Author: kraftche
Date: 2010-05-10 14:54:02 -0500 (Mon, 10 May 2010)
New Revision: 3873

Modified:
   MOAB/trunk/src/parallel/ReadParallel.cpp
   MOAB/trunk/src/parallel/ReadParallel.hpp
Log:
make some debug output in ReadParallel run-time configurable

Modified: MOAB/trunk/src/parallel/ReadParallel.cpp
===================================================================
--- MOAB/trunk/src/parallel/ReadParallel.cpp	2010-05-10 19:53:32 UTC (rev 3872)
+++ MOAB/trunk/src/parallel/ReadParallel.cpp	2010-05-10 19:54:02 UTC (rev 3873)
@@ -45,12 +45,15 @@
 
 ReadParallel::ReadParallel(Interface* impl, 
                            ParallelComm *pc) 
-        : mbImpl(impl), myPcomm(pc) 
+        : mbImpl(impl), myPcomm(pc), myDebug("ReadPara", std::cerr)
 {
   if (!myPcomm) {
     myPcomm = ParallelComm::get_pcomm(mbImpl, 0);
     if (NULL == myPcomm) myPcomm = new ParallelComm(mbImpl);
   }
+  myDebug.set_rank( myPcomm->proc_config().proc_rank() );
+  if (debug) // for backwards compatability, enable all debug output if constant is true
+    myDebug.set_verbosity(10);
 }
 
 ErrorCode ReadParallel::load_file(const char **file_names,
@@ -62,6 +65,12 @@
                                     const Tag* file_id_tag ) 
 {
   Error *merror = ((Core*)mbImpl)->get_error_handler();
+  
+  
+  int tmpval;
+  if (MB_SUCCESS == opts.get_int_option("DEBUG_PIO", 1, tmpval))
+    myDebug.set_verbosity(tmpval);
+  myDebug.tprint(1,"Setting up...\n");
 
     // Get parallel settings
   int parallel_mode;
@@ -169,6 +178,7 @@
   
   switch (parallel_mode) {
     case POPT_BCAST:
+        myDebug.print(1,"Read mode is BCAST\n");
         if (is_reader) {
           pa_vec.push_back(PA_READ);
           pa_vec.push_back(PA_CHECK_GIDS_SERIAL);
@@ -180,6 +190,7 @@
         break;
     
     case POPT_BCAST_DELETE:
+        myDebug.print(1,"Read mode is BCAST_DELETE\n");
         if (is_reader) {
           pa_vec.push_back(PA_READ);
           pa_vec.push_back(PA_CHECK_GIDS_SERIAL);
@@ -192,6 +203,7 @@


More information about the moab-dev mailing list