Belle II Software  release-08-01-10
run_processor.py
1 #! /usr/bin/env python
2 
3 
10 
11 import os
12 import sys
13 import signal
14 import subprocess
15 
16 global proc
17 
18 
19 # Signal Handler
20 def cleanup(num, frame):
21  os.kill(proc.pid, signal.SIGKILL)
22 # os.kill(proc.pid, signal.SIGINT)
23  exit()
24 
25 # main
26 
27 
28 # Signal Handler
29 signal.signal(signal.SIGINT, cleanup)
30 signal.signal(signal.SIGTERM, cleanup)
31 
32 # Obtain input/output RingBuffer names
33 argvs = sys.argv
34 argc = len(argvs)
35 
36 inputrb = argvs[1]
37 outputrb = argvs[2]
38 histport = argvs[3]
39 # ncore = argvs[4]
40 ncore = "20"
41 
42 script = "processor.py"
43 
44 # run basf2
45 proc = subprocess.Popen("basf2 --no-stats " + script + " " + inputrb + " " + outputrb + " " + histport + " " + ncore, shell=True)
46 
47 # Just sleep
48 proc.wait()