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 10:00:50 -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.

As I explained in the other reply, returning the count does not work beyond 255 jobs, so as long as this is clear to the user, one or the other works. If GNU parallel returns the count of errors, the user will have to interpret the exit code differently if the job count exceeds 255.

And what should then be the exit
code if no jobs were run? (e.g. parallel -r exit ::: '')

I have no idea about this scenario.


--halt now,success=1 == --halt -2

The same argument as above.

The same answer as above. :-)

Thanks,
Martin




reply via email to

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