[Debian-astro-commits] [gyoto] 41/221: MPI: broadcast XML data instead of sequential send
Thibaut Jean-Claude Paumard
thibaut at moszumanska.debian.org
Fri May 22 20:52:32 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 bb16b57f3f3175c267fd2378a3ed78603d644bac
Author: Thibaut Paumard <paumard at users.sourceforge.net>
Date: Mon Oct 13 09:06:59 2014 +0200
MPI: broadcast XML data instead of sequential send
---
bin/gyoto-mpi-worker.C | 4 +++-
lib/Scenery.C | 4 ++--
2 files changed, 5 insertions(+), 3 deletions(-)
diff --git a/bin/gyoto-mpi-worker.C b/bin/gyoto-mpi-worker.C
index a61d3de..701d14d 100644
--- a/bin/gyoto-mpi-worker.C
+++ b/bin/gyoto-mpi-worker.C
@@ -42,6 +42,7 @@ static SmartPointer<Scenery> sc = NULL;
#ifdef HAVE_MPI
#include <boost/mpi/environment.hpp>
#include <boost/mpi/intercommunicator.hpp>
+#include <boost/mpi/collectives.hpp>
#include <string>
#include <boost/serialization/string.hpp>
namespace mpi = boost::mpi;
@@ -76,6 +77,7 @@ int main(int argc, char** argv) {
mpi::intercommunicator manager(parent_c,mpi::comm_take_ownership);
mpi::communicator world;
+ mpi::communicator team=manager.merge(true);
string pluglist= getenv("GYOTO_PLUGINS")?
getenv("GYOTO_PLUGINS"):
@@ -96,7 +98,7 @@ int main(int argc, char** argv) {
switch (task) {
case Scenery::read_scenery: {
std::string parfile;
- manager.recv(0, task, parfile);
+ broadcast(team, parfile, 0);
curmsg = "In gyoto-mpi-worker.C: Error in Factory creation: ";
curretval = 1;
sc = Factory(const_cast<char*>(parfile.c_str())).getScenery();
diff --git a/lib/Scenery.C b/lib/Scenery.C
index 482694e..2827320 100644
--- a/lib/Scenery.C
+++ b/lib/Scenery.C
@@ -32,6 +32,7 @@
#include <boost/mpi/environment.hpp>
#include <boost/mpi/communicator.hpp>
#include <boost/mpi/intercommunicator.hpp>
+#include <boost/mpi/collectives.hpp>
#include <string>
#include <boost/serialization/string.hpp>
namespace mpi = boost::mpi;
@@ -901,10 +902,9 @@ void Gyoto::Scenery::mpiClone()
Gyoto::Factory(this).format();
int errcode;
for (int i=0; i < mpi_workers_->remote_size(); ++i) {
- //mpi_workers_->recv(i, ready, errcode);
mpi_workers_->send(i, give_task, read_scenery);
- mpi_workers_->send(i, read_scenery, xmldata);
}
+ broadcast(mpi_workers_->merge(false), xmldata, 0);
}
--
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