nworkers
nworkers()
Get the number of available worker processes. This is one less than nprocs()
. Equal to nprocs()
if nprocs() == 1
.
Examples
julia> nworkers()
4
This example returns the number of available worker processes. If no worker processes are available, it returns 1.
Common mistake example:
julia> nworkers(3)
ERROR: MethodError: no method matching nworkers(::Int64)
In this example, the nworkers()
function does not accept any arguments. It is used to retrieve the number of available worker processes and does not take any input parameters. Make sure to call nworkers()
without any arguments.
See Also
User Contributed Notes
Add a Note
The format of note supported is markdown, use triple backtick to start and end a code block.