[Debian-astro-commits] [gyoto] 39/221: gyoto executable supports --nprocesses option; fill PolishDoughnut::fillElement
Thibaut Jean-Claude Paumard
thibaut at moszumanska.debian.org
Fri May 22 20:52:31 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 92b56464dfba00e5c025d752a9f18c65db5e928c
Author: Thibaut Paumard <paumard at users.sourceforge.net>
Date: Sun Oct 12 16:27:08 2014 +0200
gyoto executable supports --nprocesses option; fill PolishDoughnut::fillElement
---
bin/gyoto.C | 20 ++++++++++++++++++++
lib/PolishDoughnut.C | 11 ++++++++++-
lib/Scenery.C | 11 +++++++++--
3 files changed, 39 insertions(+), 3 deletions(-)
diff --git a/bin/gyoto.C b/bin/gyoto.C
index 07e8742..d7a18db 100644
--- a/bin/gyoto.C
+++ b/bin/gyoto.C
@@ -98,6 +98,11 @@ int main(int argc, char** argv) {
long ipctdims[3]={0, 0, 0};
double ipcttime;
+#ifdef HAVE_MPI
+ bool xnprocs=0;
+ int nprocs=0;
+#endif
+
string pluglist= getenv("GYOTO_PLUGINS")?
getenv("GYOTO_PLUGINS"):
GYOTO_DEFAULT_PLUGINS;
@@ -180,6 +185,11 @@ int main(int argc, char** argv) {
} else if (param.substr(0,11)=="--nthreads=") {
nthreads=atoi(param.substr(11).c_str());
xnthreads=1;
+#ifdef HAVE_MPI
+ } else if (param.substr(0,13)=="--nprocesses=") {
+ nprocs=atoi(param.substr(13).c_str());
+ xnprocs=1;
+#endif
}
else {
usage();
@@ -246,6 +256,12 @@ int main(int argc, char** argv) {
if (xpaln) screen -> PALN ( paln );
if (xarg) screen -> argument ( arg );
if (xnthreads) scenery -> nThreads ( nthreads );
+#ifdef HAVE_MPI
+ if (xnprocs) {
+ scenery -> mpiSpawn(nprocs);
+ scenery -> mpiClone();
+ }
+#endif
if (ipctfile != "") {
// if (verbose() >= GYOTO_QUIET_VERBOSITY)
@@ -470,6 +486,10 @@ int main(int argc, char** argv) {
delete [] impactcoords;
}
+#ifdef HAVE_MPI
+ if (xnprocs) scenery -> mpiTerminate();
+#endif
+
if (debug()) cerr << "DEBUG: gyoto.C: scenery==NULL" << endl;
scenery = NULL;
diff --git a/lib/PolishDoughnut.C b/lib/PolishDoughnut.C
index 84d58c8..76048d2 100644
--- a/lib/PolishDoughnut.C
+++ b/lib/PolishDoughnut.C
@@ -1656,7 +1656,16 @@ void PolishDoughnut::fillElement(FactoryMessenger *fmp) const {
fmp->setParameter("CentralTempOverVirial", centraltemp_over_virial_);
fmp->setParameter("Beta", beta_);
fmp->setParameter("SpectralOversampling", spectral_oversampling_);
- fmp->setParameter("Komissarov", komissarov_);
+ if (komissarov_) fmp->setParameter("Komissarov");
+ if (angle_averaged_) fmp->setParameter("KomissarovAngleAveraged");
+ if (nonthermal_){
+ double param[2]={deltaPL_, expoPL_};
+ fmp->setParameter("NonThermalDeltaExpo", param, 2);
+ }
+ if (adaf_){
+ double param[2]={ADAFtemperature_, ADAFdensity_};
+ fmp->setParameter("ADAF", param, 2);
+ }
Standard::fillElement(fmp);
}
#endif
diff --git a/lib/Scenery.C b/lib/Scenery.C
index 994ff52..482694e 100644
--- a/lib/Scenery.C
+++ b/lib/Scenery.C
@@ -883,9 +883,16 @@ void Gyoto::Scenery::mpiTerminate(bool keep_env) {
mpi_workers_->send(i, give_task, terminate);
}
delete mpi_workers_;
+ mpi_workers_=NULL;
+ }
+ if (mpi_world_ && !keep_env) {
+ delete mpi_world_;
+ mpi_world_=NULL;
+ }
+ if (mpi_env_ && !keep_env) {
+ delete mpi_env_;
+ mpi_env_=NULL;
}
- if (mpi_world_ && !keep_env) delete mpi_world_;
- if (mpi_env_ && !keep_env) delete mpi_env_;
}
void Gyoto::Scenery::mpiClone()
--
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