Versions Compared


  • This line was added.
  • This line was removed.
  • Formatting was changed.


labelMultiple 1-CPU Jobs

There are several legitimate reasons for wanting to run multiple single processor jobs in parallel within a single PBS script. For example, you may want to run 8 MATLAB jobs which require a toolbox that only has 4 licensed users. Only 1 MATLAB license is checked out if all 8 jobs are run on the same system. An example PBS script to do this task would look like

No Format

#PBS -c s
#PBS -j oe
#PBS -m ae
#PBS -N jobname
#PBS -l walltime=999:00:00
#PBS -l nodes=1:ppn=8

echo "------------------------------------------------------"
echo " This job is allocated 8 cpus on "
echo "------------------------------------------------------"
echo "PBS: Submitted to $PBS_QUEUE@$PBS_O_HOST"
echo "PBS: Working directory is $PBS_O_WORKDIR"
echo "PBS: Job identifier is $PBS_JOBID"
echo "PBS: Job name is $PBS_JOBNAME"
echo "------------------------------------------------------"

source /etc/profile.d/
module load matlab
matlab -r myjob1.m &
matlab -r myjob2.m &
matlab -r myjob3.m &
matlab -r myjob4.m &
matlab -r myjob5.m &
matlab -r myjob6.m &
matlab -r myjob7.m &
matlab -r myjob8.m &
wait    # Wait for background jobs to finish.

To submit the job for execution on a HPRC compute node simply enter the command:

No Format
qsub pbsjob

Note: The echo commands in the PBS script example above are informational only.

Multiple 1-CPU Jobs
Multiple 1-CPU Jobs