summaryrefslogtreecommitdiff
path: root/gi/pyp-topics
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
commit9380fb4819f3ed56cb7ad77a43728718039389cc (patch)
tree59685224b9390f1744b5de42f28aed15d0953f1c /gi/pyp-topics
parentc44bf3a2a6fadf665f6b5eaa339f7e309e7ed50e (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')
-rw-r--r--gi/pyp-topics/src/mpi-pyp-topics.cc1
-rw-r--r--gi/pyp-topics/src/mpi-pyp.hh2
-rw-r--r--gi/pyp-topics/src/mpi-train-contexts.cc3
3 files changed, 4 insertions, 2 deletions
diff --git a/gi/pyp-topics/src/mpi-pyp-topics.cc b/gi/pyp-topics/src/mpi-pyp-topics.cc
index 3a3c4d67..fa951156 100644
--- a/gi/pyp-topics/src/mpi-pyp-topics.cc
+++ b/gi/pyp-topics/src/mpi-pyp-topics.cc
@@ -9,7 +9,6 @@ void MPIPYPTopics::sample_corpus(const Corpus& corpus, int samples,
int freq_cutoff_interval,
int max_contexts_per_document) {
Timer timer;
- std::cout << m_am_root << std::endl;
int documents = corpus.num_documents();
m_mpi_start = 0;
diff --git a/gi/pyp-topics/src/mpi-pyp.hh b/gi/pyp-topics/src/mpi-pyp.hh
index 0328b387..c2341b9e 100644
--- a/gi/pyp-topics/src/mpi-pyp.hh
+++ b/gi/pyp-topics/src/mpi-pyp.hh
@@ -352,6 +352,8 @@ struct triple {
}
};
+BOOST_IS_BITWISE_SERIALIZABLE(MPIPYP<int>::dish_delta_type)
+BOOST_CLASS_TRACKING(MPIPYP<int>::dish_delta_type,track_never)
template <typename Dish, typename Hash>
void
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());