From 0cdb44f9fdcc1865487f332dce42933416641c1f Mon Sep 17 00:00:00 2001 From: Brad Chamberlain Date: Tue, 12 Sep 2023 16:19:11 -0700 Subject: [PATCH 1/4] Rename 'Replicated' record to 'replicatedDist' and add deprecation --- Signed-off-by: Brad Chamberlain --- modules/dists/ReplicatedDist.chpl | 21 +++++++++++++-------- 1 file changed, 13 insertions(+), 8 deletions(-) diff --git a/modules/dists/ReplicatedDist.chpl b/modules/dists/ReplicatedDist.chpl index b2d2b55bc4fe..f7ee02590039 100644 --- a/modules/dists/ReplicatedDist.chpl +++ b/modules/dists/ReplicatedDist.chpl @@ -97,7 +97,7 @@ The ``Replicated`` class initializer is defined as follows: .. code-block:: chapel - proc Replicated.init( + proc replicatedDist.init( targetLocales: [] locale = Locales, purposeMessage: string = "used to create a Replicated") @@ -113,7 +113,7 @@ when the initializer encounters an error. pragma "ignore noinit" -record Replicated { +record replicatedDist { forwarding const chpl_distHelp: chpl_PrivatizedDistHelper(unmanaged ReplicatedImpl); proc init(targetLocales: [] locale = Locales, @@ -144,23 +144,23 @@ record Replicated { // Note: This does not handle the case where the desired type of 'this' // does not match the type of 'other'. That case is handled by the compiler // via coercions. - proc init=(const ref other : Replicated) { + proc init=(const ref other : replicatedDist) { this.init(other._value.dsiClone()); } proc clone() { - return new Replicated(this._value.dsiClone()); + return new replicatedDist(this._value.dsiClone()); } @chpldoc.nodoc - inline operator ==(d1: Replicated(?), d2: Replicated(?)) { + inline operator ==(d1: replicatedDist(?), d2: replicatedDist(?)) { if (d1._value == d2._value) then return true; return d1._value.dsiEqualDMaps(d2._value); } @chpldoc.nodoc - inline operator !=(d1: Replicated(?), d2: Replicated(?)) { + inline operator !=(d1: replicatedDist(?), d2: replicatedDist(?)) { return !(d1 == d2); } @@ -170,6 +170,11 @@ record Replicated { } +@deprecated("'Replicated' is deprecated, please use 'replicatedDist' instead") +type Replicated = replicatedDist; + + + @chpldoc.nodoc class ReplicatedImpl : BaseDist { var targetLocDom : domain(here.id.type); @@ -433,9 +438,9 @@ iter ReplicatedDom.these(param tag: iterKind, followThis) where tag == iterKind. proc ReplicatedDom.dsiGetDist() { if _isPrivatized(dist) then - return new Replicated(dist.pid, dist, _unowned=true); + return new replicatedDist(dist.pid, dist, _unowned=true); else - return new Replicated(nullPid, dist, _unowned=true); + return new replicatedDist(nullPid, dist, _unowned=true); } override proc ReplicatedDom.dsiDestroyDom() { From bf0febf078b3de24222f1de087fa65f3a1f0a469 Mon Sep 17 00:00:00 2001 From: Brad Chamberlain Date: Tue, 12 Sep 2023 16:19:37 -0700 Subject: [PATCH 2/4] Update package modules to use replicatedDist --- Signed-off-by: Brad Chamberlain --- modules/packages/ReplicatedVar.chpl | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/modules/packages/ReplicatedVar.chpl b/modules/packages/ReplicatedVar.chpl index fa1c682ec567..66ed5a006dfa 100644 --- a/modules/packages/ReplicatedVar.chpl +++ b/modules/packages/ReplicatedVar.chpl @@ -43,7 +43,7 @@ Limitations: .. code-block:: chapel - var replArray: [MyDomain dmapped Replicated()] real; + var replArray: [MyDomain dmapped replicatedDist()] real; .. _ReplicatedVar_basic-usage: @@ -84,7 +84,7 @@ modify the above variable declarations as follows: .. code-block:: chapel - var myRepVar: [rcDomainBase dmapped Replicated(myLocales, + var myRepVar: [rcDomainBase dmapped replicatedDist(myLocales, "over which to replicate 'myRepVar'")] MyType; var collected: [myLocales.domain] MyType; @@ -106,11 +106,11 @@ private const rcDomainIx = 1; // todo convert to param as shown :ref:`above `. */ const rcDomainBase = {rcDomainIx..rcDomainIx}; private const rcLocales = Locales; -private const rcDomainMap = new Replicated(rcLocales); +private const rcDomainMap = new replicatedDist(rcLocales); /* Use this domain to declare a user-level replicated variable, as shown :ref:`above ` . */ const rcDomain = rcDomainBase dmapped rcDomainMap; -private param _rcErr1 = " must be 'rcDomain' or 'rcDomainBase dmapped Replicated(an array of locales)'"; +private param _rcErr1 = " must be 'rcDomain' or 'rcDomainBase dmapped replicatedDist(an array of locales)'"; private proc _rcTargetLocalesHelper(replicatedVar: [?D]) where isReplicatedArr(replicatedVar) @@ -236,7 +236,7 @@ proc rcExampleOverLocales(initVal: ?MyType, newVal: MyType, newLocale: locale, // declare a replicated variable // DIFFERENT from rcExample(): the domain in myRepVar's type - var myRepVar: [rcDomainBase dmapped Replicated(localesToReplicateOver, + var myRepVar: [rcDomainBase dmapped replicatedDist(localesToReplicateOver, "over which to replicate 'myRepVar' in rcExampleOverLocales()")] MyType; // initialize all copies to 'initVal' From da51083ade3f4eaafad6307afb02214bd2b51859 Mon Sep 17 00:00:00 2001 From: Brad Chamberlain Date: Tue, 12 Sep 2023 16:23:05 -0700 Subject: [PATCH 3/4] Update tests to use replicatedDist --- Signed-off-by: Brad Chamberlain --- .../array-init-replicated.chpl | 2 +- .../array-initialization-patterns-dists.chpl | 4 ++-- .../post-alloc-dists.chpl | 2 +- test/deprecated/dmapType.good | 5 ++++- test/distributions/bradc/ReplWithMultiDim.chpl | 2 +- test/distributions/bradc/distEquality.chpl | 6 +++--- test/distributions/bradc/passDistDomsToFns.chpl | 2 +- test/distributions/dm/hplx.chpl | 2 +- .../replicated/ReplicatedMemLeak.chpl | 2 +- .../replicated/ReplicatedNonCopyable.chpl | 2 +- .../consistentLocales/testLocaleScramble.chpl | 2 +- .../consistentLocales/testLocaleScramble2.chpl | 2 +- .../consistentLocales/testLocaleScramble2D.chpl | 2 +- .../replicated/initStridedWithDense.chpl | 2 +- .../replicated/remoteOwnership.chpl | 6 +++--- .../distributions/replicated/repl-int-error.chpl | 2 +- .../distributions/replicated/scanReplicated.chpl | 2 +- .../distributions/replicated/testReplWrites.chpl | 2 +- test/distributions/replicated/testReplicand.chpl | 2 +- test/distributions/replicated/testUserAPI.chpl | 2 +- test/distributions/robust/arithmetic/driver.chpl | 10 +++++----- .../resizing/resizeFromOtherLocale.chpl | 2 +- test/distributions/vass/testReplicatedDist1.chpl | 2 +- .../vass/testReplicatedDistLocal1.chpl | 2 +- test/distributions/vass/testReplicatedVar1.chpl | 2 +- test/domains/bradc/stringCast.chpl | 2 +- .../perf/benchmarkDistributedIters.chpl | 4 ++-- test/memory/sungeun/refCount/domainMaps.chpl | 2 +- .../forall/reduce-intents/ri-4-arrdom.chpl | 2 +- test/release/examples/primers/replicated.chpl | 16 ++++++++-------- test/sparse/slices/sparseSliceDenseBlock.chpl | 2 +- .../ssca2/main/SSCA2_Modules/io_RMAT_graph.chpl | 2 +- 32 files changed, 52 insertions(+), 49 deletions(-) diff --git a/test/arrays/ferguson/array-initialization-patterns/array-init-replicated.chpl b/test/arrays/ferguson/array-initialization-patterns/array-init-replicated.chpl index 5189c61f3d82..3e1ba71a2a95 100644 --- a/test/arrays/ferguson/array-initialization-patterns/array-init-replicated.chpl +++ b/test/arrays/ferguson/array-initialization-patterns/array-init-replicated.chpl @@ -44,7 +44,7 @@ operator R.=(ref lhs:R, rhs:R) { proc makeInitialArray() { - var D = {1..1} dmapped Replicated(); + var D = {1..1} dmapped replicatedDist(); var ret: [D] int; return ret; } diff --git a/test/arrays/ferguson/array-initialization-patterns/array-initialization-patterns-dists.chpl b/test/arrays/ferguson/array-initialization-patterns/array-initialization-patterns-dists.chpl index 53a75c5d14cd..99f426da8194 100644 --- a/test/arrays/ferguson/array-initialization-patterns/array-initialization-patterns-dists.chpl +++ b/test/arrays/ferguson/array-initialization-patterns/array-initialization-patterns-dists.chpl @@ -32,7 +32,7 @@ record R { } proc deinit() { - // Replicated is the only distribution where a 1 element array will print + // replicatedDist is the only distribution where a 1 element array will print // out more than one deinit call for the element (on a multilocale run // with N locales, there are N elements, one for each replicand). Deinit // order in such a situation is nondeterministic, so don't bother. @@ -69,7 +69,7 @@ proc makeInitialArray() { var ret: [D] int; return ret; } else if distType == DistType.replicated { - var D = {1..1} dmapped Replicated(); + var D = {1..1} dmapped replicatedDist(); var ret: [D] int; return ret; } else if distType == DistType.stencil { diff --git a/test/arrays/ferguson/array-initialization-patterns/post-alloc-dists.chpl b/test/arrays/ferguson/array-initialization-patterns/post-alloc-dists.chpl index 08d77add5560..cb422e8d804d 100644 --- a/test/arrays/ferguson/array-initialization-patterns/post-alloc-dists.chpl +++ b/test/arrays/ferguson/array-initialization-patterns/post-alloc-dists.chpl @@ -26,7 +26,7 @@ proc makeA() { var ret: [D] int; return ret; } else if distType == DistType.replicated { - var D = {1..1} dmapped Replicated(); + var D = {1..1} dmapped replicatedDist(); var ret: [D] int; return ret; } else if distType == DistType.stencil { diff --git a/test/deprecated/dmapType.good b/test/deprecated/dmapType.good index 7c274a826c30..cc5d36b5088d 100644 --- a/test/deprecated/dmapType.good +++ b/test/deprecated/dmapType.good @@ -4,6 +4,9 @@ dmapType.chpl:8: warning: 'Block' is deprecated, please use 'blockDist' instead dmapType.chpl:14: warning: 'Cyclic' is deprecated, please use 'cyclicDist' instead dmapType.chpl:18: warning: 'Cyclic' is deprecated, please use 'cyclicDist' instead dmapType.chpl:18: warning: 'Cyclic' is deprecated, please use 'cyclicDist' instead +dmapType.chpl:24: warning: 'Replicated' is deprecated, please use 'replicatedDist' instead +dmapType.chpl:28: warning: 'Replicated' is deprecated, please use 'replicatedDist' instead +dmapType.chpl:28: warning: 'Replicated' is deprecated, please use 'replicatedDist' instead dmapType.chpl:34: warning: 'Stencil' is deprecated, please use 'stencilDist' instead dmapType.chpl:38: warning: 'Stencil' is deprecated, please use 'stencilDist' instead dmapType.chpl:38: warning: 'Stencil' is deprecated, please use 'stencilDist' instead @@ -20,6 +23,6 @@ blockDist(1,int(64),unmanaged DefaultDist) 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 cyclicDist(1,int(64)) 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 -Replicated +replicatedDist 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 0.0 stencilDist(1,int(64),false) diff --git a/test/distributions/bradc/ReplWithMultiDim.chpl b/test/distributions/bradc/ReplWithMultiDim.chpl index 9f4451fcce56..d60238923264 100644 --- a/test/distributions/bradc/ReplWithMultiDim.chpl +++ b/test/distributions/bradc/ReplWithMultiDim.chpl @@ -2,5 +2,5 @@ use ReplicatedDist; const Space = {1..8, 1..8}; const OneLocOnly: [0..0, 0..0] locale = Locales[0]; -const R2 = Space dmapped Replicated(targetLocales=OneLocOnly); +const R2 = Space dmapped replicatedDist(targetLocales=OneLocOnly); writeln(R2); diff --git a/test/distributions/bradc/distEquality.chpl b/test/distributions/bradc/distEquality.chpl index 1401e7af69fa..e966288e30fe 100644 --- a/test/distributions/bradc/distEquality.chpl +++ b/test/distributions/bradc/distEquality.chpl @@ -87,8 +87,8 @@ writeln(); const OneLocOnly1D: [0..0] locale = Locales[0]; -const R1 = Space dmapped Replicated(); -const R2 = Space dmapped Replicated(targetLocales=OneLocOnly1D); +const R1 = Space dmapped replicatedDist(); +const R2 = Space dmapped replicatedDist(targetLocales=OneLocOnly1D); writeln("Replicated comparisons:"); @@ -97,4 +97,4 @@ writeln(R1.distribution == R2.distribution); writeln(R2.distribution == R2.distribution); -writeln(R2.distribution == (Space dmapped Replicated(targetLocales=OneLocOnly1D)).distribution); +writeln(R2.distribution == (Space dmapped replicatedDist(targetLocales=OneLocOnly1D)).distribution); diff --git a/test/distributions/bradc/passDistDomsToFns.chpl b/test/distributions/bradc/passDistDomsToFns.chpl index 397ba1e8cdd4..2b98c7729f11 100644 --- a/test/distributions/bradc/passDistDomsToFns.chpl +++ b/test/distributions/bradc/passDistDomsToFns.chpl @@ -27,7 +27,7 @@ proc fooBC(X:[BlkCycSpace] int) { } -const ReplicatedSpace = Space dmapped Replicated(); +const ReplicatedSpace = Space dmapped replicatedDist(); var RA: [ReplicatedSpace] int; fooR(RA); proc fooR(X:[ReplicatedSpace] int) { diff --git a/test/distributions/dm/hplx.chpl b/test/distributions/dm/hplx.chpl index 9ed549a97b13..fb0854345189 100644 --- a/test/distributions/dm/hplx.chpl +++ b/test/distributions/dm/hplx.chpl @@ -12,7 +12,7 @@ use ReplicatedDist; config const blk = 5, fac=10; const n = blk*fac; -const Dist2D = new Replicated(); +const Dist2D = new replicatedDist(); proc main() { const AbD: domain(2) dmapped Dist2D = {1..n, 1..n}; diff --git a/test/distributions/replicated/ReplicatedMemLeak.chpl b/test/distributions/replicated/ReplicatedMemLeak.chpl index d3e624a2233e..b295d8566cce 100644 --- a/test/distributions/replicated/ReplicatedMemLeak.chpl +++ b/test/distributions/replicated/ReplicatedMemLeak.chpl @@ -39,7 +39,7 @@ operator r.=(ref lhs: r, const ref rhs: r) { rhs.ptr.x += 1; } -var d1 = {0..0} dmapped Replicated(); +var d1 = {0..0} dmapped replicatedDist(); var a1: [d1] r; proc test() { diff --git a/test/distributions/replicated/ReplicatedNonCopyable.chpl b/test/distributions/replicated/ReplicatedNonCopyable.chpl index d27fe32d50ef..586d4451f396 100644 --- a/test/distributions/replicated/ReplicatedNonCopyable.chpl +++ b/test/distributions/replicated/ReplicatedNonCopyable.chpl @@ -3,7 +3,7 @@ use ReplicatedDist; class C { var x = 0; } proc test() { - var d = {0..0} dmapped Replicated(); + var d = {0..0} dmapped replicatedDist(); var a: [d] owned C; } test(); diff --git a/test/distributions/replicated/consistentLocales/testLocaleScramble.chpl b/test/distributions/replicated/consistentLocales/testLocaleScramble.chpl index 91ee55294369..35661d430937 100644 --- a/test/distributions/replicated/consistentLocales/testLocaleScramble.chpl +++ b/test/distributions/replicated/consistentLocales/testLocaleScramble.chpl @@ -6,7 +6,7 @@ var Grid: [GridD] locale = for i in 0..#numLocales do Locales[numLocales-1-i]; writeln("Grid is: ", Grid); -const D = {1..3} dmapped Replicated(Grid); +const D = {1..3} dmapped replicatedDist(Grid); var A: [D] real; coforall loc in Locales with (ref A) do diff --git a/test/distributions/replicated/consistentLocales/testLocaleScramble2.chpl b/test/distributions/replicated/consistentLocales/testLocaleScramble2.chpl index 729dca84251b..90968d69a1c0 100644 --- a/test/distributions/replicated/consistentLocales/testLocaleScramble2.chpl +++ b/test/distributions/replicated/consistentLocales/testLocaleScramble2.chpl @@ -6,7 +6,7 @@ var Grid: [GridD] locale = for i in 0..#numLocales do Locales[numLocales-1-i]; writeln("Grid is: ", Grid); -const D = {1..3} dmapped Replicated(Grid); +const D = {1..3} dmapped replicatedDist(Grid); var A: [D] real; coforall loc in Locales with (ref A) do diff --git a/test/distributions/replicated/consistentLocales/testLocaleScramble2D.chpl b/test/distributions/replicated/consistentLocales/testLocaleScramble2D.chpl index 04340a02f033..7f2a994cf1bb 100644 --- a/test/distributions/replicated/consistentLocales/testLocaleScramble2D.chpl +++ b/test/distributions/replicated/consistentLocales/testLocaleScramble2D.chpl @@ -10,7 +10,7 @@ var Grid = reshape(Locales, GridD); writeln("Grid is: ", Grid); -const D = {1..3} dmapped Replicated(Grid); +const D = {1..3} dmapped replicatedDist(Grid); var A: [D] real; coforall loc in Locales with (ref A) do diff --git a/test/distributions/replicated/initStridedWithDense.chpl b/test/distributions/replicated/initStridedWithDense.chpl index ffdfdc2ad203..cd331aefbb3f 100644 --- a/test/distributions/replicated/initStridedWithDense.chpl +++ b/test/distributions/replicated/initStridedWithDense.chpl @@ -3,5 +3,5 @@ use ReplicatedDist; // Once upon a time this program would fail to compile due to an // incorrectly-written 'dsiAssignDomain.' -var D : domain(1, strides=strideKind.any) dmapped Replicated() = {1..10}; +var D : domain(1, strides=strideKind.any) dmapped replicatedDist() = {1..10}; writeln(D); diff --git a/test/distributions/replicated/remoteOwnership.chpl b/test/distributions/replicated/remoteOwnership.chpl index 22821fbc00e6..fe95f14fbe03 100644 --- a/test/distributions/replicated/remoteOwnership.chpl +++ b/test/distributions/replicated/remoteOwnership.chpl @@ -4,7 +4,7 @@ config const n = 11; // test a standard block distribution -const D = {1..n, 1..n} dmapped Replicated(); +const D = {1..n, 1..n} dmapped replicatedDist(); var A: [D] real; testit(D, A); @@ -17,7 +17,7 @@ if (numLocales == 4) { targetLocs[2,1] = Locales[0]; targetLocs[2,2] = Locales[2]; - const D = {1..n, 1..n} dmapped Replicated(targetLocales = targetLocs); + const D = {1..n, 1..n} dmapped replicatedDist(targetLocales = targetLocs); var A: [D] real; testit(D, A); @@ -34,7 +34,7 @@ if (numLocales == 4) { targetLocs[1,1] = Locales[3]; targetLocs[1,2] = Locales[1]; - const D = {1..n, 1..n} dmapped Replicated(targetLocales = targetLocs); + const D = {1..n, 1..n} dmapped replicatedDist(targetLocales = targetLocs); var A: [D] real; testit(D, A); diff --git a/test/distributions/replicated/repl-int-error.chpl b/test/distributions/replicated/repl-int-error.chpl index c2db921f3245..48152ed63ce0 100644 --- a/test/distributions/replicated/repl-int-error.chpl +++ b/test/distributions/replicated/repl-int-error.chpl @@ -2,7 +2,7 @@ use ReplicatedDist; config const n = 8; const Space = {1..n, 1..n}; -const ReplicatedSpace = Space dmapped Replicated(); +const ReplicatedSpace = Space dmapped replicatedDist(); var RA: [ReplicatedSpace] int; coforall loc in Locales with (ref RA) do diff --git a/test/distributions/replicated/scanReplicated.chpl b/test/distributions/replicated/scanReplicated.chpl index 87808eb258a7..c7995982a3c5 100644 --- a/test/distributions/replicated/scanReplicated.chpl +++ b/test/distributions/replicated/scanReplicated.chpl @@ -1,6 +1,6 @@ use ReplicatedDist; -var D = {1..5} dmapped Replicated(); +var D = {1..5} dmapped replicatedDist(); var A: [D] int; for loc in Locales do diff --git a/test/distributions/replicated/testReplWrites.chpl b/test/distributions/replicated/testReplWrites.chpl index 1865e17605c4..a9021483c501 100644 --- a/test/distributions/replicated/testReplWrites.chpl +++ b/test/distributions/replicated/testReplWrites.chpl @@ -1,6 +1,6 @@ use ReplicatedDist; -const D = {1..3, 1..3} dmapped Replicated(); +const D = {1..3, 1..3} dmapped replicatedDist(); var A: [D] real; diff --git a/test/distributions/replicated/testReplicand.chpl b/test/distributions/replicated/testReplicand.chpl index 99aa9e95c2e1..8bd6c23d461a 100644 --- a/test/distributions/replicated/testReplicand.chpl +++ b/test/distributions/replicated/testReplicand.chpl @@ -1,7 +1,7 @@ use ReplicatedDist; var locD = {1..5}; -var D = locD dmapped Replicated(); +var D = locD dmapped replicatedDist(); var A: [D] int; diff --git a/test/distributions/replicated/testUserAPI.chpl b/test/distributions/replicated/testUserAPI.chpl index 7a45bcc25c24..23a4b7a68674 100644 --- a/test/distributions/replicated/testUserAPI.chpl +++ b/test/distributions/replicated/testUserAPI.chpl @@ -5,7 +5,7 @@ require "../../domains/userAPI/domainAPItest.chpl"; use domainAPItest only testDomainAPI2D as doTestDomainAPI2D; proc testDomainAPI2D(param lbl, DR: domain(?), idx, OOBidx1, OOBidx2, intDom) { - doTestDomainAPI2D(lbl, DR dmapped Replicated(), idx, OOBidx1, OOBidx2, intDom); + doTestDomainAPI2D(lbl, DR dmapped replicatedDist(), idx, OOBidx1, OOBidx2, intDom); } proc main { diff --git a/test/distributions/robust/arithmetic/driver.chpl b/test/distributions/robust/arithmetic/driver.chpl index 25aae791d8b6..61c2c7a220b3 100644 --- a/test/distributions/robust/arithmetic/driver.chpl +++ b/test/distributions/robust/arithmetic/driver.chpl @@ -61,11 +61,11 @@ proc setupDistributions(param DT : DistType) { } if DT == DistType.replicated { return ( - new Replicated(), - new Replicated(), - new Replicated(), - new Replicated(), - new Replicated() + new replicatedDist(), + new replicatedDist(), + new replicatedDist(), + new replicatedDist(), + new replicatedDist() ); } if DT == DistType.stencil { diff --git a/test/distributions/robust/arithmetic/resizing/resizeFromOtherLocale.chpl b/test/distributions/robust/arithmetic/resizing/resizeFromOtherLocale.chpl index 0714da00d0bd..cb4e1c0d091a 100644 --- a/test/distributions/robust/arithmetic/resizing/resizeFromOtherLocale.chpl +++ b/test/distributions/robust/arithmetic/resizing/resizeFromOtherLocale.chpl @@ -32,7 +32,7 @@ proc buildSpace(Dom) { return Dom dmapped cyclicDist(startIdx=1); } else if distType == DistType.replicated { - return Dom dmapped Replicated(); + return Dom dmapped replicatedDist(); } else if distType == DistType.stencil { return Dom dmapped stencilDist(boundingBox={1..3}); diff --git a/test/distributions/vass/testReplicatedDist1.chpl b/test/distributions/vass/testReplicatedDist1.chpl index 770c6aeb8238..2b4fd5335d86 100644 --- a/test/distributions/vass/testReplicatedDist1.chpl +++ b/test/distributions/vass/testReplicatedDist1.chpl @@ -15,7 +15,7 @@ config type elt = int; // ARepl - the replicated array to be tested const repllocales = Locales; // in case this changes -var ReplBlockDist = new Replicated(); +var ReplBlockDist = new replicatedDist(); var DRepl: domain(2) dmapped ReplBlockDist = DsubLoc; var ARepl: [DRepl] elt; diff --git a/test/distributions/vass/testReplicatedDistLocal1.chpl b/test/distributions/vass/testReplicatedDistLocal1.chpl index 0e4729834709..b4bda0f5a3a4 100644 --- a/test/distributions/vass/testReplicatedDistLocal1.chpl +++ b/test/distributions/vass/testReplicatedDistLocal1.chpl @@ -5,7 +5,7 @@ use ReplicatedDist; const ls = Locales; writeln("running on locales ", ls.domain); -var d = {1..3,1..3} dmapped Replicated(ls); +var d = {1..3,1..3} dmapped replicatedDist(ls); var a: [d] int; // diff --git a/test/distributions/vass/testReplicatedVar1.chpl b/test/distributions/vass/testReplicatedVar1.chpl index 0475dfa610e7..764653f6bad6 100644 --- a/test/distributions/vass/testReplicatedVar1.chpl +++ b/test/distributions/vass/testReplicatedVar1.chpl @@ -34,7 +34,7 @@ if numLocales >= 4 { var myL = Locales(1..3 by 2); // myL[1] = myL[2]; // this makes myL violate the "consistency" requirement writeln("\nadvanced case: ", myL); - var x: [rcDomainBase dmapped Replicated(myL)] real; + var x: [rcDomainBase dmapped replicatedDist(myL)] real; writeln("\ninitially"); writeReplicands(x, myL); rcReplicate(x, 5); diff --git a/test/domains/bradc/stringCast.chpl b/test/domains/bradc/stringCast.chpl index c3d5f3f393b9..ee3d53140d8b 100644 --- a/test/domains/bradc/stringCast.chpl +++ b/test/domains/bradc/stringCast.chpl @@ -3,7 +3,7 @@ use BlockDist, CyclicDist, ReplicatedDist; const D = {1..10}; const BD = blockDist.createDomain({1..11}); const CD = cyclicDist.createDomain({1..12}); -const RD = {1..13} dmapped Replicated(); +const RD = {1..13} dmapped replicatedDist(); var SD: sparse subdomain(D); for i in 1..10 do SD += i; diff --git a/test/library/packages/DistributedIters/perf/benchmarkDistributedIters.chpl b/test/library/packages/DistributedIters/perf/benchmarkDistributedIters.chpl index 6a4eb14a3025..bad1def97d93 100644 --- a/test/library/packages/DistributedIters/perf/benchmarkDistributedIters.chpl +++ b/test/library/packages/DistributedIters/perf/benchmarkDistributedIters.chpl @@ -143,7 +143,7 @@ private proc testDynamicWorkload() { var timer:stopwatch; - const replicatedDomain:domain(1) dmapped Replicated() = controlDomain; + const replicatedDomain:domain(1) dmapped replicatedDist() = controlDomain; var array:[controlDomain]real; var replicatedArray:[replicatedDomain]real; @@ -178,7 +178,7 @@ private proc testGuidedWorkload() { var timer:stopwatch; - const replicatedDomain:domain(1) dmapped Replicated() = controlDomain; + const replicatedDomain:domain(1) dmapped replicatedDist() = controlDomain; var array:[controlDomain]real; var replicatedArray:[replicatedDomain]real; diff --git a/test/memory/sungeun/refCount/domainMaps.chpl b/test/memory/sungeun/refCount/domainMaps.chpl index e328ffe62c8d..2bdc6d3b07ec 100644 --- a/test/memory/sungeun/refCount/domainMaps.chpl +++ b/test/memory/sungeun/refCount/domainMaps.chpl @@ -11,7 +11,7 @@ proc myDM(param dmType: DMType) { when DMType.block do return new blockDist(rank=1, boundingBox={1..n}); when DMType.cyclic do return new cyclicDist(startIdx=1); when DMType.blockcyclic do return new dmap(new BlockCyclic(startIdx=(1,), blocksize=(3,))); - when DMType.replicated do return new Replicated(); + when DMType.replicated do return new replicatedDist(); otherwise halt("unexpected 'dmType': ", dmType); } } diff --git a/test/parallel/forall/reduce-intents/ri-4-arrdom.chpl b/test/parallel/forall/reduce-intents/ri-4-arrdom.chpl index f86623c60c02..7510eaf146fe 100644 --- a/test/parallel/forall/reduce-intents/ri-4-arrdom.chpl +++ b/test/parallel/forall/reduce-intents/ri-4-arrdom.chpl @@ -31,7 +31,7 @@ proc setupDistributions() { return new dmap(new BlockCyclic(startIdx=(0,0), blocksize=(3,3))); else if distType == DistType.replicated then - return new Replicated(); + return new replicatedDist(); else compilerError("unexpected 'distType': ", distType:c_ptrConst(c_char)); } diff --git a/test/release/examples/primers/replicated.chpl b/test/release/examples/primers/replicated.chpl index 0d139afc6920..3218e0371202 100644 --- a/test/release/examples/primers/replicated.chpl +++ b/test/release/examples/primers/replicated.chpl @@ -1,7 +1,7 @@ -// Replicated Distribution +// replicatedDist Distribution /* - This primer demonstrates uses of the Replicated Distribution. + This primer demonstrates uses of the replicatedDist Distribution. To use this distribution in a Chapel program, the following module must be used: */ @@ -17,7 +17,7 @@ // locales does a nice job of illustrating the distribution // characteristics. // -// Like other distributions, Replicated supports options to map to a different +// Like other distributions, replicatedDist supports options to map to a different // virtual locale grid than the one used by default (a multidimensional // factoring of the built-in ``Locales`` array), as well as // to control the amount of parallelism used in data parallel @@ -37,13 +37,13 @@ config const n = 8; const Space = {1..n, 1..n}; -// Replicated -// ---------- +// replicatedDist +// -------------- // -// The ``Replicated`` distribution is different from other distributions: +// The ``replicatedDist`` distribution is different from other distributions: // each of the original domain's indices is replicated onto // each locale, as are the corresponding array elements. For example, -// a domain ``{1..3}`` distributed using ``Replicated`` will store +// a domain ``{1..3}`` distributed using ``replicatedDist`` will store // three indices per locale that the distribution is targeting (by // default, all locales). Similarly, an array declared over that // domain will store three elements per locale. Each locale's copy of @@ -62,7 +62,7 @@ const Space = {1..n, 1..n}; // // Here's a declaration of a replicated domain and array: // -const ReplicatedSpace = Space dmapped Replicated(); +const ReplicatedSpace = Space dmapped replicatedDist(); var RA: [ReplicatedSpace] int; // Queries about the size of a replicated domain or array will return diff --git a/test/sparse/slices/sparseSliceDenseBlock.chpl b/test/sparse/slices/sparseSliceDenseBlock.chpl index e8bf9bf6598b..e3691881300b 100644 --- a/test/sparse/slices/sparseSliceDenseBlock.chpl +++ b/test/sparse/slices/sparseSliceDenseBlock.chpl @@ -6,7 +6,7 @@ var A: [D] real; use ReplicatedDist; -var DR = {1..10, 1..10} dmapped Replicated(); +var DR = {1..10, 1..10} dmapped replicatedDist(); var AR: [DR] int; coforall loc in Locales with (ref AR) do diff --git a/test/studies/ssca2/main/SSCA2_Modules/io_RMAT_graph.chpl b/test/studies/ssca2/main/SSCA2_Modules/io_RMAT_graph.chpl index 65e7ec5d70ce..5c6db2ddeb9c 100644 --- a/test/studies/ssca2/main/SSCA2_Modules/io_RMAT_graph.chpl +++ b/test/studies/ssca2/main/SSCA2_Modules/io_RMAT_graph.chpl @@ -200,7 +200,7 @@ proc Readin_RMAT_graph(G, snapshot_prefix:string, dstyle = "-"): void { } else { // !IOserial - const repfileDom = repfileBase dmapped Replicated(Locales); + const repfileDom = repfileBase dmapped replicatedDist(Locales); var repfiles: [repfileDom] file; coforall l in Locales with (ref repfiles) do on l { From 3dc870c880ba3432d45a14acc985ae04ff24c31d Mon Sep 17 00:00:00 2001 From: Brad Chamberlain Date: Tue, 12 Sep 2023 21:29:03 -0500 Subject: [PATCH 4/4] Update docs / strings to refer to 'replicatedDist' rather than 'Replicated' --- Signed-off-by: Brad Chamberlain --- modules/dists/ReplicatedDist.chpl | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/modules/dists/ReplicatedDist.chpl b/modules/dists/ReplicatedDist.chpl index f7ee02590039..6661b8c81688 100644 --- a/modules/dists/ReplicatedDist.chpl +++ b/modules/dists/ReplicatedDist.chpl @@ -22,7 +22,7 @@ // THE REPLICATED DISTRIBUTION IMPLEMENTATION // // Classes defined: -// Replicated -- Global distribution descriptor +// ReplicatedImpl -- Global distribution descriptor // ReplicatedDom -- Global domain descriptor // LocReplicatedDom -- Local domain descriptor // ReplicatedArr -- Global array descriptor @@ -48,12 +48,12 @@ config param traceReplicatedDist = false; // nicer example - pull from primers/distributions.chpl /* -This Replicated distribution causes a domain and its arrays +This ``replicatedDist`` distribution causes a domain and its arrays to be replicated across the desired locales (all the locales by default). An array receives a distinct set of elements - a "replicand" - allocated on each locale. -In other words, a Replicated-distributed domain has +In other words, a replicated-distributed domain has an implicit additional dimension - over the locales, making it behave as if there is one copy of its indices per locale. @@ -74,7 +74,7 @@ referring to the domain or array. .. code-block:: chapel const Dbase = {1..5}; // A default-distributed domain - const Drepl = Dbase dmapped Replicated(); + const Drepl = Dbase dmapped replicatedDist(); var Abase: [Dbase] int; var Arepl: [Drepl] int; @@ -93,13 +93,13 @@ distribution. **Initializer Arguments** -The ``Replicated`` class initializer is defined as follows: +The ``replicatedDist`` class initializer is defined as follows: .. code-block:: chapel proc replicatedDist.init( targetLocales: [] locale = Locales, - purposeMessage: string = "used to create a Replicated") + purposeMessage: string = "used to create a replicatedDist") The optional ``purposeMessage`` may be useful for debugging when the initializer encounters an error. @@ -117,7 +117,7 @@ record replicatedDist { forwarding const chpl_distHelp: chpl_PrivatizedDistHelper(unmanaged ReplicatedImpl); proc init(targetLocales: [] locale = Locales, - purposeMessage = "used to create a Replicated") { + purposeMessage = "used to create a replicatedDist") { const value = new unmanaged ReplicatedImpl(targetLocales, purposeMessage); this.chpl_distHelp = new chpl_PrivatizedDistHelper( @@ -187,7 +187,7 @@ class ReplicatedImpl : BaseDist { // initializer: replicate over the given locales // (by default, over all locales) proc ReplicatedImpl.init(targetLocales: [] locale = Locales, - purposeMessage: string = "used to create a Replicated") + purposeMessage: string = "used to create a replicatedDist") { init this;