NERSCPowering Scientific Discovery Since 1974

Using Sleepers to Manage Batch Access to HPSS

Sleepers are only available using the HSI or PFTP clients from NERSC production machines.

When scheduled maintenance or unexpected events necessitate taking HPSS down "sleepers" are enabled.  This causes all jobs attempting to use HPSS to wait.  Usually this causes no problems for these jobs which resume safely when sleepers are removed.  However, users may wish to test for HPSS system availability and take alternate action if sleepers are enabled.

Testing for sleepers can be accomplished by using the "hpss_avail" utility which is available on all NERSC supercomputers.  This utility takes a single argument which may be "archive", "hpss", or "help".  The case used for the argument is not significant.  Any other argument, or none, will result in usage text being returned.  The "help" argument will result in more deetailed help text.  The utility returns its result in the predefined shell variable "status" ($? in some shells).  It may be tested, used in a subsequent shell command, or output.  Its value will persist only until the next shell command is executed and then it will be overwritten by the results of that next command.  Below are two examples of querying a system and printing a message based on the returned status value.  The first uses the C Shell and the second the Korn Shell.

#!/bin/csh

hpss_avail archive; set READY=$status
if ($READY == 0) then
echo "ARCHIVE is up and available"
else
echo "ARCHIVE is unavailable"
endif

 

#!/usr/bin/ksh

hpss_avail archive
READY=$?
if [ $READE -eq 0 ]; then
echo "ARCHIVE is up and available"
else
echo "ARCHIVE is unavailable"
fi

Possible alternative actions to take when sleepers are enabled might include (1) moving files to alternate file systems, such as $HOME, or (2) changing file names to prevent overwriting or name collisions by subsequent file creations.