-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathbmpixelcounter.py
More file actions
executable file
·68 lines (54 loc) · 1.59 KB
/
bmpixelcounter.py
File metadata and controls
executable file
·68 lines (54 loc) · 1.59 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
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
#!/usr/bin/env python
import subprocess as sp
import os
from config import *
scriptBase = 'BMPixelCounter'
scriptName = baseDir + scriptBase + '.bms'
condorScriptName = workingDir + scriptBase + '.dagjob'
sphereDir = workingDir + 'spheres/'
condorSubmitName = condorScriptName + '.condor.sub'
def main():
try:
os.mkdir(workingDir)
print "Creating working directory."
except OSError:
print "Working directory present."
try:
os.mkdir(sphereDir)
print "Creating sphere directory."
except OSError:
print "Sphere directory present."
if len(os.listdir(sphereDir)) != 15:
print "Generating spheres."
os.chdir(sphereDir)
sp.call([generateSpheres])
else:
print "Spheres 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 wrapper for PixelCounter
sp.call([batchmake,
'-ap', batchmakeAppDir,
'-a', pixelCounter,
'-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()