So, I am running on a Linux cluster with lots of compute nodes to choose from. I get exclusive use of the node. Batch submissions. I am running into issues limiting the number of threads. I should mention I have a parfor loop. When I start matlab with the -singleCompThread option, it doesn't seem to work.
I submitted to a node with 2 cores, used the mentioned single thread option, and when I check on the submitted job, it starts running with 32 threads. Once it hits the parfor loop, it has over 600 threads.
I also want to run with a specific amount of multiple threads, not a single thread. So, I use the function maxNumCompThreads(32); to limit to 32 threads. I put this function at the beginning of the file, and also right inside the parfor loop. I then submit the job to a node with 32 cores. It uses way more than 32 threads.
Any guidance? I have no idea.