Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 11 additions & 4 deletions rc/control/daqinterface.py
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,7 @@ def read_settings(self):
self.disable_unique_rootfile_labels = False
self.disable_private_network_bookkeeping = False
self.allowed_processors = None
self.partition_label_format = None

self.max_num_launch_procs_checks = 20
self.launch_procs_wait_time = 40
Expand Down Expand Up @@ -1115,6 +1116,8 @@ def read_settings(self):
self.dl_transfer = line.split()[-1].strip()
elif "allowed_processors" in line or "allowed processors" in line:
self.allowed_processors = line.split()[-1].strip()
elif "partition_label_format" in line or "partition label format" in line:
self.partition_label_format = line.split()[-1].strip()
elif "max_launch_checks" in line or "max launch checks" in line:
self.max_num_launch_procs_checks = int(line.split()[-1].strip())
elif "launch_procs_wait_time" in line or "launch procs wait time" in line:
Expand Down Expand Up @@ -1797,15 +1800,19 @@ def get_artdaq_log_filenames(self):

cmds.append('short_hostname=$( hostname | sed -r "s/([^.]+).*/\\1/" )')
for i_p, procinfo in enumerate(procinfos_for_host):

expected_label = procinfo.label + (
""
if self.partition_label_format is None
else self.partition_label_format % (self.partition_number)
)
output_logdir = "%s/%s-$short_hostname-%s" % (
self.log_directory,
procinfo.label,
expected_label,
procinfo.port,
)
cmds.append(
"filename_%s=$( ls -tr1 %s/%s-$short_hostname-%s*.log | tail -1 )"
% (i_p, output_logdir, procinfo.label, procinfo.port)
% (i_p, output_logdir, expected_label, procinfo.port)
)
cmds.append(
"if [[ -z $filename_%s ]]; then echo No logfile found for process %s on %s after looking in %s >&2 ; exit 1; fi"
Expand Down Expand Up @@ -1951,7 +1958,7 @@ def softlink_logfiles(self):
proctype = ""

for procinfo in self.procinfos:
if label == procinfo.label:
if procinfo.label in label:
proctype = procinfo.name

if "BoardReader" in proctype:
Expand Down
20 changes: 18 additions & 2 deletions rc/control/manage_processes_direct.py
Original file line number Diff line number Diff line change
Expand Up @@ -363,7 +363,15 @@ def launch_procs_base(self):
bootfile_name_to_execname(procinfo.name),
procinfo.port,
procinfo.rank,
procinfo.label,
procinfo.label
+ (
""
if self.partition_label_format is None
else (
self.partition_label_format
% (os.environ["DAQINTERFACE_PARTITION_NUMBER"])
)
),
os.environ["DAQINTERFACE_PARTITION_NUMBER"],
)
)
Expand Down Expand Up @@ -889,7 +897,15 @@ def check_proc_heartbeats_base(self, requireSuccess=True):
for procinfo in [
procinfo for procinfo in self.procinfos if procinfo.host == host
]:
if procinfo.label in labels_of_found_processes:
expected_label = procinfo.label + (
""
if self.partition_label_format is None
else (
self.partition_label_format
% (os.environ["DAQINTERFACE_PARTITION_NUMBER"])
)
)
if expected_label in labels_of_found_processes:
found_processes.append(procinfo)
else:
is_all_ok = False
Expand Down