Created
April 19, 2017 14:44
-
-
Save willfurnass/10277756070c4f374e6149a281324841 to your computer and use it in GitHub Desktop.
Simple wrapper for Sun Grid Engine's qrsh that propagates SGE environment variables and enables X forwarding
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/sh | |
# David Jones and Will Furnass (University of Sheffield) | |
# `qrsh` is often the most convenient utility for starting interactive shell | |
# sessions on Sun/Son of Grid Engine (SGE) clusters but it has some limitations (as | |
# configured on the ShARC/Iceberg clusters): | |
# | |
# - none of the standard SGE environment vars (e.g. JOB_ID, PE_HOSTFILE, | |
# NSLOTS) that are defined in qsub/qsh batch/interactive sessions are set | |
# (annoying but not the end of the world); | |
# - variables can't be set in prolog scripts (e.g. the CUDA_VISIBLE_DEVICES env | |
# var needed for exclusively locking GPUs to jobs); | |
# - X display forwarding doesn't work. | |
# | |
# This script addresses these three issues. It starts a qrsh shell session in | |
# which: | |
# | |
# - all environment variables set by the scheduler (e.g. JOB_ID) are set | |
# - X display forwarding is enabled if necessary | |
exec qrsh $( [ -z ${DISPLAY+x} ] || echo '-v DISPLAY' ) -pty y "$@" $SHELL |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment