summaryrefslogtreecommitdiff
path: root/gi/pyp-topics/src/mpi-pyp-topics.cc
diff options
context:
space:
mode:
authorphilblunsom <philblunsom@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-19 21:07:39 +0000
committerphilblunsom <philblunsom@ec762483-ff6d-05da-a07a-a48fb63a330f>2010-07-19 21:07:39 +0000
commit96869a482482a4ef0ee8b101ab32cc10219cc3d4 (patch)
treea9fdd54ef09b9fb9d994e5cfbfb9b4a3a2df5e25 /gi/pyp-topics/src/mpi-pyp-topics.cc
parent22a26081d638154a0945ce6e948395148265ad4e (diff)
MPI stuff: hierarchical topics should work.
git-svn-id: https://ws10smt.googlecode.com/svn/trunk@321 ec762483-ff6d-05da-a07a-a48fb63a330f
Diffstat (limited to 'gi/pyp-topics/src/mpi-pyp-topics.cc')
-rw-r--r--gi/pyp-topics/src/mpi-pyp-topics.cc13
1 files changed, 13 insertions, 0 deletions
diff --git a/gi/pyp-topics/src/mpi-pyp-topics.cc b/gi/pyp-topics/src/mpi-pyp-topics.cc
index 50db61c1..3a3c4d67 100644
--- a/gi/pyp-topics/src/mpi-pyp-topics.cc
+++ b/gi/pyp-topics/src/mpi-pyp-topics.cc
@@ -264,6 +264,19 @@ void MPIPYPTopics::synchronise() {
//if (m_am_root) boost::mpi::communicator().barrier();
}
// }
+ // Synchronise the hierarchical topic pyp
+ MPIPYP<int>::dish_delta_type topic_delta;
+ m_topic_pyp.synchronise(&topic_delta);
+ for (MPIPYP<int>::dish_delta_type::const_iterator it=topic_delta.begin(); it != topic_delta.end(); ++it) {
+ int count = it->second;
+ if (count > 0)
+ for (int i=0; i < count; ++i)
+ m_topic_pyp.increment(it->first, m_topic_p0, rnd);
+ if (count < 0)
+ for (int i=0; i > count; --i)
+ m_topic_pyp.decrement(it->first, rnd);
+ }
+ m_topic_pyp.reset_deltas();
}
void MPIPYPTopics::decrement(const Term& term, int topic, int level) {