Skip to content

doc: array-map creation ordering and creation dependence for arrays - #3931

Open
lvkale wants to merge 1 commit into
mainfrom
doc-array-map-creation-dependence
Open

doc: array-map creation ordering and creation dependence for arrays#3931
lvkale wants to merge 1 commit into
mainfrom
doc-array-map-creation-dependence

Conversation

@lvkale

@lvkale lvkale commented Jul 24, 2026

Copy link
Copy Markdown
Contributor

The Initial Placement Using Map Objects section shows ckNew of a map group immediately followed by ckNew of the array that uses it, with no discussion of ordering. That idiom is safe only during program initialization (mainchare constructors), where creations are installed on every PE in creation order before the scheduler executes other messages. Created later in the run, the array creation races the map-group creation on remote PEs and aborts in the array constructor with "ERROR! Local branch of array map is NULL!". We hit this at 32 processes in a production application (paratreet2): the internal dependence chain in CkCreateArray covers the plain setMap case (locCache depends on the map), but an array created with both bindTo and a newly created map reuses the bound-to array's location manager, skips that chain, and is unprotected.

This PR documents:

  • the ordering rule (initialization-time creation is sequenced; post-initialization creation is not),
  • the supported fix: declare the map as a creation dependence of the array via CkEntryOptions::setGroupDepID on the array's ckNew, cross-referencing the existing group-on-group dependence documentation in Group Creation,
  • a correction: CkArrayMap derives from IrrGroup, not Group (the manual showed Group), with the consequence that map classes cannot contribute to reductions.

A possible code follow-up, not part of this PR: CkCreateArray could declare the map dependence itself on the bindTo path.

🤖 Generated with Claude Code

The Initial Placement section showed ckNew of a map group immediately
followed by ckNew of the array using it, with no ordering discussion.
That idiom is safe only during program initialization (mainchare
constructors), where creations are installed on every PE in creation
order before the scheduler runs other messages. Created later in the
run, the array creation races the map group creation on remote PEs and
aborts in the array constructor with 'Local branch of array map is
NULL!' (observed at 32 processes in a production application; the
internal dependence chain covers plain setMap but not bindTo combined
with a newly created map).

Documents the fix: declare the map as a creation dependence of the
array via CkEntryOptions::setGroupDepID, cross-referencing the existing
group-on-group dependence section. Also corrects the CkArrayMap base
class in the manual (IrrGroup, not Group) and notes the consequence
that map classes cannot contribute to reductions.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant