ATLAS Offline Software
Loading...
Searching...
No Matches
HTCondorJobRunner.py
Go to the documentation of this file.
1#!/usr/bin/env python
2
3# Copyright (C) 2002-2021 CERN for the benefit of the ATLAS collaboration
4
5
6"""
7HTCondorJobRunner is a JobRunner for running jobs with the HTCondor batch system.
8
9Written by Anthony Morley in 2019.
10"""
11__author__ = 'Anthony Morley'
12__version__ = '$Id: HTCondorJobRunner.py 216126 2009-09-29 16:12:59Z atlidbs $'
13
14
15from InDetBeamSpotExample import JobRunner
16import os
17
18condorScriptTemplate="""executable = %(scriptfile)s
19arguments = $(ClusterID) $(ProcId)
20output = %(logfile)s.out
21error = %(logfile)s.err
22log = %(logfile)s.log
23universe = vanilla
24+JobFlavour = %(batchqueue)s
25queue
26"""
27
29 """HTCondorJobRunner - run jobs using the HTCondor batch system"""
30
31 def __init__(self,**params):
32 """Constructor (takes any number of parameters as an argument)."""
33 JobRunner.JobRunner.__init__(self)
34
35 # Set user-specified parameters only after HTCondorJobRunner defaults
36 self.setParam('batchqueue','workday','Batch queue')
37 for k in params.keys():
38 self.setParam(k,params[k])
39 self.checkParams()
40
41 def submitJob(self,jobConfig):
42 """Submit a JobRunner job as a LSF batch job."""
43 condorScript = condorScriptTemplate % jobConfig
44 print (condorScript)
45 script = open('condorSubmit.sub','w')
46 script.write(condorScript)
47 script.close()
48 os.chmod('condorSubmit.sub',0o755)
49 batchCmd = 'condor_submit condorSubmit.sub'
50 print (batchCmd )
51 os.system(batchCmd)
52 return None
setParam(self, name, value=None, description=None, isSpecial=None, insertAtFront=False)
Definition JobRunner.py:157