gregorio-project / gregorio-test

A repository of tests for Gregorio
GNU General Public License v3.0
5 stars 3 forks source link

$processors not defined #321

Closed rpspringuel closed 6 years ago

rpspringuel commented 6 years ago

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.

Objections? Comments?

rpspringuel commented 6 years ago

The change proved to be easier to implement than I thought so I've gone ahead and created the PR.