bugGNU Parallel - Bugs: bug #65994, Do not buffer first job when using...

 
 

bug #65994: Do not buffer first job when using -k

Submitter:  Ole Tange <tange>
Submitted:  Tue 16 Jul 2024 02:28:46 AM UTC
   
 
Category:  None Severity:  1 - Wish
Item Group:  None Status:  In Progress
Privacy:  Public Assigned to:  tange
Open/Closed:  Open
* Mandatory Fields

Add a New Comment Rich Markup
   

Tue 16 Jul 2024 02:54:32 AM UTC, comment #1: 

I think it will cause to much confusion.

The workaround is documented in man parallel_examples

Ole Tange <tange>
Group administrator
Tue 16 Jul 2024 02:28:46 AM UTC, original submission:  

https://lists.gnu.org/archive/html/bug-parallel/2024-06/msg00000.html

It should be possible to run the very first job with -u, with the following jobs buffered.

It gives the benefit of --lb but without the CPU penalty for the first job.

It will not be possible to do -u for the next jobs, but for the very first, it ought to be possible.

Challenges:

Does this live up to POLA?

The first job will act differently from the rest:

    doit() {
      echo "$@" stderr >&2
      echo "$@" stdout
      sleep 0.$1
      echo "$@" stderr >&2
      echo "$@" stdout
    }
    export -f doit
    # Order is different due to buffering
    parallel -u doit ::: 1
    parallel doit ::: 1

The first job will have a tty, but the next ones will not.

A workaround might be:

    parallel -k -u doit {= 'seq() > 1 and $opt::ungroup = 0' =} ::: 9 1 2 3

Ole Tange <tange>
Group administrator

 

(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 (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.

     

    Follows 1 latest change.

    Date Changed by Updated Field Previous Value => Replaced by
    2024-07-16 tange StatusNone In Progress

    Back to the top

    Powered by Savane 3.13-8ccc.
    Corresponding source code