Repository navigation
Closed
Labels
ChapelNeeds attention from a member of the Chapel teambugSomething isn't workingimportanthigh priorityperformancePerformance needs improving
Description
Describe the bug
makeDistArray has overloads which accepts a domain, and do not check if the domain is distributed. Therefore the array we get from makeDistArray can be non-distributed. Which can lead to surprising behavior and bad performance.
See
Lines 94 to 119 in 0a7850b
| proc makeDistArray(D: domain(?), type etype) throws | |
| where D.rank == 1 | |
| { | |
| var res = D.tryCreateArray(etype); | |
| return res; | |
| } | |
| proc makeDistArray(D: domain(?), type etype) throws | |
| where D.rank > 1 | |
| { | |
| var res: [D] etype; | |
| return res; | |
| } | |
| proc makeDistArray(D: domain(?), initExpr: ?t) throws | |
| where D.rank == 1 | |
| { | |
| return D.tryCreateArray(t, initExpr); | |
| } | |
| proc makeDistArray(D: domain(?), initExpr: ?t) throws | |
| where D.rank > 1 | |
| { | |
| var res: [D] t = initExpr; | |
| return res; | |
| } |
makeDistArray.
Proposed Solution
My recommendation here is that we should modify these overloads to check if D is distributed and if it isn't, call makeDistDom to get a distributed domain instead.
Is this a Blocking Issue
- Are there any known work-arounds? No
Metadata
Metadata
Assignees
Labels
ChapelNeeds attention from a member of the Chapel teambugSomething isn't workingimportanthigh priorityperformancePerformance needs improving
Activity
ShreyasKhandekar commentedon Apr 10, 2025
This was exposed when working on #4230, where we pass a non distributed domain to
makeDistArraywhich was leading to bad performance.