More logging
This commit is contained in:
parent
b5e5664cbc
commit
93b7d68e31
@ -187,6 +187,7 @@ class Slate():
|
|||||||
num_p = min(agents_per_job, math.ceil(node_reps / reps_per_agent))
|
num_p = min(agents_per_job, math.ceil(node_reps / reps_per_agent))
|
||||||
|
|
||||||
if num_p == 1:
|
if num_p == 1:
|
||||||
|
print('[i] Running within main thread')
|
||||||
self._run_single(config, rep_ids=rep_ids, p_ind=0)
|
self._run_single(config, rep_ids=rep_ids, p_ind=0)
|
||||||
return
|
return
|
||||||
|
|
||||||
@ -195,6 +196,7 @@ class Slate():
|
|||||||
reps_done = 0
|
reps_done = 0
|
||||||
|
|
||||||
for p in range(num_p):
|
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)
|
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_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))
|
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:
|
for proc in procs:
|
||||||
proc.join()
|
proc.join()
|
||||||
|
print(f'[i] All threads/processes have terminated')
|
||||||
|
|
||||||
def _run_process(self, orig_config, rep_ids, p_ind):
|
def _run_process(self, orig_config, rep_ids, p_ind):
|
||||||
config = copy.deepcopy(orig_config)
|
config = copy.deepcopy(orig_config)
|
||||||
|
Loading…
Reference in New Issue
Block a user