Skip to content

Commit

Permalink
Parallel execution
Browse files Browse the repository at this point in the history
  • Loading branch information
Hjorthmedh committed Oct 23, 2023
1 parent 6aadd90 commit a882245
Showing 1 changed file with 16 additions and 10 deletions.
26 changes: 16 additions & 10 deletions snudda/place/place.py
Original file line number Diff line number Diff line change
Expand Up @@ -594,12 +594,23 @@ def avoid_edges_parallel(self):
unsorted_neuron_id = self.random_generator.permutation(len(bend_neuron_info))
bend_neuron_info = [bend_neuron_info[idx] for idx in unsorted_neuron_id]

with self.d_view.sync_imports():
from snudda.place import SnuddaPlace

self.d_view.scatter("bend_neuron_info", bend_neuron_info, block=True)
self.d_view.push({"config_file": self.config_file,
"network_path": self.network_path,
"snudda_data": self.snudda_data},
block=True)

cmd_str = f"sp = SnuddaPlace(config_file=config_file,network_path=network_path,snudda_data=snudda_data)"
self.d_view.execute(cmd_str, block=True)

#import pdb
#pdb.set_trace()

cmd_str = f"sp = SnuddaPlace(config_file={self.config_file},network_path={self.network_path},snudda_data={self.snudda_data})"
self.d_view.execute(cmd_str)
cmd_str3 = f"modified_neurons = sp.avoid_edges_helper(bend_neuron_info=bend_neuron_info)"
self.d_view.execute(cmd_str3)
cmd_str3 = f"modified_neurons = SnuddaPlace.avoid_edges_helper(bend_neuron_info=bend_neuron_info, network_path=network_path)"
self.d_view.execute(cmd_str3, block=True)

modified_neurons = self.d_view.gather("modified_neurons", block=True)

Expand All @@ -608,12 +619,7 @@ def avoid_edges_parallel(self):
self.neurons[neuron_id].swc_filename = new_morphology
self.neurons[neuron_id].rotation = np.eye(3)

def avoid_edges(self, neuron_id=None, neuron_random_seeds=None):

neuron_name = [n.name for n in self.neurons]

SnuddaPlace.avoid_edges_helper(neuron_id, )

@staticmethod
def avoid_edges_helper(bend_neuron_info, network_path):

# TODO: We need name, swc_file, position, rotation
Expand Down

0 comments on commit a882245

Please sign in to comment.