在启动MATLAB R2023a/b版本的并行池时,会显示如下等错误
错误使用 parpool
Parallel pool failed to start with the following error. For more detailed information, validate the profile 'Processes' in the
Cluster Profile Manager.
出错 parallel.internal.ui.PoolHelper.startPool (第 12 行)
parpool();
原因:
错误使用 parallel.internal.pool.AbstractInteractiveClient>iThrowWithCause
Failed to initialize the interactive session.
错误使用 parallel.internal.pool.AbstractInteractiveClient>iThrowIfBadParallelJobStatus
The interactive communicating job failed with no message.
这是因为需要自己设置使用worker的个数
方法一:参考MATLAB 并行计算 parfor 用法及注意事项-CSDN博客
在命令区输入 :
my_cluster=parcluster('local');
my_cluster.NumWorkers=4;%可根据需求或计算机的核心数设定
mypar = parpool(my_cluster,my_cluster.NumWorkers);
再启动即可
方法二:
1、点击Parallel,选择Paraller Preferences...
2、点击Cluster Profile Manager
3、点击Edit,设置Number of workers 为 4(自己设置)。
4、点击Done之后 ,点击上方Validate
5、运行无误后,说明可以成功运行并行池
6、此时启动并行,显示成功
Starting parallel pool (parpool) using the 'Processes' profile ...
Connected to parallel pool with 4 workers.