Skip to content

Instantly share code, notes, and snippets.

@Tushar-N Tushar-N/csub.sh
Last active Aug 28, 2019

Embed
What would you like to do?
Condor submit script: use csub <cmd> from a submit node
cmd=$@
cv_dir=`expr "$cmd" : '.*--cv_dir \([^ ]*\).*'`
mkdir -p $cv_dir
# temporarily create two files: submit.sh and run.sh
cat > $cv_dir/submit.sh << EOF
universe = vanilla
Executable = /lusr/bin/bash
Arguments = $cv_dir/run.sh
+Group = "GRAD"
+Project = "AI_ROBOTICS"
+ProjectDescription = "Research Work"
Requirements = TARGET.GPUSlot
getenv = True
request_GPUs = 1
+GPUJob = true
Log = $cv_dir/run.log
Error = $cv_dir/run.err
Output = $cv_dir/run.out
Queue 1
EOF
# For CPU jobs:
# Requirements = (Narsil == true) || (Uvanimor == true) || (Rhavan == true)
# Rank = ((Narsil == true)*3) + ((Uvanimor == true)*2) + (Rhavan == true)
cat > $cv_dir/run.sh << EOF
source activate cuda10; $cmd
EOF
# Call condor_submit on the generated submit_file
source ~/.bashrc
condor_submit $cv_dir/submit.sh
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
You can’t perform that action at this time.