I am running some CFD-simulations on a PBS based cluster. I will run a large number of cases, and therefore want to do the pre-processing on the cluster nodes. I need to do two steps, first meshing, and when the meshing is finished, I want to run the mesh partitioning routine. To avoid manual work i would like to program this in a pbs jobscript.
I can run the meshing of all cases in parallel by running the following:
#!/usr/bin/env bash
#PBS -q regular
#PBS -l nodes=1:ppn=8
#PBS -N prep_tst_2
#PBS -l walltime=6:00:00
cd $PBS_O_WORKDIR
hexp -batch -project tst_1.igg &
hexp -batch -project tst_2.igg &
hexp -batch -project tst_3.igg &
hexp -batch -project tst_4.igg &
hexp -batch -project tst_5.igg &
hexp -batch -project tst_6.igg &
hexp -batch -project tst_7.igg &
hexp -batch -project tst_8.igg &
#End of script
Where hexp is the meshing program!
I can also run a meshing task followed by the partitioning by running:
hexp -batch -project tst_1.igg ; partit -batch -project tst_1.igg
But how can I combine the two? I want to run 8 instances of the last command in paralell, so that as the meshing of tst_1.igg is finished it continues with partitioning of tst_1.igg regardless of the status of the other instances.
Best regards, Adam