Sure, it’s a set of scripts, but hope this is helpful:
#!/bin/bash
#SBATCH -c 4 --mem=32g --constraint=x2695 --partition=norm --job-name=cryosparc_master --signal=B:TERM@1200 --output=/home/%u/cryosparc_master.%j.out --comment="cryosparc_master" --time=10-00:00:00
cleanup() {
${CRYOSPARC_HOME}/libexec/shutdown.sh >> ${CRYOSPARC_BASE}/sbatch.log
# if all goes well and smoothly, the job will exit with EC=0 and will be marked as COMPLETED
exit 0
}
trap cleanup 1 2 3 4 5 6 7 8 9 10 SIGINT SIGTERM
# Set up the environment
source ${CRYOSPARC_HOME}/libexec/enable_proxy.sh
source ${CRYOSPARC_HOME}/libexec/enable_waits.sh
source ${CRYOSPARC_BASE}/config.cnf
# Is cryosparc installed?
[[ -f ${CRYOSPARC_BASE}/cryosparc_master/bin/cryosparcm ]] || { echo "CryoSPARC not installed in ${CRYOSPARC_BASE}"; exit 1; }
[[ -f ${CRYOSPARC_BASE}/cryosparc_master/config.sh ]] || { echo "CryoSPARC not installed in ${CRYOSPARC_BASE}"; exit 1; }
[[ -w ${CRYOSPARC_BASE}/cryosparc_master/config.sh ]] || { echo "CryoSPARC config.sh not writable ${CRYOSPARC_BASE}"; exit 1; }
# Is cryosparc already running?
[[ -f ${CRYOSPARC_BASE}/cryosparc_master/run/supervisord.pid ]] && ps -p $(cat ${CRYOSPARC_BASE}/cryosparc_master/run/supervisord.pid) >& /dev/null && { echo "CryoSPARC already running!"; exit 1; }
# Start up the server
${CRYOSPARC_HOME}/libexec/startup.sh >> ${CRYOSPARC_BASE}/sbatch.log
# Establish tunnel from biowulf to this node
/usr/local/slurm/libexec/tunnelcommand_tcp.sh --cryosparc
# Wait until done
wait_until_done ${SLURM_JOB_ID}