On 15-05-02 06:37 AM, Ole Tange wrote:
On Sat, May 2, 2015 at 12:26 PM, Ole Tange <[email protected]> wrote:
--halt soon,success=1 == --halt -1
It will be useful to distinguish between halting because a job
succeeded (e.g. a solution was found) or because there are no more
jobs (e.g. no solution was found). So I think these should give
different exit codes:
parallel --halt soon,success=1 exit ::: 0 1; echo $?
This should return 0 because the expectation (at least one success) was met.
parallel --halt soon,success=1 exit ::: 1 1; echo $?
This should return 1 because the expectation was not met.
But I am less sure what the exit code should represent if there are no
successes. It could be the number of failing jobs or the exit code of
the first/last failing job if any.
The number of failing jobs has to be interpreted by the user when the
number of jobs exceeds 255. GNU Parallel should not return 0 in this
case when there is an error.
And what should then be the exit
code if no jobs were run? (e.g. parallel -r exit ::: '')
I do not know.
--halt now,success=1 == --halt -2
The same argument as above.
IMO this should return 0 when at least one job succeeds. The user has
set that expectation.
Martin