ATLAS Offline Software
Loading...
Searching...
No Matches
PDSFJobRunner.py
Go to the documentation of this file.
1#!/usr/bin/env python
2
3# Copyright (C) 2002-2020 CERN for the benefit of the ATLAS collaboration
4
5
6"""
7PDSFJobRunner is a JobRunner for running jobs with the SGE batch system on pdsf.nersc.gov.
8
9Written by Juerg Beringer (LBNL) in 2009.
10"""
11__author__ = 'Juerg Beringer'
12__version__ = '$Id: PDSFJobRunner.py 343090 2011-02-01 00:39:37Z hurwitz $'
13
14
15from JobRunner import JobRunner
16import os
17import time
18
19preScript = """#!/bin/bash
20
21#$ -hard
22#$ -l h_cpu=24:00:00
23#$ -l eliza4io=1
24
25ulimit -c 0
26
27echo "Starting on host $(hostname) on $(date)"
28echo "JOB_ID=$JOB_ID"
29echo ""
30ulimit -a
31echo ""
32
33"""
34
36 """PDSFJobRunner - run jobs using the SGE batch system on PDSF"""
37
38 def __init__(self,**params):
39 """Constructor (takes any number of parameters as an argument)."""
40 JobRunner.__init__(self)
41
42 # Set user-specified parameters only after PDSFJobRunner defaults
43 self.setParam('batchqueue','all.64bit.q','Batch queue')
44 script = self.getParam('script')
45 self.setParam('script',preScript+script)
46 for k in params.keys():
47 self.setParam(k,params[k])
48 # SGE runs jobs from where they were submitted, so change rundir explicitly to jobdir
49 self.setParam('rundir','%(jobdir)s')
50 self.setParam('maketmpdir','')
51 self.checkParams()
52
53 def submitJob(self,jobConfig):
54 """Submit a JobRunner job as a SGE batch job."""
55 #batchCmd = 'qsub -q %(batchqueue)s -N %(jobname)s -j y -o %(logfile)s %(scriptfile)s' % jobConfig
56 batchCmd = 'qsub -N %(jobname)s -j y -o %(logfile)s %(scriptfile)s' % jobConfig
57 print (batchCmd)
58 time.sleep(5)
59 os.system(batchCmd)
60 return None
setParam(self, name, value=None, description=None, isSpecial=None, insertAtFront=False)
Definition JobRunner.py:157