procs
procs()
Returns a list of all process identifiers.
Examples
In the Julia programming language, the function procs(::SharedArray)
is used to get the vector of processes that have mapped a shared array S
.
julia> S = SharedArray{Int}(4);
julia> procs(S)
1-element Array{Int64,1}:
1
This example shows that the shared array S
is mapped to process 1.
Common example:
julia> S = SharedArray{Float64}(6);
julia> procs(S)
1-element Array{Int64,1}:
1
Here, the shared array S
is also mapped to process 1.
Common mistake example:
julia> A = [1, 2, 3, 4];
julia> procs(A)
ERROR: MethodError: no method matching procs(::Array{Int64,1})
In this example, the function procs
is mistakenly used on a regular array A
instead of a shared array. Ensure that procs
is used specifically for shared arrays to avoid such errors.
See Also
addprocs, atexit, cd, clipboard, EnvHash, exit, getpid, peakflops, ProcessExitedException, process_exited, process_running, procs, quit, readandwrite, redirect_stdout, rmprocs, run, setenv, spawn, withenv,User Contributed Notes
Add a Note
The format of note supported is markdown, use triple backtick to start and end a code block.