parallel
[Top][All Lists]
Advanced

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

Splitting input into jobs


From: Fredrick Brennan
Subject: Splitting input into jobs
Date: Fri, 02 Apr 2021 18:35:07 -0400

Hello!


I'm sorry if this is explained somwhere, I'm having trouble figuring out what to search for.


In the normal operation of GNU Parallel, it is the case that you will run one instance for line of input.


This is fine for most applications, but some applications take a long time to spin up and spin down. A practical example of such an application is Inkscape.


I use GNU Parallel to make my fonts. To make glyphs for of my fonts, I need to run this command:


inkscape --batch-process --actions "select-all:all;verb:StrokeToPath;select-all;verb:SelectionUnion;export-plain-svg;" --export-overwrite build/SVG_layers/*


This creates SVG files which have their strokes represented as fills (paths). Strokes aren't supported in the OpenType font format, that's why.


If I were to do:


find build/SVG_layers/* -iname '*.svg' | parallel --bar inkscape --batch-process --actions "select-all:all;verb:StrokeToPath;select-all;verb:SelectionUnion;export-plain-svg;" --export-overwrite build/SVG_layers/*


Then unfortunately an Inkscape instance would be spun up for each SVG. Inkscape takes a long time to stop and start, so this is not ideal.


I would prefer rather that I get one Inkscape for each core of my CPU (hereon 𝑛) and it receives 1/𝑛 of the jobs as its last argument.


How can I tell Parallel to batch in this manner?


Best,

Fred Brennan


reply via email to

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