parallel
[Top][All Lists]
Advanced

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

Re: Parallel a script


From: Ole Tange
Subject: Re: Parallel a script
Date: Sat, 25 Jun 2011 08:59:39 +0200

On Fri, Jun 24, 2011 at 5:36 PM, yacob sen <yacob_123@yahoo.com> wrote:
>
> Dear Ole
> Thank you for your answer. I figured out that. Two input two files I use the 
> -N option as
> parallel  -N3  prog -i {1} -type {2}  ::::  name_list   date_list

That seems odd. I would think that would not work, as I cannot think
of a single case where -N makes sense with multiple inputfiles.

Also be aware that the multiple input files functionality was changed
in 20020522. So if your version is older, you may get unexpected
results with newer version (in newer versions just use --xapply to get
the old behaviour).

> The program runs but I could not able to control the outputs. The "prog" 
> program does output to the directory I run and it means that only the last 
> result of the last run is saved . How can I control that ?

If you can control the output name:

parallel prog -i {1} -type {2} --output {1}_{2}.out

If it outputs to stdout:

parallel prog -i {1} -type {2} \> {1}_{2}.out

If it always saved to the same file, the only solution I can think of
is to create a uniquely named dir, 'cd' to that, run the program, move
the result to the main dir, and remove the tempdir:

parallel 'mkdir {1}_{2}.dir; cd {1}_{2}.dir; prog -i ../{1} -type {2};
mv file.out ../{1}_{2}.out; cd ..; rmdir {1}_{2}.dir'

Did you watch the intro videos?

http://www.youtube.com/watch?v=OpaiGYxkSuQ
http://www.youtube.com/watch?v=P40akGWJ_gY
http://www.youtube.com/watch?v=1ntxT-47VPA
http://www.youtube.com/watch?v=fOX1EyHkQwc

/Ole



reply via email to

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