Verify that parallel functions can use a parallel pool
returns a logical
value indicating if parallel functions can create and use a parallel pool. tf
= canUseParallelPool()
The function returns logical 1
(true
) if
Parallel Computing Toolbox™ is installed and licensed for use, a default parallel pool is configured and
supported, and automatic creation of parallel pools is enabled. Otherwise, the function
returns logical 0
(false
). This function does not
create a parallel pool.
Use canUseParallelPool
to check if parallel functions such as
parfor
(Parallel Computing Toolbox) and parfeval
(Parallel Computing Toolbox) can use a parallel pool. This enables you to avoid executing code
that requires a parallel pool if one is not available.
Even if this function returns true, you can still receive an error when you try to create a parallel pool if your parallel cluster is not properly configured or cannot be contacted.
canUseGPU
| parpool
(Parallel Computing Toolbox)