13from argparse
import ArgumentParser
17 """Shortcut method to do the basf2 execution on hltout"""
20 parser = ArgumentParser()
21 parser.add_argument(
"input_ring_buffer", help=
"Name of the input ring buffer")
22 parser.add_argument(
"output_ring_buffer", help=
"Name of the output ring buffer")
23 parser.add_argument(
"unused-histoport", help=
"Unused in the moment")
24 parser.add_argument(
"--number-of-collectors", help=
"Number of collectors to start", default=3, type=int)
26 args = parser.parse_args()
28 input_ring_buffer_list = [f
"{args.input_ring_buffer}{i + 1}" for i
in range(0, args.number_of_collectors)]
29 output_ring_buffer_list = [f
"{args.output_ring_buffer}{i + 1}" for i
in range(0, args.number_of_collectors)]
30 message_queue_list = [f
"/roi{i}" for i
in range(0, args.number_of_collectors)]
32 for input_rb
in input_ring_buffer_list:
33 subprocess.run([
"removerb", input_rb])
34 for output_rb
in output_ring_buffer_list:
35 subprocess.run([
"removerb", output_rb])
37 execution = CleanBasf2Execution()
39 execution.start([
"hlt_rb2mrb", args.input_ring_buffer] + input_ring_buffer_list)
40 execution.start([
"hlt_mrb2rb"] + output_ring_buffer_list + [args.output_ring_buffer])
41 for input_rb, output_rb, roi_message_queue
in zip(input_ring_buffer_list, output_ring_buffer_list,
43 execution.start([
"basf2",
"--no-stats", script_name,
"--", input_rb, output_rb, roi_message_queue])
44 return_code = execution.wait()
47 subprocess.run([
"framework-pcore-clear_ipcs"])
48 for input_rb
in input_ring_buffer_list:
49 subprocess.run([
"removerb", input_rb])
50 for output_rb
in output_ring_buffer_list:
51 subprocess.run([
"removerb", output_rb])