HackCode
HackCode

Reputation: 1857

How to run multiple composed commands (with multiple arguments) in gnu parallel?

I want to run the following scripts with different input arguments using GNU Parallel in parallel:

Rscript svmRScript_v2.copy.r 0.1 1 #(1) 0.1 and 1 are the input arguments
Rscript svmRScript_v2.copy.r 0.1 2 #(2)
Rscript svmRScript_v2.copy.r 0.1 5 #(3)
Rscript svmRScript_v2.copy.r 0.1 10 #(4)

So all I wanna do is run the 'commands' (1),(2),(3),(4) in parallel using GNU parallel.

My best guess was something like

parallel Rscript < svmRScript_v2.copy.r ::: 0.1 1 ::: 0.1 2 ::: 0.1 5 ::: 0.1 10

I know this is entirely wrong and I'm getting the following error: Fatal error: cannot open file ':::': No such file or directory.

Any suggestion what I need to change?

Thanks in advance.

Upvotes: 1

Views: 2768

Answers (1)

Ole Tange
Ole Tange

Reputation: 33748

The obvious is:

parallel Rscript svmRScript_v2.copy.r 0.1 ::: 1 2 5 10

But I have the feeling you might want 0.1 and 0.2 later:

parallel Rscript svmRScript_v2.copy.r ::: 0.1 0.2 ::: 1 2 5 10

If the order of the arguments is wrong:

parallel Rscript svmRScript_v2.copy.r {2} {1} ::: 0.1 0.2 ::: 1 2 5 10

Did you have a chance to watch the intro videos and walk through the tutorial?

Upvotes: 1

Related Questions