Created
September 5, 2016 14:39
-
-
Save informationsea/af9d2b4a72107a9186cfba1f751dc720 to your computer and use it in GitHub Desktop.
Support Function for GridEngine
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
function qsub-one () { | |
SHOWHELP="false" | |
GRID_OPTION=("-cwd") | |
GRID_SHELL="/bin/zsh" | |
while getopts p:n:m:hs: OPT; do | |
case $OPT in | |
"h") SHOWHELP="true";; | |
"n") GRID_NAME="$OPTARG";; | |
"m") GRID_OPTION=("${GRID_OPTION[@]}" "-l" "s_vmem=$OPTARG,mem_req=$OPTARG");; | |
"p") GRID_OPTION=("${GRID_OPTION[@]}" "-pe" "def_slot" "$OPTARG");; | |
"s") GRID_SHELL="$OPTARG";; | |
esac | |
done | |
shift $((OPTIND -1 )) | |
if [ -z "$GRID_NAME" ];then | |
GRID_NAME=$1 | |
fi | |
GRID_OPTION=("${GRID_OPTION[@]}" "-S" "$GRID_SHELL" "-N" "$GRID_NAME") | |
if [[ -z $1 ]]; then | |
SHOWHELP=true | |
fi | |
if [[ "$SHOWHELP" = "true" ]];then | |
echo "$0 [options] command ..." | |
echo | |
echo " -h : show this help" | |
echo " -n NAME : job name" | |
echo " -m MEMORY : Memory size with unit" | |
echo " -p THREADS : # of threds" | |
echo " " | |
return 1 | |
fi | |
echo -e "export PATH=\"$PATH\"\nexport LD_LIBRARY_PATH=\"$LD_LIBRARY_PATH\"\n"'"$@"'|qsub $GRID_OPTION -- "$@" | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment