[Cluster] Improve message passing part.

This rewrites in part the message passing part, using in place gather, and collecting, rather than merging, the data of all threads.

neutral with a single thread per rank:
Score of new-2mpi-1t vs old-2mpi-1t: 789 - 787 - 2615  [0.500] 4191
Elo difference: 0.17 +/- 6.44

likely progress with multiple threads per rank:
Score of new-2mpi-36t vs old-2mpi-36t: 76 - 53 - 471  [0.519] 600
Elo difference: 13.32 +/- 12.85
This commit is contained in:
Joost VandeVondele
2019-01-02 11:16:24 +01:00
committed by Stéphane Nicolet
parent 7a32d26d5f
commit ac43bef5c5
4 changed files with 76 additions and 45 deletions
+4 -2
View File
@@ -42,8 +42,8 @@ struct MoveInfo {
#ifdef USE_MPI
using KeyedTTEntry = std::pair<Key, TTEntry>;
constexpr std::size_t TTSendBufferSize = 32;
template <std::size_t N> class TTSendBuffer : public std::array<KeyedTTEntry, N> {
constexpr std::size_t TTCacheSize = 32;
template <std::size_t N> class TTCache : public std::array<KeyedTTEntry, N> {
struct Compare {
inline bool operator()(const KeyedTTEntry& lhs, const KeyedTTEntry& rhs) {
@@ -74,6 +74,7 @@ int rank();
inline bool is_root() { return rank() == 0; }
void save(Thread* thread, TTEntry* tte, Key k, Value v, Bound b, Depth d, Move m, Value ev);
void pick_moves(MoveInfo& mi);
void ttRecvBuff_resize(size_t nThreads);
uint64_t nodes_searched();
uint64_t tb_hits();
void signals_init();
@@ -90,6 +91,7 @@ constexpr int rank() { return 0; }
constexpr bool is_root() { return true; }
inline void save(Thread*, TTEntry* tte, Key k, Value v, Bound b, Depth d, Move m, Value ev) { tte->save(k, v, b, d, m, ev); }
inline void pick_moves(MoveInfo&) { }
inline void ttRecvBuff_resize(size_t) { }
uint64_t nodes_searched();
uint64_t tb_hits();
inline void signals_init() { }