Skip to content

Commit 74e04a3

Browse files
authored
Merge pull request #114 from JordiManyer/bugfix-global-length-prange
Bugfix: `global_length` for `PRange`
2 parents fc741f2 + c66fa97 commit 74e04a3

File tree

3 files changed

+6
-1
lines changed

3 files changed

+6
-1
lines changed

CHANGELOG.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0
1111

1212
- Added an MPI ibarrier-based (supposedly scalable) algorithm to find rcv neighbours in a sparse all-to-all communication graph given the snd neighbors. We left the previous non-scalable algorithm as default (based on gather-scatter) until we have experimental evidence on the relative performance and scalability of the former with respect to the latter and for which core ranges.
1313

14+
### Fixed
15+
16+
- Bugfix: `global_length` for `PRange` not working as intended.
17+
1418
## [0.3.2] - 2023-05-10
1519

1620
### Fixed

src/p_range.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1642,7 +1642,7 @@ end
16421642

16431643
##prange(f,args...) = PRange(f(args...))
16441644

1645-
global_length(pr::PRange) = map(local_length,partition(pr))
1645+
global_length(pr::PRange) = map(global_length,partition(pr))
16461646
local_length(pr::PRange) = map(local_length,partition(pr))
16471647
own_length(pr::PRange) = map(own_length,partition(pr))
16481648
local_to_global(pr::PRange) = map(local_to_global,partition(pr))

test/p_range_tests.jl

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -190,6 +190,7 @@ function p_range_tests(distribute)
190190

191191
ids4 = uniform_partition(parts,(2,2),(5,4))
192192
@test length(PRange(ids4)) == 4*5
193+
@test PartitionedArrays.getany(global_length(PRange(ids4))) == 4*5
193194
map(parts,ids4) do part, lid_to_gid
194195
if part == 1
195196
@test lid_to_gid == [1, 2, 6, 7]

0 commit comments

Comments
 (0)