Conventions

12.3.1 PBS Resource Manager Extensions

Resource manager extensions within PBS are used by setting the -W flag. To enable this flag, some versions of PBS must be rebuilt. TORQUE and recent OSCAR distributions come with the flag enabled by default. Most other versions do not. The required steps are documented in what follows:

  1. Shut down the PBS server.
  2. > qterm -t quick  
    #shutdown PBS server
  3. cd to the directory from which you executed the PBS 'configure' at install time
  4. > make distclean 
    > ./configure <WITH OPTIONS>
  5. Create addparam script
        (chmod +x addparam)
  6. > addparam x
    > make

    Backup current $PBS_HOMEDIR directory contents

    $PBS_HOMEDIR defaults to /usr/spool/PBS.

    > make install
  7. Restore old $PBS_HOMEDIR directory contents
  8. > pbs_server    # restart PBS server

A job's QoS level can then be specified using the qsub -W flag. For example, qsub -W x=iQOS:hi -l nodes=4 ...

#!/bin/sh
#script:  addparam
#usage:   addparam $Parameter  [S|L]
NewParameter=$1
ParameterType=x$2
if [ ! -d src/include ];  then
  echo "error: `basename $0` src/include doesn't exist, run configure"
1>&2
  exit 1
fi
#   run make in this directory to pull over the template files
cd src/include
if make
then
  if grep -q "\"$NewParameter\"" site_*.h 2>/dev/null;  then
    echo "parameter $NewParameter previously added"
    exit 0
  fi
fi
chmod +w site_job_attr_enum.h
echo "
  JOB_SITE_ATR_$1,
" >> site_job_attr_enum.h
chmod +w site_job_attr_def.h
if [ $ParameterType = "xS" ]
then
  echo "
    {   \"$NewParameter\",
        decode_str,
        encode_str,
        set_str,
        comp_str,
        free_str,
        NULL_FUNC,
        READ_WRITE,
        ATR_TYPE_STR,
        PARENT_TYPE_JOB
    },
  " >> site_job_attr_def.h
else
  echo "
    {   \"$NewParameter\",
        decode_l,
        encode_l,
        set_l,
        comp_l,
        free_null,
        NULL_FUNC,
        READ_WRITE,
        ATR_TYPE_LONG,
        PARENT_TYPE_JOB
    },
  " >> site_job_attr_def.h
fi
exit 0