HP-UX Workload Manager Toolkits User's Guide

HP-UX WLM Duration Management Toolkit and HP-UX WLM Toolkit for Base SAS Software
How do I use DMTK / SASTK?
Chapter 6 125
if [ ! -e “$JOB_CONFIG_FILE” ]; then
echo “ERROR: $JOB_CONFIG_FILE does not exist. It must be created”
echo “before this script can be used.”
exit 1
fi
# Fill an array with the first argument of each line in the file (the
# executable process name):
set -A profiled_procs `cat ${JOB_CONFIG_FILE} | awk ‘{print $1}’`
# forever
while [[ 1 = 1 ]] ; do
# Create a list of active processes in this group:
set -A active_procs `ps -R ${PRM_GROUP} | awk ‘{print $NF}’`;
let i=0;
# Walk the list of active processes, looking for a match in config file
while [[ “x${active_procs[i]}” != “x” ]] ; do
# We found a process running in the selected PRM
let j=0;
while [[ “x${profiled_procs[j]}” != “x” ]] ; do
# We found an active process that is in our list of profiled jobs
if [[ “${active_procs[i]}” = “${profiled_procs[j]}” ]] ; then
# This active process is in my profile list.
# Read the rest of the line for this particular application
# active_entry is the entry in the config file we are
# looking for
# entry_fields is an array that is filled with the elements
# of the process entry in the config file
# entry_fields[0] = executable name
# entry_fields[1] = profile value (CPU seconds)
# entry_fields[2] = desired duration (real seconds)