Define and document semantics of dynamic Insertion in Chare arrays wrt broadcasts and reductions
Define the semantics of dynamic insertion, make modifications in Charm to adhere to those semantics, and document it.
#1 Updated by Phil Miller about 6 years ago
- Assignee set to Laxmikant "Sanjay" Kale
So, the meeting on this happened, and it seemed that the consensus settled on "application developers are responsible for ensuring that reductions and dynamic insertion do not overlap". I suggest that this restriction should be documented in the manual section regarding dynamic array element insertion, and referenced in the section on array reductions.
Sanjay, please re-assign this to someone to write.
#4 Updated by Phil Miller almost 6 years ago
- Target version deleted (
As discussed in core group, the general semantics should be "don't overlap reductions with insertion", along with an option to specify some sort of token to match an insertion to a specific reduction in which it should participate.
#8 Updated by Phil Miller about 3 years ago
I recently wrote some code for my thesis project that relies on the undocumented semantics of our implementation for reductions. I have a single chare array in which one set of elements are dynamically inserting a later set of elements. I need all of the elements to be on the same page in terms of reductions. Here's what I did:
- all of the pre-existing elements call
contribute()before making an insertion call
contribute()call ensures that all of the inserted elements see and are stamped with the same reduction in progress
- neither the old nor new elements can safely contribute to a later reduction until we are certain that all of the insertion calls have been made (but not necessarily that the objects have actually been constructed)
- the early reduction is completed solely from the contributions of the old elements, because all new elements are stamped one past it
- that reduction targets a broadcast to the array telling everyone that it's now safe to go on.
#11 Updated by Laxmikant "Sanjay" Kale 10 months ago
I think implicit in Phil's comments is the requirement/assumption that the new elements must be inserted by other existing elements of the same chare array. (what about the case of an existing element creating a second one, which creates a 3rd one? I don't think thats permissible within the same epoch.. i.e. the second and 3rd element cannot be part of the same epoch of reduction numbers. All the new elements must be created by elements the exist before the reduction is .. called.. [need more precise definition: ].
The task now is to document this and check in a program that shows its use (and tests it regularly).