Skip to content

Commit

Permalink
Merge pull request #114 from JordiManyer/bugfix-global-length-prange
Browse files Browse the repository at this point in the history
Bugfix: `global_length` for `PRange`
  • Loading branch information
fverdugo authored Aug 8, 2023
2 parents fc741f2 + c66fa97 commit 74e04a3
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 1 deletion.
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -11,6 +11,10 @@ and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0

- 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.

### Fixed

- Bugfix: `global_length` for `PRange` not working as intended.

## [0.3.2] - 2023-05-10

### Fixed
Expand Down
2 changes: 1 addition & 1 deletion src/p_range.jl
Original file line number Diff line number Diff line change
Expand Up @@ -1642,7 +1642,7 @@ end

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

global_length(pr::PRange) = map(local_length,partition(pr))
global_length(pr::PRange) = map(global_length,partition(pr))
local_length(pr::PRange) = map(local_length,partition(pr))
own_length(pr::PRange) = map(own_length,partition(pr))
local_to_global(pr::PRange) = map(local_to_global,partition(pr))
Expand Down
1 change: 1 addition & 0 deletions test/p_range_tests.jl
Original file line number Diff line number Diff line change
Expand Up @@ -190,6 +190,7 @@ function p_range_tests(distribute)

ids4 = uniform_partition(parts,(2,2),(5,4))
@test length(PRange(ids4)) == 4*5
@test PartitionedArrays.getany(global_length(PRange(ids4))) == 4*5
map(parts,ids4) do part, lid_to_gid
if part == 1
@test lid_to_gid == [1, 2, 6, 7]
Expand Down

0 comments on commit 74e04a3

Please sign in to comment.