parallel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Which exit code should --halt give?


From: Martin d'Anjou
Subject: Re: Which exit code should --halt give?
Date: Sun, 03 May 2015 13:54:15 -0400
User-agent: Mozilla/5.0 (X11; Linux x86_64; rv:31.0) Gecko/20100101 Thunderbird/31.6.0

On 15-05-02 06:37 AM, Ole Tange wrote:
On Sat, May 2, 2015 at 12:26 PM, Ole Tange <ole@tange.dk> 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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]