Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

localindices methods in conflict with SharedArrays #194

Open
henryk-modzelewski opened this issue Dec 7, 2018 · 1 comment
Open

localindices methods in conflict with SharedArrays #194

henryk-modzelewski opened this issue Dec 7, 2018 · 1 comment

Comments

@henryk-modzelewski
Copy link

henryk-modzelewski commented Dec 7, 2018

It seems like there is a conflict between localindices method between SharedArrays and DistributedArrays. Please, see the REPL output below.

10:46:39 $ julia-1.0
_
_ _ ()_ | Documentation: https://docs.julialang.org
() | () () |
_ _ | | __ _ | Type "?" for help, "]?" for Pkg help.
| | | | | | |/ ` | |
| | |
| | | | (
| | | Version 1.0.2 (2018-11-08)
/ |_'|||_'_| | Official https://julialang.org/ release
|__/ |

julia> using SharedArrays

julia> SharedArrays.
SharedArray include range_1dim shm_unlink
SharedMatrix indexpids sa_refs shmem_fill
SharedVector init_loc_flds sdata shmem_rand
_shm_mmap_array initialize_shared_array shared_pids shmem_randn
eval localindices shm_mmap_array sub_1dim
finalize_refs print_shmem_limits shm_open
julia> using DistributedArrays
WARNING: using DistributedArrays.localindices in module Main conflicts with an existing identifier.

help?> SharedArrays.localindices
localindices(S::SharedArray)

Returns a range describing the "default" indices to be handled by the current process. This range should
be interpreted in the sense of linear indexing, i.e., as a sub-range of 1:length(S). In multi-process
contexts, returns an empty range in the parent process (or any process for which indexpids returns 0).

It's worth emphasizing that localindices exists purely as a convenience, and you can partition work on the
array among workers any way you wish. For a SharedArray, all indices should be equally fast for each
worker process.

help?> DistributedArrays.localindices
localindices(d)

A tuple describing the indices owned by the local process. Returns a tuple with empty ranges if no local
part exists on the calling process.

@henryk-modzelewski henryk-modzelewski changed the title localindices methods in conflict with ShareedArrays localindices methods in conflict with SharedArrays Dec 7, 2018
@jishnub
Copy link

jishnub commented Jan 7, 2021

As suggested on discourse, the solution might be to add a function localindices to Base, and have both SharedArrays and DistributedArrays add methods to that function.

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

No branches or pull requests

2 participants