Factor out massive duplication in reductions
The code that implements reductions is duplicated to varying extents across groups, nodegroups, and arrays. Refactor it to a single common instance.
#10 Updated by Phil Miller over 3 years ago
Replicas of the reduction infrastructure in Charm++:
- src/ck-core/ckreduction.C (x2: CkReductionMgr, CkNodeReductionMgr; also some useful documentation at the top of this file)
Each of those 4 copies carries variation in the implementation based on their particular context. They still share a lot of common bits, though.
Ideally, we would come away with a standalone component that gets passed a stream of reduction contribution messages from various contributors and iterations, and spits out its own contributions as it sees each reduction locally complete. Since this involves no communication, it could be tested in isolation. Each of those four cases above would either carry an instance of this class configured for their need, or derive their own specialization of it with virtual methods called from the common base class code implementing the points of differentiation.