[MOAB-dev] r1953 - in MOAB/trunk: parallel tools/mbcoupler

tautges at mcs.anl.gov tautges at mcs.anl.gov
Sun Jun 29 13:53:55 CDT 2008


Author: tautges
Date: 2008-06-29 13:53:55 -0500 (Sun, 29 Jun 2008)
New Revision: 1953

Modified:
   MOAB/trunk/parallel/ReadParallel.cpp
   MOAB/trunk/tools/mbcoupler/mbcoupler_test.cpp
Log:
Updating some debug output.


Modified: MOAB/trunk/parallel/ReadParallel.cpp
===================================================================
--- MOAB/trunk/parallel/ReadParallel.cpp	2008-06-29 16:19:07 UTC (rev 1952)
+++ MOAB/trunk/parallel/ReadParallel.cpp	2008-06-29 18:53:55 UTC (rev 1953)
@@ -531,7 +531,7 @@
   result = mbImpl->get_entities_by_handle(file_set, file_ents); 
   RR("Couldn't get pre-existing entities.");
 
-  if (myPcomm->proc_config().proc_rank() == 0) {
+  if (debug && myPcomm->proc_config().proc_rank() == 0) {
     std::cout << "File entities: " << std::endl;
     file_ents.print("ff  ");
   }
@@ -552,13 +552,15 @@
     RR("Failure removing deletable entities.");
   }
 
-  if (debug) std::cout << "Deleting deletable entities." << std::endl;
+  if (debug) {
+    std::cout << "Deleting deletable entities." << std::endl;
 
-  if (myPcomm->proc_config().proc_rank() == 0) {
-    std::cout << "Deletable sets: " << std::endl;
-    deletable_sets.print("ff  ");
+    if (myPcomm->proc_config().proc_rank() == 0) {
+      std::cout << "Deletable sets: " << std::endl;
+      deletable_sets.print("ff  ");
+    }
   }
-
+  
     // delete sets, then ents
   if (!deletable_sets.empty())
     result = mbImpl->delete_entities(deletable_sets);
@@ -566,7 +568,7 @@
 
   deletable_ents = deletable_ents.subtract(deletable_sets);
 
-  if (myPcomm->proc_config().proc_rank() == 0) {
+  if (debug && myPcomm->proc_config().proc_rank() == 0) {
     std::cout << "Deletable entities: " << std::endl;
     deletable_ents.print("ff  ");
   }

Modified: MOAB/trunk/tools/mbcoupler/mbcoupler_test.cpp
===================================================================
--- MOAB/trunk/tools/mbcoupler/mbcoupler_test.cpp	2008-06-29 16:19:07 UTC (rev 1952)
+++ MOAB/trunk/tools/mbcoupler/mbcoupler_test.cpp	2008-06-29 18:53:55 UTC (rev 1953)
@@ -9,6 +9,8 @@
 #include <sstream>
 #include <assert.h>
 
+bool debug = false;
+
 #define RRA(a) if (MB_SUCCESS != result) {\
       std::string tmp_str; mbImpl->get_last_error(tmp_str);\
       tmp_str.append("\n"); tmp_str.append(a);\
@@ -20,6 +22,7 @@
       std::string tmp_str;\
       std::cout << "Failure; message:" << std::endl;\
       std::cout << mbImpl->get_last_error(tmp_str) << std::endl;\
+      MPI_Finalize();                                     \
       return result;\
     }
 
@@ -29,7 +32,8 @@
                              std::string &opts);
 
 MBErrorCode report_iface_ents(MBInterface *mbImpl,
-                              std::vector<MBParallelComm *> &pcs);
+                              std::vector<MBParallelComm *> &pcs,
+                              bool print_results);
 
 MBErrorCode test_interpolation(MBInterface *mbImpl, 
                                std::string &interp_tag,
@@ -93,7 +97,7 @@
     PRINT_LAST_ERROR;
   }
 
-  result = report_iface_ents(mbImpl, pcs);
+  result = report_iface_ents(mbImpl, pcs, debug);
   PRINT_LAST_ERROR;
 
   if (!interp_tag.empty()) {
@@ -136,7 +140,8 @@
 }
 
 MBErrorCode report_iface_ents(MBInterface *mbImpl,
-                              std::vector<MBParallelComm *> &pcs) 
+                              std::vector<MBParallelComm *> &pcs,
+                              const bool print_results) 
 {
   MBRange iface_ents[6];
   MBErrorCode result = MB_SUCCESS, tmp_result;
@@ -165,14 +170,16 @@
 
   int rank;
   MPI_Comm_rank(MPI_COMM_WORLD, &rank);
+
+  if (print_results || iface_ents[0].size() != iface_ents[5].size()) {
+    std::cerr << "Proc " << rank << " iface entities: " << std::endl;
+    for (int i = 0; i < 4; i++)
+      std::cerr << "    " << iface_ents[i].size() << " "
+                << i << "d iface entities." << std::endl;
+    std::cerr << "    (" << iface_ents[5].size() 
+              << " verts adj to other iface ents)" << std::endl;
+  }
   
-  std::cerr << "Proc " << rank << " iface entities: " << std::endl;
-  for (int i = 0; i < 4; i++)
-    std::cerr << "    " << iface_ents[i].size() << " "
-              << i << "d iface entities." << std::endl;
-  std::cerr << "    (" << iface_ents[5].size() 
-            << " verts adj to other iface ents)" << std::endl;
-
   return result;
 }
 




More information about the moab-dev mailing list