[MOAB-dev] r4630 - MOAB/trunk/tools/mbcoupler

acaceres at mcs.anl.gov acaceres at mcs.anl.gov
Mon Mar 21 16:50:53 CDT 2011


Author: acaceres
Date: 2011-03-21 16:50:53 -0500 (Mon, 21 Mar 2011)
New Revision: 4630

Modified:
   MOAB/trunk/tools/mbcoupler/mbcoupler_test.cpp
Log:
only print out times on root node
do mpi_abort instead of mpi_finalize


Modified: MOAB/trunk/tools/mbcoupler/mbcoupler_test.cpp
===================================================================
--- MOAB/trunk/tools/mbcoupler/mbcoupler_test.cpp	2011-03-21 21:38:56 UTC (rev 4629)
+++ MOAB/trunk/tools/mbcoupler/mbcoupler_test.cpp	2011-03-21 21:50:53 UTC (rev 4630)
@@ -29,7 +29,7 @@
       std::cout << "Failure; message:" << std::endl;\
       mbImpl->get_last_error(tmp_str);\
       std::cout << tmp_str << std::endl;\
-      MPI_Finalize();                                     \
+      MPI_Abort(MPI_COMM_WORLD, result);        \
       return result;\
     }
 
@@ -39,7 +39,7 @@
       std::cout << "Failure; message:" << std::endl;\
       mbImpl->get_last_error(tmp_str);\
       std::cout << tmp_str << std::endl;\
-      MPI_Finalize();                                     \
+      MPI_Abort(MPI_COMM_WORLD, result);        \
       return result;\
     }
 
@@ -82,6 +82,16 @@
                              double &gnorm_time,
                              double &ssnorm_time);
 
+void reduceMax(double &v){
+  double buf;
+
+  MPI_Barrier(MPI_COMM_WORLD);
+  MPI_Allreduce( &v, &buf, 1, MPI_DOUBLE, MPI_MAX, MPI_COMM_WORLD);
+
+  v=buf;
+}
+
+
 int main(int argc, char **argv) 
 {
     // need to init MPI first, to tell how many procs and rank
@@ -151,15 +161,16 @@
                               instant_time, pointloc_time, interp_time, 
                               gnorm_time, ssnorm_time);
   PRINT_LAST_ERROR;
-  std::cout << "Coupler times:" << std::endl;
-  std::cout << "    instantiation | point location | interpolation | global norm time | subset norm time" << std::endl;
-  std::cout << "    " 
-            << std::setw(13) << instant_time << "   "
-            << std::setw(14) << pointloc_time << "   "
-            << std::setw(13) << interp_time << "   "
-            << std::setw(16) << gnorm_time << "   "
-            << std::setw(16) << ssnorm_time << std::endl;


More information about the moab-dev mailing list