[Debian-astro-commits] [gyoto] 71/221: Scenery::mpiSpawn(): issue warnings when MPI is not available/not initialized/finalized

Thibaut Jean-Claude Paumard thibaut at moszumanska.debian.org
Fri May 22 20:52:34 UTC 2015


This is an automated email from the git hooks/post-receive script.

thibaut pushed a commit to branch master
in repository gyoto.

commit 9dbb7c5c9d97ef3918dbb6b565ca0ef33ceb615d
Author: Thibaut Paumard <paumard at users.sourceforge.net>
Date:   Wed Oct 22 16:06:39 2014 +0200

    Scenery::mpiSpawn(): issue warnings when MPI is not available/not initialized/finalized
---
 lib/Scenery.C | 18 ++++++++++++------
 1 file changed, 12 insertions(+), 6 deletions(-)

diff --git a/lib/Scenery.C b/lib/Scenery.C
index 3ff630f..b7d6cb9 100644
--- a/lib/Scenery.C
+++ b/lib/Scenery.C
@@ -891,16 +891,21 @@ void Gyoto::Scenery::mpiSpawn(int nbchildren) {
 #ifdef HAVE_MPI
   int flagi=0, flagt=0;
   if (MPI_Initialized(&flagi)) throwError("Error running MPI_Initialized()");
+  if (!flagi) {
+    GYOTO_WARNING << "MPI_Init not called yet: "
+		  << "not spawning processes" << endl;
+    return;
+  }
   if (MPI_Finalized(&flagt)) throwError("Error running MPI_Finalized()");
-  if (!flagi || flagt) return;
+  if (flagt) {
+    GYOTO_WARNING << "MPI_Finalize already called: "
+		  << "not spawning processes" << endl;
+    return;
+  }
   if (mpi_team_) {
     if (mpi_team_->size()==nbchildren+1) return;
     mpiTerminate();
   }
-
-
-
-
   if (nbchildren) {
     char * exec = const_cast<char*>("gyoto-mpi-worker." GYOTO_SOVERS); 
 
@@ -912,7 +917,8 @@ void Gyoto::Scenery::mpiSpawn(int nbchildren) {
 
     mpi_team_ = new mpi::communicator(mpi::intercommunicator (children_c, mpi::comm_take_ownership).merge(false));
   }
-
+#else
+  GYOTO_WARNING << "No MPI in this Gyoto" << endl;
 #endif 
 }
 

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/debian-astro/packages/gyoto.git



More information about the Debian-astro-commits mailing list