bugGNU Parallel - Bugs: bug #37780, Add option to sort input sources...

 
 

bug #37780: Add option to sort input sources by header when using --results

Submitter:  Drew Frank <drewfrank>
Submitted:  Tue 20 Nov 2012 07:44:28 AM UTC
   
 
Category:  None Severity:  1 - Wish
Item Group:  None Status:  Wont Fix
Privacy:  Public Assigned to:  None
Open/Closed:  Closed
* Mandatory Fields

Add a New Comment Rich Markup
   

Mon 26 Nov 2012 08:42:07 PM UTC, comment #3: 

No option added. Sorting implemented in [d47e130]

Ole Tange <tange>
Group administrator
Mon 26 Nov 2012 07:03:41 AM UTC, comment #2: 

Sounds reasonable to me.

Drew Frank <drewfrank>
Group Member
Sun 25 Nov 2012 11:28:32 PM UTC, comment #1: 

--result is very special. I do not see any reason why we cannot just sort the arguments every time.

It should be sorted numerically first and asciibetically next:

sort { $a <=> $b or $a cmp $b } @headers

This way no headers (i.e. using 1 .. n as headers) will work as they do now.



Ole Tange <tange>
Group administrator
Tue 20 Nov 2012 07:44:28 AM UTC, original submission:  

This report is related to #37779.

When called with both --header and --results, parallel stores job outputs in result files named according to the their corresponding input values. For example:

   ./parallel --results foo_ --header : myprog -b {b} -a {a} ::: b 2 ::: a 1

generates the result file:

   foo_stdout?b?2?a?1

This example illustrates a fairly vanilla use of the --results option: calling a program with various combinations of command line options. Since many programs are insensitive to the order of their options, it would be nice to be able to tell parallel to generate the same result file name for each of these two commands*:

   myprog -b {b} -a {a}
   myprog -a {a} -b {b}

A natural choice would be to add an option (e.g., --sort-args) that would sort the arguments according to their header values prior to generating the result file name. If --header was not specified, --sort-args would have no effect.

Personally, I would find this useful because I sometimes rerun commands with the same command line options and expect the output to overwrite the previous result files. Under current behavior, I have to be careful to specify the arguments/input sources in the same order, otherwise I end up with multiple, differing result files containing the same information (relative to my program) in their file names.

  • Note: under current behavior, it is the order of the input sources rather than the substitution strings in the command that determines the output file name (see #37779).
Drew Frank <drewfrank>
Group Member

 

(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 tange (Posted a comment)
  • -email is unavailable- added by drewfrank (Submitted the item)
  •  

    There are 0 votes 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
    2012-11-26 tange Severity3 - Normal 1 - Wish
        StatusNone Wont Fix
        Open/ClosedOpen Closed

    Back to the top

    Powered by Savane 3.13-f8d8.
    Corresponding source code