Programmatically check type of parpool
24 次查看(过去 30 天)
显示 更早的评论
How can I check programmatically whether an existing parallel pool is thread-based or process-based?
2 个评论
采纳的回答
Meg Noah
2025-8-8
delete(gcp('nocreate'))
pool = parpool('Threads')
class(pool)
% test of whether or not pool is a thread parallel pool
contains(class(pool), 'parallel.ThreadPool')
opts = parforOptions(pool)
class(opts.Pool)
% test for whether or not pool is a Thread pool
contains(class(opts.Pool), 'parallel.ThreadPool')
% check to see if the same methods in pool are inherited from ThreadPool
methods(pool)
更多回答(0 个)
另请参阅
类别
在 Help Center 和 File Exchange 中查找有关 Parallel Computing Fundamentals 的更多信息
Community Treasure Hunt
Find the treasures in MATLAB Central and discover how the community can help you!
Start Hunting!