Skip to content

Commit

Permalink
Why is B not written?
Browse files Browse the repository at this point in the history
  • Loading branch information
Hjorthmedh committed May 31, 2021
1 parent 17a7f2e commit 8771c77
Showing 1 changed file with 11 additions and 6 deletions.
17 changes: 11 additions & 6 deletions snudda/synaptic_fitting/optimise_synapses_full.py
Original file line number Diff line number Diff line change
Expand Up @@ -834,9 +834,8 @@ def sobol_scan(self,
assert self.synapse_type == "glut", \
"GABA synapse not supported yet in new version"

print(f"sobol_scan n_trials = {n_trials}")

if parameter_sets is None:
self.write_log(f"sobol_scan n_trials = {n_trials}")
parameter_sets = self.setup_parameter_set(model_bounds, n_trials)

self.write_log(f"parameter_sets={parameter_sets}")
Expand Down Expand Up @@ -1023,9 +1022,13 @@ def parallel_optimise_single_cell(self, n_trials=10000, post_opt=False):
"ly.sobol_worker_setup(params=params," \
+ "synapse_position_override=(synapse_section_id,synapse_section_x))"

self.d_view.execute(f"ly.write_log('TESTING LOG A')", block=True)

self.write_log("Calling sobol_worker_setup")
self.d_view.execute(cmd_str_setup, block=True)

self.d_view.execute(f"ly.write_log('TESTING LOG B')", block=True)

cmd_str = ("res = ly.sobol_scan(t_stim = stim_time,"
" h_peak = peak_height,"
" parameter_sets=parameter_points,"
Expand All @@ -1038,7 +1041,9 @@ def parallel_optimise_single_cell(self, n_trials=10000, post_opt=False):

# 5. Gather worker data
self.write_log("Gathering results from workers")
res = self.d_view["res"]
# res = self.d_view["res"]
res = self.d_view.gather("res", block=True)
self.write_log("Results gathered.")

for r in res:
self.synapse_parameter_data.merge(r)
Expand All @@ -1052,7 +1057,7 @@ def parallel_optimise_single_cell(self, n_trials=10000, post_opt=False):
synapse_position_override=(synapse_model.synapse_section_id,
synapse_model.synapse_section_x))

self.sobol_scan(n_trials=n_trials,
self.sobol_scan(parameter_sets=parameter_points,
t_stim=self.stim_time,
h_peak=peak_height,
model_bounds=model_bounds,
Expand Down Expand Up @@ -1237,15 +1242,15 @@ def setup_parallel(self, d_view=None):
engine_log_file = [[] for x in range(0, len(self.d_view))]

n_workers = len(self.d_view)
self.d_view.scatter("engine_log_file", engine_log_file)
self.d_view.scatter("engine_log_file", engine_log_file, block=True)

self.d_view.push({"data_file": self.data_file,
"synapse_type": self.synapse_type,
"synapse_parameter_file": self.synapse_parameter_file,
"load_parameters": self.load_parameters,
"normalise_trace": self.normalise_trace,
"neuron_set_file": self.neuron_set_file,
"role": "servant"})
"role": "servant"}, block=True)

cmd_str = ("ly = OptimiseSynapsesFull(data_file=data_file, synapse_parameter_file=synapse_parameter_file, "
" synapse_type=synapse_type,role=role, load_parameters=load_parameters,"
Expand Down

0 comments on commit 8771c77

Please sign in to comment.