This line in the test script makes use of the -P option for xargs in order to allow multiple tests to run in parallel. However, $processors is not defined anywhere in the script. As a result a blank argument is passed to the option which appears to be interpreted as a 1, resulting in all tests being run sequentially on a single processor on my machine (I checked the activity monitor while running the tests and discovered that I was only experiencing about 25% usage on a machine with 4 addressable cores).
I propose that we define $processors (renamed to $NPROCESSORS) using the number of addressable processors as a default but allow a setting in gregorio-test.rc to override (in case the user wants to set a lower limit).
On a Mac one can obtain the number of processors with sysctl -n hw.ncpu. On Linux the appropriate command appears to be nproc. This means defining this script will need to identify the host system and use the appropriate command when defining the default.
This line in the test script makes use of the
-P
option forxargs
in order to allow multiple tests to run in parallel. However,$processors
is not defined anywhere in the script. As a result a blank argument is passed to the option which appears to be interpreted as a 1, resulting in all tests being run sequentially on a single processor on my machine (I checked the activity monitor while running the tests and discovered that I was only experiencing about 25% usage on a machine with 4 addressable cores).I propose that we define
$processors
(renamed to$NPROCESSORS
) using the number of addressable processors as a default but allow a setting ingregorio-test.rc
to override (in case the user wants to set a lower limit).On a Mac one can obtain the number of processors with
sysctl -n hw.ncpu
. On Linux the appropriate command appears to benproc
. This means defining this script will need to identify the host system and use the appropriate command when defining the default.Objections? Comments?