检查MATLAB是否在多线程模式下运行 [英] Checking if MATLAB is running in multithread mode

查看:231
本文介绍了检查MATLAB是否在多线程模式下运行的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

文档说明可以在单线程中启动MATLAB模式如下:

The documentation states that MATLAB can be launched in single-thread mode as follows:

matlab -singleCompThread

我的问题是:是否有一种方法可以从MATLAB内部可靠地检查它是在此模式下运行还是在默认的多线程模式下运行?

My question is: Is there a way to reliably check from within MATLAB if it's running in this mode or in the default multi-thread mode?

我们可以访问远程群集,在该群集中,根据发送作业的队列和计算资源的可用性,MATLAB可能以singleCompThread模式启动,如果能够在MATLAB内部进行说明,那将是非常不错的.

We have access to a remote cluster where depending on the queue the jobs are sent and the availability of computing resources, MATLAB may start in singleCompThread mode, and it would be great if we could tell this from within MATLAB.

推荐答案

目前,您可以使用maxNumCompThreads,尽管它警告说它将在将来的版本中删除.在singleCompThread模式下,它将返回1.(至少在测试它的Windows上).

For now, you can use maxNumCompThreads, though it warns it will be removed in a future release. In singleCompThread mode, it will return 1. (At least on Windows, where I tested it.)

这篇关于检查MATLAB是否在多线程模式下运行的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆