More logging

This commit is contained in:
Dominik Moritz Roth 2023-07-09 16:44:09 +02:00
parent b5e5664cbc
commit 93b7d68e31

View File

@ -187,6 +187,7 @@ class Slate():
num_p = min(agents_per_job, math.ceil(node_reps / reps_per_agent))
if num_p == 1:
print('[i] Running within main thread')
self._run_single(config, rep_ids=rep_ids, p_ind=0)
return
@ -195,6 +196,7 @@ class Slate():
reps_done = 0
for p in range(num_p):
print(f'[i] Spawning seperate thread/process ({p+1}/{num_p})')
num_reps = min(node_reps - reps_done, reps_per_agent)
proc_rep_ids = [rep_ids[i] for i in list(range(reps_done, reps_done+num_reps))]
proc = Parallelization_Primitive(target=partial(self._run_process, config, rep_ids=proc_rep_ids, p_ind=p))
@ -204,6 +206,7 @@ class Slate():
for proc in procs:
proc.join()
print(f'[i] All threads/processes have terminated')
def _run_process(self, orig_config, rep_ids, p_ind):
config = copy.deepcopy(orig_config)