Remove dmap and deprecated distributions#28329
Remove dmap and deprecated distributions#28329bradcray wants to merge 24 commits intochapel-lang:mainfrom
dmap and deprecated distributions#28329Conversation
…sed dists --- Signed-off-by: Brad Chamberlain <bradcray@users.noreply.github.com>
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 <bradcray@users.noreply.github.com>
…rpose --- Signed-off-by: Brad Chamberlain <bradcray@users.noreply.github.com>
--- Signed-off-by: Brad Chamberlain <bradcray@users.noreply.github.com>
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 <bradcray@users.noreply.github.com>
…ove-deprecated-dists
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 <bradcray@users.noreply.github.com>
--- Signed-off-by: Brad Chamberlain <bradcray@users.noreply.github.com>
…ultDist --- Signed-off-by: Brad Chamberlain <bradcray@users.noreply.github.com>
…direct uses --- Signed-off-by: Brad Chamberlain <bradcray@users.noreply.github.com>
…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 <bradcray@users.noreply.github.com>
--- Signed-off-by: Brad Chamberlain <bradcray@users.noreply.github.com>
--- Signed-off-by: Brad Chamberlain <bradcray@users.noreply.github.com>
jabraham17
left a comment
There was a problem hiding this comment.
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>))'? | |||
There was a problem hiding this comment.
This error message is now incorrect, there is no dmap a user can use
There was a problem hiding this comment.
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.
…city Jade pointed out that I'd missed an instance of 'new dmap()' in this error message, which made me realize that the case checking for class-based dmaps need not exist any longer, permitting me to simplify the logic and remove a test that no longer matters. While poking at this error, I also realized that it could be improved by simply printing the name of the distribution being used, which we have handy in this case. --- Signed-off-by: Brad Chamberlain <bradcray@users.noreply.github.com>
…apped exprs Jade caught that there were index terms for the 'dmap' type still in the spec, so this commit removes them. While checking the rest of this file, I realized that some examples of 'dmapped' failed to use 'new' before 'blockDist()' (in code that is not currently being tested), so updated those cases to avoid the obvious error. --- Signed-off-by: Brad Chamberlain <bradcray@users.noreply.github.com>
Jade pointed out that there were remaining references to 'dmap' in this document, so this removes them. To do that required also describing the top-level distribution type as a record rather than a class, which also motivated making some updates to the expected API for the record. This leaves this technote strictly better than it was, but there's still a lot that could be done to improve it and bring it into better sync with current practice, I believe. --- Signed-off-by: Brad Chamberlain <bradcray@users.noreply.github.com>
--- Signed-off-by: Brad Chamberlain <bradcray@users.noreply.github.com>
This is relying on using "distribution" as a general term, which is questionable, but hopefully it's clear enough. --- Signed-off-by: Brad Chamberlain <bradcray@users.noreply.github.com>
This test has been notested for awhile, but had instances of 'new dmap()' that I felt I couldn't leave in good conscience, if for no other reason that to have zero matches when searching for 'new dmap()' calls. While here, I did a bit more to bring it more in-sync with current distribution logic, but not enough to get it compiling before deciding it wasn't currently worth my time. --- Signed-off-by: Brad Chamberlain <bradcray@users.noreply.github.com>
--- Signed-off-by: Brad Chamberlain <bradcray@users.noreply.github.com>
… more accurate --- Signed-off-by: Brad Chamberlain <bradcray@users.noreply.github.com>
--- Signed-off-by: Brad Chamberlain <bradcray@users.noreply.github.com>
--- Signed-off-by: Brad Chamberlain <bradcray@users.noreply.github.com>
--- Signed-off-by: Brad Chamberlain <bradcray@users.noreply.github.com>
|
@jabraham17 : Thanks for catching those cases I missed. I used your comments to look for other references to This isn't perfect since a line of code with dmap and dmapped on a single line could occur and slip past my checks, but it's much more complete than I'd been before. This resulted in me getting into a bunch of tests and comments that weren't particularly important, but I like that it left things in a cleaner condition w.r.t. |
| .. method:: proc GlobalDistribution.newRectangularDom(param rank: int, | ||
| type idxType, | ||
| param strides: strideKind, | ||
| ranges: rank*range(idxType, boundKind.both, strides), | ||
| definedConst: bool = false) |
There was a problem hiding this comment.
I don't know how well sphinx will render this, I don't think it can handle newlines in a .. method. Did you check it?
This PR removes the deprecated symbols related to distributions, layouts, and the
dmaptype. Specifically, it removes:dmaptypeBlockwas deprecated in favor ofblockDist)LayoutCSmoduleconfig constinBlockDist.chpl,disableAliasedBulkTransfer.It also updates tests and documentation to remove references to the
dmaptype even in places where it doesn't terribly matter.In more detail:
I simply removed all deprecated distributions (
BlockCyclic,Block,Cyclic,DimensionalDist2D,Hashed,Private,Replicated,Stencil), associated comments, and the aforementionedconfigSimilarly, I removed the
LayoutCSmodule and all references to itThe
dmaptype was still used to create the logical singletondefaultDist, as it still provides the value-based wrapping around theDefaultDistclass. Ultimately,DefaultDistshould be rewritten to be a record, but here I took the simpler and more minimal approach of renaming thedmaptype tochpl_dmap, effectively making it an internal symbol. Beyond updatingdefaultDist'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
dmaptype working while deprecated.I removed tests in the
test/deprecateddirectory related to these featuresInterestingly, the removal of
disableAliasedBulkTransfercausedBlockDist.chplto go from being a non-dead module to a dead one; presumably, the presence of aconfigin 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.chpltest/modules/vass/deinit-order-modules.verbose.chpltest/optimizations/deadCodeElimination/elliot/countDeadModules.chplIn
SparseBlockDist.getDefaultSparseDist(), I changed a case that relied ondmapinto ahalt()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 howchpl_PrivatizedDistHelperdid this for theBlock,Cyclic, etc. classes when they were being converted into records. One is for wrapping a rectangular distribution, the other for associative (chpl__rectLayoutHelperandchpl__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=>myDistintest/arrays/dmapped-new-error-class.chplMyDist=>myDistintest/distributions/bradc/wrongDomForDist/*.chplGlobalDistribution=>globalDistributionintest/domains/vass/no-dom-field-error.chplAccumStencil=>accumStencilintest/studies/comd/elegant/arrayOfStructs/util/*.chplI updated tests or code patterns that relied on
new dmap(new DefaultDist())to simply usedefaultDistinstead, such as intest/unstable/dmapped-sparse.chplandtest/users/engin/sparse_bulk/sparseBulkBoundsCheck.chplI simplified an error message in
normalize.cppthat referred tonew dmap()to avoid it and to avoid worrying about class-based distributions, which shouldn't exist anymore while also improving the error message to name the distribution type that was used rather than relying on a placeholder. I similarly removedtest/arrays/dmapped-new-error-class.chplwhich served only to lock in the version of the error message for class-based distributions.I also removed
test/distributions/diten/domainMethodNewDist.chplwhich seemed to serve no particular purpose in a dmap-less worldI removed index entries in the spec related to the
dmaptype and updated some examples ofdmapped blockDist()to readdmapped new blockDist()as well, which is now requiredI removed obvious references to the
dmaptype fromdoc/rst/technotes/dsi.rstand made some simple edits to the document to reflect the current record-based assumption about distribution type, but it's almost certain that more about this docuement should be refreshed or cleaned up w.r.t. record-based distributions.I also updated a bunch of tests that weren't running or weren't consequential or that mentioned
dmapin their comments to avoid the term, primarily for the sake of reducing false positives when looking for ongoing references todmap