
The number of processor packages present on a machine is published through hw.packages.Īlternatives to /proc commands for memory and cpu data for OSX I'll be running some tests with alternatives and will report in this thread results with a proposed modification for OS X users. I eventually killed the terminal window with all the ongoing processes to clear things up. I was getting failed cp messages and insufficient resource warnings as well as when checking the Activity Monitor, lingering cp commands and eventually seeming zombie processes which all but disabled my macbook. I ran into resource issues fairly early in the set. When running the astout.export test of over 2000 test files with numcpu set to 4, four jobs were submitted simultaneously. I build aster with MP multiprocessing turned off. My initial testing was using the hw.physicalcpu result (number of cores - for my i7 = 4).

Note - I will provide details regarding incorporating the information from sysctl at a later date. Sysctl -n hw.model hw.machine hw.memsize hw.packages hw.physicalcpu hw.logicalcpu

***** sysctl output with format value only ******** Hw.logicalcpu: 8 (logical cores - showing cpu hyperthreading active - 2 threads/core - this seems to represent the max number of threads)
#Cpuinfo for mac 64 Bit
Hw.machine: x86_64 (32 or 64 bit machine) Sysctl hw.model hw.machine hw.memsize hw.packages hw.physicalcpu hw.logicalcpu (note - sysctl supports requesting multiple values separated by spaces - outputs one value per line in order requested) ***** sysctl output with format variable name: value ******** To obtain number of cpus/cores and memory This option is useful for setting shell variables. Using the -n option shows only variable values, not their names.

You can obtain the needed information several ways, but it appears based on my research and testing that the sysctl command is the most efficient In $ASHOME/lib/python2.7/site-packages/asrun/system.py there are calls to /proc/cpuinfo and /proc/meminfo to obtain number of cpus, threads, and system memory (in MB).
