问题
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.
回答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.
来源:https://stackoverflow.com/questions/18948727/naive-parallelization-in-a-pbs-file