Why does Amazon report double the core count for Amazon Machine instance types when compared to MathWorks products?

1 view (last 30 days)
Amazon reports double the core count for various machine instances than what MathWorks reports for the same machine instances, why is there a discrepancy?

Accepted Answer

MathWorks Support Team
MathWorks Support Team on 25 Mar 2019
Edited: MathWorks Support Team on 25 Mar 2019
The core count reported by Amazon for their various machine instances includes the virtual core count for the processor being used. MATLAB and MATLAB Parallel Server do not utilize virtual cores and only utilizes physical cores. Since MATLAB and MATLAB Parallel Server do not utilize the virtual cores, MathWorks reports the number of physical cores for each Amazon Machine instance because that is what is relevant when using MATLAB or MATLAB Parallel Server.
In order to get a system that has 4 or 8 actual cores, you would need to use an AMI that is reporting double the number of cores as your target. Once you have the AMI online, You can execute this command on the MATLAB Command prompt:
>>!WMIC CPU Get /Format:List
The “!” operator can be used to run Windows system commands from the command line. This will fetch a list of windows properties, and these are the two that are of concern. For example, on a test system:
NumberOfCores=4
NumberOfLogicalProcessors=8
You can get the number of processors (from an environment variable):
getenv('NUMBER_OF_PROCESSORS')
This will give you the number of processors, which is the sum of real and virtual cores. You can double check this by right clicking on Computer>Properties>Advanced System Settings. Click on ‘Environment Variables’ and you can see the value for NUMBER_ OF_PROCESSORS. For example, if your system has 4 cores, and the output of the command is 8, it means there are 4 additional virtual cores. You can also see this by opening the task manager, and clicking on the ‘Performance’ tab. This will show you all the cores, real and virtual.
The performance is better if you use 4 physical cores instead of 8 cores out of which 4 are virtual cores.
The following steps will help you open 8 workers in MATLAB.
1) Go to Parallel Computing Options-> Manage Cluster Profiles-> local
Click on Edit and change the value of ‘Number of workers to start on your local machine’ to 8
2) Type the following command in the MATLAB command window
>>parpool(8)
Just keep in mind that this would run two jobs on each core, and is not necessarily better then utilizing 4 cores. * NOTE: Starting in R2019a the following name changes occurred: * MATLAB Distributed Computing Server was renamed to MATLAB Parallel Server * mdce_def was renamed to mjs_def * mdce binary was renamed to mjs

More Answers (0)

Categories

Find more on Startup and Shutdown in Help Center and File Exchange

Tags

No tags entered yet.

Community Treasure Hunt

Find the treasures in MATLAB Central and discover how the community can help you!

Start Hunting!