canUseParallelPool
Description
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.
Examples
Version History
Introduced in R2020b
See Also
canUseGPU
| parpool
(Parallel Computing Toolbox)
Topics
- Run MATLAB Functions with Automatic Parallel Support (Parallel Computing Toolbox)
- Run Code on Parallel Pools (Parallel Computing Toolbox)
- Decide When to Use parfor (Parallel Computing Toolbox)
- Specify Your Parallel Preferences (Parallel Computing Toolbox)