bug-parallel
[Top][All Lists]
Advanced

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

Re: GNU Parallel Bug Reports Job slot number {%}


From: Jamshid Afshar
Subject: Re: GNU Parallel Bug Reports Job slot number {%}
Date: Tue, 9 Aug 2016 22:07:55 -0500

Finally submitted a bug for this issue with the job slot number not
being unique "{%}":

https://savannah.gnu.org/bugs/?48743

I'm probably misunderstanding your suggestion, but it doesn't seem to
work when using two sets of arguments:

parallel -j3 -u 'echo Job {} started: {#}, pretend to run on server
{%};sleep {= $_+=4 =};echo Job {} finished' ::: {1..5} ::: x y z

Job 1 x started: 1, pretend to run on server 1
Job 1 y started: 1, pretend to run on server 1
Job 1 z started: 1, pretend to run on server 1
...

Thanks,
Jamshid

On Wed, Sep 24, 2014 at 10:22 AM, Ole Tange <address@hidden> wrote:
> On Tue, Sep 23, 2014 at 6:01 AM, Jamshid Afshar <address@hidden> wrote:
>> Hi, I'm trying to use the job slot number "{%}" in order to run a
>> command on a pool of servers.
> :
>> Running all the below commands at the same time seems to work as
>> expected -- only three jobs run at a time, but "{%}" is always "1".
>>
>> I'd expect it to cycle 1-3.
>>
>> If there's a way of accomplish this with some simple scripting, please
>> let me know, I'm not getting it. Thanks.
>
> Change your script so you do not use sem but use parallel without --semaphore.
>
>> sem --fg --jobs 3 --id my_id -u 'echo First started: $PARALLEL_SEQ,
>> pretend to run on server {%} ; sleep 5; echo The first finished' &
>> sem --fg --jobs 3 --id my_id -u 'echo Second started $PARALLEL_SEQ,
>> pretend to run on server {%} ;  sleep 6; echo The second finished' &
>> sem --fg --jobs 3 --id my_id -u 'echo Third started $PARALLEL_SEQ,
>> pretend to run on server {%} ;  sleep 7; echo The third finished' &
>> sem --fg --jobs 3 --id my_id -u 'echo Fourth started $PARALLEL_SEQ,
>> pretend to run on server {%} ; sleep 8; echo The fourth finished' &
>> sem --fg --jobs 3 --id my_id -u 'echo Fifth started $PARALLEL_SEQ,
>> pretend to run on server {%} ; sleep 9; echo The fifth finished' &
>> sem --fg --wait --id my_id
>
> This could be written as:
>
>     parallel -j3 -u 'echo Job {} started: {#}, pretend to run on
> server {%};sleep {= $_+=4 =};echo Job {} finished' ::: {1..5}
>
> /Ole



reply via email to

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