1
0
Fork 0

Updated output messages

master
Luca Moretti 4 years ago
parent 1592afe8ee
commit b76994d66b
  1. 5
      PyCTBN/PyCTBN/estimators/structure_constraint_based_estimator.py
  2. 5
      PyCTBN/PyCTBN/estimators/structure_score_based_estimator.py

@ -225,13 +225,14 @@ class StructureConstraintBasedEstimator(StructureEstimator):
#with multiprocessing.Pool(processes=cpu_count) as pool:
#with get_context("spawn").Pool(processes=cpu_count) as pool:
if disable_multiprocessing:
print("DISABILITATO")
print("DISABLED")
cpu_count = 1
list_edges_partial = [ctpc_algo(n,total_vars_numb) for n in self._nodes]
else:
if processes_number is not None and cpu_count < processes_number:
if processes_number is not None and cpu_count > processes_number:
cpu_count = processes_number
print(f"CPU COUNT: {cpu_count}")
with concurrent.futures.ProcessPoolExecutor(max_workers=cpu_count) as executor:
list_edges_partial = executor.map(ctpc_algo,
self._nodes,

@ -97,11 +97,10 @@ class StructureScoreBasedEstimator(StructureEstimator):
'get the number of CPU'
cpu_count = multiprocessing.cpu_count()
print(f"CPU COUNT: {cpu_count}")
if disable_multiprocessing:
cpu_count = 1
elif processes_number is not None and cpu_count < processes_number:
elif processes_number is not None and cpu_count > processes_number:
cpu_count = processes_number
@ -111,6 +110,8 @@ class StructureScoreBasedEstimator(StructureEstimator):
#with get_context("spawn").Pool(processes=cpu_count) as pool:
#with multiprocessing.Pool(processes=cpu_count) as pool:
print(f"CPU COUNT: {cpu_count}")
'Estimate the best parents for each node'
if disable_multiprocessing:
list_edges_partial = [estimate_parents(n,max_parents,iterations_number,patience,tabu_length,tabu_rules_duration,optimizer) for n in self._nodes]