Is there a supported alternative to feature('numCores') to get the number of cores available for a parallel solution
4 views (last 30 days)
I have an application that is compiled and distributed among a number of my office colleagues. Now we are trying to also set it up on a virtual machine to be accessed remotely by some other companies. During initialization the application is supposed to determine the number of cores available on the host machine using the undocumented command
avail_CPUs = feature('numCores');
The user can choose how many of the available cores they can use for the solution since the parfor will only run if they choose more than one.
When I tested the compiled on the virtual machine it gave me an error message. I can probably get around the problem by simply putting in a try - catch around this command. But it worries me to become dependent on undocumented commands. Is there an alternative? Also does a virtual machine by default only have one core?