[Debian-astro-commits] [gyoto] 52/221: also check that mpi was not terminated when chacking that is has been initialized
Thibaut Jean-Claude Paumard
thibaut at moszumanska.debian.org
Fri May 22 20:52:33 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 feee6118168ba2ac1a4c8766dd30745909247c02
Author: Thibaut Paumard <paumard at users.sourceforge.net>
Date: Wed Oct 15 13:50:04 2014 +0200
also check that mpi was not terminated when chacking that is has been initialized
---
lib/Scenery.C | 12 +++++-------
1 file changed, 5 insertions(+), 7 deletions(-)
diff --git a/lib/Scenery.C b/lib/Scenery.C
index 110bf47..3fba783 100644
--- a/lib/Scenery.C
+++ b/lib/Scenery.C
@@ -867,14 +867,12 @@ SmartPointer<Scenery> Gyoto::Scenery::Subcontractor(FactoryMessenger* fmp) {
bool Gyoto::Scenery::am_worker=false;
void Gyoto::Scenery::mpiSpawn(int nbchildren) {
-#ifdef HAVE_MPI
- int flag;
- if (MPI_Initialized(&flag)) throwError("Error running MPI_Initialized()");
- if (!flag) {
- nprocesses_=0;
- return;
- }
nprocesses_=nbchildren;
+#ifdef HAVE_MPI
+ int flagi=0, flagt=0;
+ if (MPI_Initialized(&flagi)) throwError("Error running MPI_Initialized()");
+ if (MPI_Finalized(&flagt)) throwError("Error running MPI_Finalized()");
+ if (!flagi || flagt) return;
if (mpi_team_) {
if (mpi_team_->size()==nbchildren+1) return;
mpiTerminate();
--
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