How can you submit CFX jobs to a PBS queue?



The basic idea for running any software under many of the batch queuing systems is quite similar. You have to submit a script to the batch system and there is header information in the script that tells the queuing system how you want the job to be run. The queuing system will then store a list of available processors in an environment variable. You then have to extract the names of the processors from the environment variable and submit CFX to those processors.

The header information for PBS is set using #PBS markers at the start of the line. Please refer to a PBS manual for details of the available options for setting header information. The allocated nodes are stored in the environment variable $PBS_NODEFILE.

The cfx5solve command is told what processors to run on, using either the -par-host-list or -par-dist options. Either of these options expect a comma separated list of machine names. Please refer to the CFX online manual (or type cfx5solve -help at the command prompt) for information on arguments to cfx5solve.

Below is a relatively simple example script with the name of the def file being hard coded in the script, but it is sufficient to demonstrate the mechanics of how to submit CFX to a PBS batch queuing system.

Note that there is nothing stopping you from ignoring the names in $PBS_NODEFILE and submitting to some completely different nodes. The batch queuing system does not allocate processors for you it merely offers you suggestions as to which processors are currently free. You are free to ignore these suggestions but then you run the risk of running on processors that are already in use.

Example PBS Script:

#! /bin/sh

#PBS -l nodes=2
#PBS -j oe
#PBS -V

#
# echo some parameters
#
echo " "
echo "hostname = `hostname`"
echo "PBS_NODEFILE = $PBS_NODEFILE"
echo "PBS_JOBID = $PBS_JOBID"
echo "PBS_O_WORKDIR = $PBS_O_WORKDIR"

#
# extract the nodes from the nodelist file
#
echo " "
echo "Allocated node list:"
echo "-------------------"
nodes=0
par_host_list=""
seperator=""
for node in `cat $PBS_NODEFILE`
do
echo "node = $node"
par_host_list="${par_host_list}${seperator}`echo -n $node`"
seperator=","
((nodes=$nodes+1))
done
echo "-------------------"
echo "number of nodes = $nodes"
echo "par-host-list = $par_host_list"


#
# run the cfx job
#
parallel="-par -part $nodes -par-host-list $par_host_list"
cd $PBS_O_WORKDIR
cfx5solve -def demo.def $parallel





Show Form
No comments yet. Be the first to add a comment!