Belle II Software development
run_processor.py
1#! /usr/bin/env python
2
3
10
11import os
12import sys
13import signal
14import subprocess
15
16global proc
17
18
19# Signal Handler
20def 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
29signal.signal(signal.SIGINT, cleanup)
30signal.signal(signal.SIGTERM, cleanup)
31
32# Obtain input/output RingBuffer names
33argvs = sys.argv
34argc = len(argvs)
35
36inputrb = argvs[1]
37outputrb = argvs[2]
38histport = argvs[3]
39# ncore = argvs[4]
40ncore = "20"
41
42script = "processor.py"
43
44# run basf2
45proc = subprocess.Popen("basf2 --no-stats " + script + " " + inputrb + " " + outputrb + " " + histport + " " + ncore, shell=True)
46
47# Just sleep
48proc.wait()