Skip to content

Instantly share code, notes, and snippets.

@riga
Last active February 8, 2024 19:19
Show Gist options
  • Save riga/5dc23faeea405cf0e43befffa491bc0b to your computer and use it in GitHub Desktop.
Save riga/5dc23faeea405cf0e43befffa491bc0b to your computer and use it in GitHub Desktop.
htcondor test
universe = vanilla
executable = job.sh
log = /dev/null
should_transfer_files = YES
transfer_input_files = job.sh
when_to_transfer_output = ON_EXIT
output = out.txt
error = err.txt
notification = Never
initialdir = /afs/cern.ch/user/m/mrieger/htctest
+MaxRuntime = 300
+RequestRuntime = 300
MY.WantOS = el8
arguments = 123
queue
#!/bin/bash
action() {
_law_exe_exists() {
command -v "$1" &> /dev/null
}
_law_python() {
# forward to python if it exists, otherwise to python3
_law_exe_exists python && python "$@" || python3 "$@"
}
echo "running job.sh, argument 1: $1"
echo "----------------"
echo "python : $( _law_exe_exists python && echo "$( 2>&1 python --version ) from $( which python )" || echo "missing" )"
echo "python3 : $( _law_exe_exists python3 && echo "$( 2>&1 python3 --version ) from $( which python3 )" || echo "missing" )"
echo "tmp dir : $( _law_python -c "from tempfile import gettempdir; print(gettempdir())" )"
echo "----------------"
}
action "$@"
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment