1

Is it possible to do parallelize across a for loop in a PBS file?

Below is an my attempt.pbs file. I would like to allocate 4 nodes and simultaneously allocate 16 processes per node. I have successfully done this but now I have 4 jobs and I would like to send one job to each node. (I need to do this because queuing algo will make me wait a few days for submitting 4 separate job on the cluster I'm using)

#!/bin/bash
#PBS -q normal
#PBS -l nodes=4:ppn=16:native
#PBS -l walltime=10:00:00
#PBS -N HuMiBi000
#PBS -o HuMiBi.000.out
#PBS -e HuMiBi.000.err
#PBS -A csd399
#PBS -m abe
#PBS -V

./job1.sh
./job2.sh
./job3.sh
./job4.sh

The jobs run independently and don't use the same data. Can I run 1 job per node from the same pbs script?

Thank you.

Ben Kellman
  • 57
  • 1
  • 5

1 Answers1

1

The standard way to achieve this is through an Message Passing Interface (MPI) library. Open MPI is a fine implementation you can work with. Some basic examples can be found here and this is a tutorial for OpenMPI if you want to learn more.

dbeer
  • 6,963
  • 3
  • 31
  • 47
  • so would I say: 'mpiexec -n 16 : ./job1.sh : ./job2.sh : ./job3.sh : ./job4.sh' And would that open 16 processes per job all on different nodes? – Ben Kellman Sep 23 '13 at 21:14
  • I believe so, but to be honest I'm not an expert. I work with MPI codes but I don't write them very often. – dbeer Sep 23 '13 at 22:22