Skip to content

Conversation

@bradcray
Copy link
Member

@bradcray bradcray commented Jan 21, 2026

This PR removes the deprecated symbols related to distributions, layouts, and the dmap type. Specifically, it removes:

  • the dmap type
  • distributions that had previously been implemented as classes and been deprecated (e.g., Block was deprecated in favor of blockDist)
  • the deprecated LayoutCS module
  • a deprecated config const in BlockDist.chpl, disableAliasedBulkTransfer.

In more detail:

  • I simply removed all deprecated distributions (BlockCyclic, Block, Cyclic, DimensionalDist2D, Hashed, Private, Replicated, Stencil), associated comments, and the aforementioned config

  • Similarly, I removed the LayoutCS module and all references to it

  • The dmap type was still used to create the logical singleton defaultDist, as it still provides the value-based wrapping around the DefaultDist class. Ultimately, DefaultDist should be rewritten to be a record, but here I took the simpler and more minimal approach of renaming the dmap type to chpl_dmap, effectively making it an internal symbol. Beyond updating defaultDist's use of it, this also required updating Dyno to recognize the new name, as it is currently special-cased there.

  • I removed a pair of helper routines in ChapelArray.chpl that existed merely to keep the dmap type working while deprecated.

  • I removed tests in the test/deprecated directory related to these features

  • Interestingly, the removal of disableAliasedBulkTransfer caused BlockDist.chpl to go from being a non-dead module to a dead one; presumably, the presence of a config in a module prevents it from being dead-code eliminated since it represents a (potential) user-facing feature. This required updates to tests that were sensitive to module init/deinit order and counts of dead modules, such as:

    • test/modules/sungeun/init/printModuleInitOrder.chpl
    • test/modules/vass/deinit-order-modules.verbose.chpl
    • test/optimizations/deadCodeElimination/elliot/countDeadModules.chpl
  • In SparseBlockDist.getDefaultSparseDist(), I changed a case that relied on dmap into a halt() because I believe it was only used for (old, now removed) class-based distributions, so should no longer be hit in practice. In essence, the halt() serves as an always-on assertion.

  • I added a pair of records to wrap class-based distributions to DSIUtil.chpl, similar to how chpl_PrivatizedDistHelper did this for the Block, Cyclic, etc. classes when they were being converted into records. One is for wrapping a rectangular distribution, the other for associative (chpl__rectLayoutHelper and chpl__assocLayoutHelper, respectively). At present, these are only used by tests in the test system that created custom distribution classes, though if we had class-based layouts, they could be used there as well to convert to record-based implementations. That said, if writing a new record-based distribution today, it should simply be written as a record, which would obviate the need for wrapping a class. Put another way, this is just a trick to minimize the amount of code that needs to be rewritten; with more effort, the tests that create custom distributions could/should be rewritten to simply use a record type as well.

  • Tests with custom class-based distributions that required updates to use record-based distributions (and leverage the above helpers) included:

    • MyDist => myDist in test/arrays/dmapped-new-error-class.chpl
    • MyDist => myDist in test/distributions/bradc/wrongDomForDist/*.chpl
    • GlobalDistribution => globalDistribution in test/domains/vass/no-dom-field-error.chpl
    • AccumStencil => accumStencil in test/studies/comd/elegant/arrayOfStructs/util/*.chpl
  • I updated tests or code patterns that relied on new dmap(new DefaultDist()) to simply use defaultDist instead, such as in test/unstable/dmapped-sparse.chpl and test/users/engin/sparse_bulk/sparseBulkBoundsCheck.chpl

  • I also removed test/distributions/diten/domainMethodNewDist.chpl which seemed to serve no particular purpose in a dmap-less world

These utility records are designed to convert old layout classes into
records by wrapping them, similar to what 'chpl_PrivatizedDistHelper'
did for distribution classes.  One is designed for rectangular arrays,
the other for associative.

---
Signed-off-by: Brad Chamberlain <[email protected]>
---
Signed-off-by: Brad Chamberlain <[email protected]>
This mirrors what we've had for 'DefaultDist'.  Neither of these are
public symbols, but 'defaultDist' seems much more like the kind of
thing we'd expose to users than 'DefaultDist' (in that we're not
exposing class-based distributions anymore and there's no reason for
the default distribution to be other than a singleton).

---
Signed-off-by: Brad Chamberlain <[email protected]>
With this PR, BlockDist no longer contains a config const/var that was
keeping it alive, so it is now considered dead and removed.  This
causes it not to be initialized since it's removed, and to slightly
perturb the order of module init/deinit, requiring updates to
printModuleInitOrder, countDeadModules, and deinit-order-modules.

Interestingly, the comm-*.good files for the countDeadModules test
also differed by one though my edit here changes by 4.  I think this
suggests that these tests are no longer being run in our ofi/ugni
configurations, which seems likely to be given that we've dialed down
system-specific full-suite testing as resources have been retired or
changed.

---
Signed-off-by: Brad Chamberlain <[email protected]>
---
Signed-off-by: Brad Chamberlain <[email protected]>
…instead

In both cases, I used the pattern also used by most of our
distributions now in which the record has a forwarding field to a
record that handles the standard distribution interface forwarding to
an old class-based implementation.  In truth, there's no strong reason
to preserve the class, but this approach requires fewer code changes
and matches what we've done for other distributions.

---
Signed-off-by: Brad Chamberlain <[email protected]>
---
Signed-off-by: Brad Chamberlain <[email protected]>
---
Signed-off-by: Brad Chamberlain <[email protected]>
@bradcray bradcray marked this pull request as ready for review January 24, 2026 02:20
Copy link
Member

@jabraham17 jabraham17 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Just noting that I still see mentions of dmap in the docs

  • doc/rst/technotes/dsi.rst
  • doc/rst/language/spec/domain-maps.rst

And those should probably be updated as well

@@ -1 +1 @@
dmapped-new-error-class.chpl:14: error: dmapped initialization expression requires a value, not a type - did you mean to use '<domain> dmapped new dmap(new <DistName>(<args>))'?
dmapped-new-error-class.chpl:20: error: dmapped initialization expression requires a value, not a type - did you mean to use '<domain> dmapped new dmap(new <DistName>(<args>))'?
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This error message is now incorrect, there is no dmap a user can use

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Also a good catch! I'm going to remove this test (in addition to removing the compiler logic that printed new dmap(), as it was specific to a time when some, but not all, distributions were converted to classes.

While here, I also updated the error message to print the actual distribution type rather than <DistName> which seems like an obvious/simple improvement.

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.

2 participants