####################
##
## Test Condor command file
##
## The 'test_script.sh' executable writes the square of the numbers
## from 1 to $(args) in a file called 'squares.txt'.
## It has a trivial checkpoint mechanism: when receiving SIGTERM it
## writes the loop counter in a file, and reads it back when restarting.
####################

universe        = vanilla

# Restrict execution on the 'gymno' testebed
requirements    = TARGET.ClusterName == "gymno-pool"

request_cpus    = 1
executable      = test_script.sh
args		= 600
output          = jobtest_condor.out.$(Cluster).$(Process)
error           = jobtest_condor.err.$(Cluster).$(Process)
log		= jobtest_condor.log.$(Cluster).$(Process)

# Transfer files also when evicted, to get back the checkpoint file
when_to_transfer_output = ON_EXIT_OR_EVICT

# Avoid overwriting the output of a different job
transfer_output_remaps = "squares.txt=squares.txt.$(Cluster).$(Process)"

# Allow execution on gymno testbed
+TestJob = true

# Don't suspend the job, skip to preemtion
#+AvoidSuspend = true

queue 20 
