parallel
[Top][All Lists]
Advanced

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

Re: GNU Parallel – need a small advice


From: Ole Tange
Subject: Re: GNU Parallel – need a small advice
Date: Mon, 15 Apr 2013 23:47:14 +0200

Hi Jakob.

Please use parallel@gnu.org for support (unless you want to hire me).

It seems you have three tables you want to multiply:

512x512 squared 57x57+35x35+398x398 57x57+512x512 0.7775
1280x960 4x3 107x107+67x67+1065x745 106x75+1280x960 1.667

fancy
simple
flat
glossy

??.svg

Multiplying the last two is very easy:

parallel echo {1} {2} ::: fancy simple flat glossy ::: ??.svg

Multiplying with the first table is a bit trickier because you want
several different values linked together (i.e. 512x512 always has to
go with 'squared').

The simple way to muliply that with the first table is simply to do it twice:

parallel echo 512x512 squared 57x57+35x35+398x398 57x57+512x512 0.7775
{1} {2}  ::: fancy simple flat glossy ::: ??.svg

parallel echo 1280x960 4x3 107x107+67x67+1065x745 106x75+1280x960
1.667 {1} {2}  ::: fancy simple flat glossy ::: ??.svg

If the first table had more than two rows, we would probably need to
pipe parallel to parallel to parallel:

cat table1 | parallel --colsep ' ' echo build {1} {2} {3} {4} {5} |
parallel echo  build {1} {2} {3} ::: fancy simple flat glossy :::
??.svg | parallel

or closer to the real stuff:

(echo 512x512 squared 57x57+35x35+398x398 57x57+512x512 0.7775; echo
1280x960 4x3 107x107+67x67+1065x745 106x75+1280x960 1.667) |
  parallel --colsep ' ' echo scripts/build.pl --cmd svg2svg --res {1}
--back back.png --fore fore.png --svgs svg/country-{2} --mask {3}
--geo {4} --geoscale {5} --out build/svg-country-{2} |
  parallel echo "{1}-{2}/ --flag {3/} --svg {3/}" :::: -  ::: fancy
simple flat glossy ::: svg/country-4x3/??.svg |
  parallel

You may want to run a pipe at a time to see how the above works.


/Ole

On Mon, Apr 15, 2013 at 9:09 PM, Jakob Flierl <jakob.flierl@gmail.com> wrote:
> Hi Ole,
>
> I need your help with GNU Parallel and my repo:
>
>   https://github.com/koppi/iso-country-flags-svg-collection
>
> There's a Makefile in the repo –
>
>   
> https://github.com/koppi/iso-country-flags-svg-collection/blob/master/Makefile
>
> – which does lot's of calls to a scripts/build.pl Perl script –
>
>   
> https://github.com/koppi/iso-country-flags-svg-collection/blob/master/scripts/build.pl
>
> A "$ make -j $NUM_CPUS" works fine here, but I want a more fancy
> solution for doing the image conversion stuff, iff GNU Parallel is
> installed.
>
> From what I've seen from your GNU Parallel vids on youtube – can you
> help me with this Makefile / Image conversion mess and make it more
> tidy?
>
> Jakob
>
> --
> http://koppi.me/



reply via email to

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