diff options
author | philblunsom <philblunsom@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-19 21:07:39 +0000 |
---|---|---|
committer | philblunsom <philblunsom@ec762483-ff6d-05da-a07a-a48fb63a330f> | 2010-07-19 21:07:39 +0000 |
commit | 648c350aa8b90bd60ca1448bd3bb702004b9ad26 (patch) | |
tree | 2ece648e57f109eaa18e3fbee86bd38a67aa79a1 /gi/pyp-topics/src/mpi-pyp-topics.cc | |
parent | 1fcc72f3f9119ae6e765bf77181d1809776d7525 (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.cc | 13 |
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) { |