Start refactoring of resources manipulation to use the resources-util
facilities. Incomplete, broken. Checkpoint.
Fleshed out most of the resource-management stuff. Incomplete, especially,
wrt serial tests. Works in simplest cases.
Mostly finished implementation, provided an approach for using the serial
switch, reviewed and updated command-line options, removed the trace
messages. Runs in simple cases, both serial and parallel, but has not been
properly tested yet.
Minor bug-fix: now can terminate parallel runs by Ctrl-C.
Mark all functions as 'export -f', they are indended to be used from
multiple processes.
Provide a function for converting various storage units to bytes.
Remove trace messages, allow no space between value and units (like 1TB).
Provide a test. It passes manually (output identical to expected) but not
under comma-test-match (because of quoting issues). To be fixed separately.
For the scripts intended for being source-d, export -f all functions.
Sort out bytes vs. MB conversions (but now have to update all config files).
Minor bug-fix: set the resource request to maximal when the original request
exceeds _or_ equals to the maximum. E.g., if the resource is "serial" (which
can take values of only 0 and 1), a request of "serial=1" means allocating
all the available resources.
Minor: put waiting for the resources (with random sleep) into a function of
its own. Also, change the wait time to become fractional seconds (as opposed
to whole seconds) and shorten it a bit. There may be some remaining bugs,
but the core of the functionality (parallel runs with '--parallel', serial
runs without any options, killing by Ctrl-C, etc.) is working with the new
resource-management functions.
Remove an old, commented out piece of code: if it merits preservation it
shall be put into a separate version-controlled script and not pollute the
general-purpose comma-test-run.
Minor: an auxiliary function renamed.
Bug-fix: typo in the pid to wait for.
Use a safer default of 1 hour for the maximal run time of a test.