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