[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Job slot number {%} working yet?
From: |
Jamshid Afshar |
Subject: |
Job slot number {%} working yet? |
Date: |
Wed, 10 Sep 2014 21:18:07 -0500 |
Hi, I'm trying to use the job slot number "{%}" in order to run a
command on a pool of servers. I believe I am using the latest alpha
build (on OSX, "brew install parallel"):
$ sem --version
GNU parallel 20140822
Running all these 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.
Am I doing something wrong or is this alpha feature not working yet? I
also tried $PARALLEL_JOBSLOT (https://savannah.gnu.org/bugs/?42041)
but nothing was output.
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
===================
Third started 1, pretend to run on server 1
Fourth started 1, pretend to run on server 1
Fifth started 1, pretend to run on server 1
The third finished
Second started 1, pretend to run on server 1
The fourth finished
First started: 1, pretend to run on server 1
The fifth finished
The first finished
The second finished
===================
Thanks,
Jamshid
- Job slot number {%} working yet?,
Jamshid Afshar <=