0

Right now I am doing the following on a cluster:

(i) qsub-X -I -l walltime=60:00:00,nodes=1:ppn=8

(ii) submitting myjob (using ./myjob) which has the following contents

#!/bin/bash
i=1
nohup ./a.out $i 2 42 &
nohup ./a.out $i 43 60 &
nohup ./a.out $i 61 74 &
nohup ./a.out $i 75 85 &
i=-1
nohup ./a.out $i 2 42 &
nohup ./a.out $i 43 60 &
nohup ./a.out $i 61 74 &
nohup ./a.out $i 75 85 &

(iii) After submitting this I open a new connection, qsub using (i), edit myjob file, i.e., change i from {1,-1} to {2,-2}, and submit ./myjob.

I repeat this from i=1,-1 to i=20,-20.

Isn't there a way to automatise this? I have spent a day (actually more than a day) trying to get this work using job arrays, for loops, etc. There should be a quick way to ask for 160 processors and submit this job, or have we, humans, not yet advanced to that stage in computing?

Any help is highly, super-highly appreciated.

PS - Yes, I am aware of the fact that I am not a computer wizard, please pardon my ignorance.

1 Answers1

0

This looks like torque so a script like the following should do what you want. Based on the assumption that your scheduler is configured to allocate nodes to jobs exclusively and you want to use all cores on an 8 core node.

#!/bin/bash
#PBS -l walltime=60:0:0
#PBS -t 1-8
#PBS -l nodes=1:ppn=8
i=${PBS_ARRAYID}
nohup ./a.out $i 2 42 &
nohup ./a.out $i 43 60 &
nohup ./a.out $i 61 74 &
nohup ./a.out $i 75 85 &
i=-${PBS_ARRAYID}
nohup ./a.out $i 2 42 &
nohup ./a.out $i 43 60 &
nohup ./a.out $i 61 74 &
nohup ./a.out $i 75 85 &
wait
William Hay
  • 2,148
  • 16
  • 20