bugGNU Parallel - Bugs: bug #33005, $PARALLEL_SEQ not expanded on...

 
 

bug #33005: $PARALLEL_SEQ not expanded on --dry-run

Submitter:  Jay Hacker <jayqhacker>
Submitted:  Tue 05 Apr 2011 09:30:05 PM UTC
Votes: 1
 
Category:  None Severity:  1 - Wish
Item Group:  None Status:  None
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 11 Apr 2011 05:35:28 PM UTC, comment #5: 

I would argue that most enumerations of N things in computing range from 0...N-1.  As a programmer, certainly almost all programming languages have zero-based arrays; if you wanted to keep track of the status of N things in Bash or any other language, you'd have an array from 0...N-1.  Most unix tools that produce multiple output files start with zero, such as csplit, split -d, ImageMagick, pamsplit.  Hadoop outputs are numbered from 0...N-1.  If you are trying to batch numbered things into buckets, it's easier to use integer division or remainder when starting with zero.  Most clusters have machine names of the form node00...nodeXX.  In fact I'd argue that processing things of the form item000...itemNNN is so common that there should be an option to count up the number of jobs ahead of time and pad {#} with leading zeros, and I'd give serious consideration to making that the default behavior for {#}.

Jay Hacker <jayqhacker>
Sat 09 Apr 2011 11:31:06 PM UTC, comment #4: 

{#} implemented in [7b4f74787]

Ole Tange <tange>
Group administrator
Wed 06 Apr 2011 10:03:34 PM UTC, comment #3: 

As I as a user would expect it to count from 1 you need to provide arguments to convince me why it should start from 0.

Ole Tange <tange>
Group administrator
Wed 06 Apr 2011 09:30:21 PM UTC, comment #2: 

I think {#} is a fantastic idea.  And while we're at it, can we make it start at 0 instead of 1?  :)

Jay Hacker <jayqhacker>
Wed 06 Apr 2011 10:16:33 AM UTC, comment #1: 

As $PARALLEL_SEQ is an environment variable it will be replaced by the shell. It is never replaced by GNU Parallel.

If we need this then maybe we should implement {#} which would do the same but would be replaced by GNY Parallel.

Ole Tange <tange>
Group administrator
Tue 05 Apr 2011 09:30:05 PM UTC, original submission:  

$ parallel -V
GNU parallel 20110322

$ seq 0 3 | parallel echo {} \$PARALLEL_SEQ

  1. 1

1 2
2 3
3 4

$ seq 0 3 | parallel --dry-run echo {} \$PARALLEL_SEQ
echo 0 $PARALLEL_SEQ
echo 1 $PARALLEL_SEQ
echo 2 $PARALLEL_SEQ
echo 3 $PARALLEL_SEQ

Jay Hacker <jayqhacker>

 

(Note: upload size limit is set to 16384 kB, after insertion of the required escape characters.)

Attach Files:
   
   
Comment:
   

No files currently attached

 

Depends on the following items: None found

Items that depend on this one: None found

 

Carbon-Copy List
  • -email is unavailable- added by jayqhacker (Voted in favor of this item)
  • -email is unavailable- added by tange (Posted a comment)
  • -email is unavailable- added by jayqhacker (Submitted the item)
  •  

    There is 1 vote so far. Votes easily highlight which items people would like to see resolved in priority, independently of the priority of the item set by tracker managers.

    Only logged-in users can vote.

     

    Follow 3 latest changes.

    Date Changed by Updated Field Previous Value => Replaced by
    2011-04-09 tange Open/ClosedOpen Closed
    2011-04-06 jayqhacker Carbon-Copy- Added jayqhacker
    2011-04-06 tange Severity3 - Normal 1 - Wish

    Back to the top

    Powered by Savane 3.13-3230.
    Corresponding source code