Skip to content

Instantly share code, notes, and snippets.

@DSuveges
Created April 27, 2018 09:33
Show Gist options
  • Save DSuveges/6930326e59efe11e36071e25896bd9cf to your computer and use it in GitHub Desktop.
Save DSuveges/6930326e59efe11e36071e25896bd9cf to your computer and use it in GitHub Desktop.
This little function opens an interactive shell on a computing node with a given amount of memory.
function getInteractiveJob (){
MEMLIM=1000
DEFAULTSHELL=$(which bash)
if [[ ! -z "${1}" ]]; then
MEMLIM=$(( $1 * 1000 ))
fi
# Submitting a request to get interactive shell:
bsub -M${MEMLIM} -R"select[mem>${MEMLIM}] rusage[mem=${MEMLIM}]" -Ip "${DEFAULTSHELL}"
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment