summaryrefslogtreecommitdiff
path: root/gi/pyp-topics/src/mpi-train-contexts.cc
diff options
context:
space:
mode:
authorphilblunsom <philblunsom@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-20 16:18:41 +0000
committerphilblunsom <philblunsom@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-20 16:18:41 +0000
commitc7a05c1900eeb1553f5c8f753527cf6c9eb89701 (patch)
tree817296fc23c7fd392b6a28f2869742c9c9f5aa47 /gi/pyp-topics/src/mpi-train-contexts.cc
parent5571fbb90be0921738afeb382a6c1b5059228520 (diff)
Fixed bug in mpi output.
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@335 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'gi/pyp-topics/src/mpi-train-contexts.cc')
-rw-r--r--gi/pyp-topics/src/mpi-train-contexts.cc3
1 files changed, 2 insertions, 1 deletions
diff --git a/gi/pyp-topics/src/mpi-train-contexts.cc b/gi/pyp-topics/src/mpi-train-contexts.cc
index 6e1e78a5..4f966a65 100644
--- a/gi/pyp-topics/src/mpi-train-contexts.cc
+++ b/gi/pyp-topics/src/mpi-train-contexts.cc
@@ -30,7 +30,7 @@ int main(int argc, char **argv)
mpi::environment env(argc, argv);
mpi::communicator world;
int rank = world.rank();
- bool am_root = rank;
+ bool am_root = (rank==0);
if (am_root) cout << "Pitman Yor topic models: Copyright 2010 Phil Blunsom\n";
if (am_root) std::cout << "I am process " << world.rank() << " of " << world.size() << "." << std::endl;
if (am_root) cout << REVISION << '\n' <<endl;
@@ -154,6 +154,7 @@ int main(int argc, char **argv)
documents_out <<endl;
}
documents_out.close();
+ world.barrier();
if (am_root) {
ogzstream root_documents_out(vm["document-topics-out"].as<string>().c_str());