-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbmls.py
More file actions
executable file
·51 lines (39 loc) · 1.14 KB
/
bmls.py
File metadata and controls
executable file
·51 lines (39 loc) · 1.14 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
#!/usr/bin/env python
# Lib imports
import subprocess as sp
import os
# Configuration
from config import *
scriptBase = 'BMLS'
scriptName = baseDir + scriptBase + '.bms'
condorScriptName = workingDir + scriptBase + '.dagjob'
condorSubmitName = condorScriptName + '.condor.sub'
def main():
try:
os.mkdir(workingDir)
print "Creating working directory."
except OSError:
print "Working directory present."
os.chdir(workingDir)
# Create wrapper for bmGridSend
sp.call([batchmake,
'-ap', batchmakeAppDir,
'-a', bmGridSend,
'-p', workingDir])
# Create wrapper for bmGridStore
sp.call([batchmake,
'-ap', batchmakeAppDir,
'-a', bmGridStore,
'-p', workingDir])
# Create the condor scripts
sp.call([batchmake,
'-ap', batchmakeAppDir,
'-p', workingDir,
'--condor', scriptName, condorScriptName])
# Create the condor submit script
sp.call([condorSubmitDag,
'-no_submit', '-f', condorScriptName])
# Submit the script to the condor grid
sp.call([condorSubmit, condorSubmitName])
if __name__ == "__main__":
main()