Skip to content

Commit

Permalink
remove parallelism
Browse files Browse the repository at this point in the history
  • Loading branch information
PolarBean authored Dec 7, 2024
1 parent 62ca3ec commit 1f10af7
Showing 1 changed file with 18 additions and 43 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,6 @@
"hippocampus": 1004,
"diencephalon": 1005,
}
PARALLEL = False
acronym_dict = {
"diencephalon": {
"mfb": "Medial forebrain bundle",
Expand Down Expand Up @@ -794,49 +793,25 @@ def retrieve_or_construct_meshes(annotated_volume, structures):

smooth = False
start = time.time()
if PARALLEL:
pool = mp.Pool(mp.cpu_count() - 2)

try:
pool.map(
create_region_mesh,
[
(
meshes_dir_path,
node,
tree,
labels,
annotated_volume,
ROOT_ID,
closing_n_iters,
decimate_fraction,
smooth,
)
for node in tree.nodes.values()
],
)
except mp.pool.MaybeEncodingError:
# error with returning results from pool.map but we don't care
pass
else:
for node in track(
tree.nodes.values(),
total=tree.size(),
description="Creating meshes",
):
create_region_mesh(
(
meshes_dir_path,
node,
tree,
labels,
annotated_volume,
ROOT_ID,
closing_n_iters,
decimate_fraction,
smooth,
)

for node in track(
tree.nodes.values(),
total=tree.size(),
description="Creating meshes",
):
create_region_mesh(
(
meshes_dir_path,
node,
tree,
labels,
annotated_volume,
ROOT_ID,
closing_n_iters,
decimate_fraction,
smooth,
)
)

print(
"Finished mesh extraction in: ",
Expand Down

0 comments on commit 1f10af7

Please sign in to comment.