Exercise 6b: Runtime And Resource Limits
In order to help scheduling and to provide priority to jobs that are shorter and more efficient, the maximum runtime of a job can be set. This is either set directly in seconds or a job can be assigned a "flavour" which will bucket the job into a max runtime. Jobs which exceed the maximum runtime will be terminated. The runtime is the wall time of the job (the actual time elapsed) rather than a calculated CPU time.
The job flavours are as follows:
espresso = 20 minutes
microcentury = 1 hour
longlunch = 2 hours
workday = 8 hours
tomorrow = 1 day
testmatch = 3 days
nextweek = 1 week
The default job flavour for a job submitted with no other information is "espresso".
Setting the job flavour in the submit file is achieved as follows:
+JobFlavour = "longlunch"
+MaxRuntime = Number of seconds
By default, a job will obtain one slot of a CPU core, 2gb of memory and 20gb of disk space. It is possible to ask for more CPUs or more memory, but the system will scale the number of CPUs received to respect the 2gb / core limit.
In this exercise, a number of CPU equal to two and memory equal to 1M will be set. The Job Flavour microcentury can be used.
Create of exercise6b.sub using the following:
executable = welcome.sh
arguments = $(ClusterId)$(ProcId)
output = output/ex06.$(ClusterId).$(ProcId).out
error = error/ex06.$(ClusterId).$(ProcId).err
log = log/ex06.$(ClusterId).log
request_cpus = 2
+JobFlavour = "microcentury"
queue
To be sure of the changes, the job's ClassAd can be checked by executing:
condor_q -l <jobId> -af MaxRuntime JobFlavour RequestCpus RequestMemory
The RequestMemory will be 4000 MB since RequestCpus is 2.
If request_memory = 4000 is set, execute:
condor_q -l <jobId> -af MaxRuntime JobFlavour RequestCpus RequestMemory