bug-parallel
[Top][All Lists]
Advanced

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

Re: GNU Parallel Bug Reports Timeout


From: Andreas Bernauer
Subject: Re: GNU Parallel Bug Reports Timeout
Date: Fri, 11 Sep 2015 06:32:20 +0200
User-agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10.10; rv:38.0) Gecko/20100101 Thunderbird/38.2.0


On 11/09/15 1:14, Benjamin Johnson wrote:
> On Thu, Sep 10, 2015 at 2:05 AM, Andreas Bernauer
> <address@hidden <mailto:address@hidden>> wrote:
>     On 10/09/15 1:01, Benjamin Johnson wrote:
>     > It appears that the --timeout option terminates all processes at the
>     > specified time. Is it possible to set a time limit for each individual
>     > process?
>     What do you try to achieve?
>     Usually, you don't know which processes will be started...
> I am trying to run several processes (more than the number of cores) in
> parallel and I would like to set a timeout for each of them
> individually. Currently, parallel exists upon reaching the timeout even
> if all processes have not run for that amount of time (the processes
> that do not start initially because all of the cores are currently in use).
> 

The man page reads as if parallel is doing exactly this:

      --timeout val
                Time out for command. If the command runs for longer
than val
                seconds it will get killed with SIGTERM, followed by SIGTERM
                200 ms later, followed by SIGKILL 200 ms later.

I read it as 'timeout per command'.  A quick test gives me what I'd expect:

$ time gseq 10|parallel -j1 --timeout 1 'echo starting; gsleep 0.1; echo
done'
starting
done 1
starting
done 2
starting
done 3
starting
done 4
starting
done 5
starting
done 6
starting
done 7
starting
done 8
starting
done 9
starting
done 10
gseq 10  0.01s user 0.01s system 54% cpu 0.023 total
parallel -j1 --timeout 1 'echo starting; gsleep 0.1; echo done'  0.76s
user 0.45s system 49% cpu 2.439 total

Total running time is >1s (namely 2.439s), but timeout is 1s, and each
process takes <1s.

Maybe you've (re)discovered a bug in your old 20130922 version of
parallel? Can you upgrade to a recent version and try again?

-Andreas



reply via email to

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