Skip to content

Instantly share code, notes, and snippets.

@Tushar-N Tushar-N/csub.sh
Last active Feb 20, 2018

Embed
What would you like to do?
Condor submit script: use csub <cmd> from a submit node
cmd=$@
# find the location to save files to
cv_dir=`expr "$cmd" : '.*--cv_dir \([^ ]*\).*'`
# make cv_dir and create two files: submit.sh and run.sh
mkdir $cv_dir
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 && CUDAGlobalMemoryMb >= 2000
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
cat > $cv_dir/run.sh << EOF
$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.