ganga.GangaCore.Lib.Batch.Batch module

Batch submission backend.

It is assumed that Batch commands (bjobs, bsub etc.) setup correctly. As little assumptions as possible are made about the Batch configuration but at certain sites it may not work correctly due to a different Batch setup. Tested with CERN and CNAF Batch installations.

Each batch system supports an ‘extraopts’ field, which allows customisation of way the job is submitted.

PBS: Take environment settings on submitting machine and export to batch job: backend.extraopts = “-V”

Request minimum walltime of 24 hours and minimum memory of 2GByte: backend.extraopts = “-l walltime=24:00:00 mem=2gb”

The above can be combined as: backend.extraopts = “-V -l walltime=24:00:00 mem=2gb”

LSF: Sends mail to you when the job is dispatched and begins execution. backend.extraopts = “-B”

Assigns the Ganga job name to the batch job. The job name does not need to be unique. backend.extraopts = “-J “+ j.name

Run the job on a host that meets the specified resource requirements. A resource requirement string describes the resources a job needs. E.g request 2Gb of memory ans 1Gb of swap space backend.extraopts = ‘-R “mem=2048” -R “swp=1024”’

Kill job if it has exceeded the deadline (i.e. for your presentation) backend.extraopts = ‘-t 07:14:12:59’ #Killed if not finished by 14 July before 1 pm

ganga.GangaCore.Lib.Batch.Batch.const_lock

This is a context manager which acquires the const write lock on the object’s root object.

This lock acquires exclusive access over an object tree to prevent it from changing. Reading schema attributes on the object is still allowed but changing them is not. Only one thread can hold this lock at once.