#!/bin/sh # set -x # # Cancel job running in SLURM. # Input: grami file (same as Globus) echo "----- starting cancel_slurm_job -----" 1>&2 joboption_lrms="SLURM" lrms_options="slurm_wakeupperiod slurm_use_sacct slurm_bin_path" # ARC1 passes first the config file. if [ "$1" = "--config" ]; then shift; ARC_CONFIG=$1; shift; fi GRAMI_FILE=$1 # define paths and config parser basedir=`dirname $0` basedir=`cd $basedir > /dev/null && pwd` || exit $? . "${basedir}/lrms_common.sh" # load common cancel functions . "${pkgdatadir}/cancel_common.sh" || exit $? # run common init # * parse grami # * parse config # * load LRMS-specific env common_init # scancel verify_jobid $joboption_jobid || exit 1 echo "executing scancel with job id $joboption_jobid" 1>&2 "${scancel}" "${joboption_jobid}" if [ "$?" != "0" ];then echo "scancel failed" 1>&2 fi echo "----- exiting cancel_slurm_job -----" 1>&2 exit 0