Skip to content
This repository was archived by the owner on Nov 17, 2025. It is now read-only.

Commit aedaf2d

Browse files
authored
Merge pull request #28 from AllenCellModeling/slurm_dask_update
Slurm dask update
2 parents 33ee882 + ed5f788 commit aedaf2d

File tree

6 files changed

+21
-64
lines changed

6 files changed

+21
-64
lines changed

mti_nma/bin/all.py

Lines changed: 14 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -107,23 +107,31 @@ def run(
107107
# Create or get log dir
108108
# Do not include ms
109109
log_dir_name = datetime.now().isoformat().split(".")[0]
110-
log_dir = Path(f"~/.dask_logs/mti_nma/{log_dir_name}").expanduser()
110+
log_dir = Path(f".dask_logs/{log_dir_name}").expanduser()
111111
# Log dir settings
112-
log_dir.mkdir(parents=True)
112+
log_dir.mkdir(parents=True, exist_ok=True)
113+
114+
# Configure dask config
115+
dask.config.set(
116+
{
117+
"scheduler.work-stealing": False,
118+
"logging.distributed.worker": "info",
119+
}
120+
)
113121

114122
# Create cluster
115123
log.info("Creating SLURMCluster")
116124
cluster = SLURMCluster(
117-
cores=1,
118-
memory="8GB",
125+
cores=4,
126+
memory="20GB",
119127
queue="aics_cpu_general",
120128
walltime="10:00:00",
121129
local_directory=str(log_dir),
122-
log_directory=str(log_dir)
130+
log_directory=str(log_dir),
123131
)
124132
log.info("Created SLURMCluster")
125133

126-
# Scale workers
134+
# Scale cluster
127135
cluster.scale(60)
128136

129137
# Use the port from the created connector to set executor address

mti_nma/steps/dask_utils.py

Lines changed: 0 additions & 52 deletions
This file was deleted.

mti_nma/steps/nma/nma.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -10,7 +10,7 @@
1010
from vtk.util import numpy_support
1111

1212
from datastep import Step, log_run_params
13-
from .. import dask_utils
13+
import aics_dask_utils
1414
from .nma_utils import get_vtk_verts_faces, run_nma, draw_whist, get_eigvec_mags
1515
from .nma_utils import color_vertices_by_magnitude
1616

@@ -205,7 +205,7 @@ def run(
205205
path_input_mesh = avg_df["AvgShapeFilePathStl"].iloc[0]
206206

207207
# Distribute blender mode heatmap generation
208-
with dask_utils.DistributedHandler(distributed_executor_address) as handler:
208+
with aics_dask_utils.DistributedHandler(distributed_executor_address) as handler:
209209
futures = handler.client.map(
210210
color_vertices_by_magnitude,
211211
[path_blender for i in range(len(mode_list))],

mti_nma/steps/shparam/shparam.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111

1212
from datastep import Step, log_run_params
1313

14-
from .. import dask_utils
14+
import aics_dask_utils
1515

1616
###############################################################################
1717

@@ -157,7 +157,7 @@ def run(
157157
self.manifest = pd.DataFrame([])
158158

159159
# Process each cell in the dataframe
160-
with dask_utils.DistributedHandler(distributed_executor_address) as handler:
160+
with aics_dask_utils.DistributedHandler(distributed_executor_address) as handler:
161161
futures = handler.client.map(
162162
self._process_cell,
163163
# Convert dataframe iterrows into two lists of items to iterate over

mti_nma/steps/singlecell/singlecell.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
from aicsimageio import AICSImage, writers
1313
from datastep import Step, log_run_params
1414

15-
from .. import dask_utils
15+
import aics_dask_utils
1616
from .singlecell_utils import crop_object, query_data_from_labkey
1717

1818
###############################################################################
@@ -181,7 +181,7 @@ def run(
181181
df = df.sample(n=nsamples)
182182

183183
# Process each FOV in dataframe
184-
with dask_utils.DistributedHandler(distributed_executor_address) as handler:
184+
with aics_dask_utils.DistributedHandler(distributed_executor_address) as handler:
185185
futures = handler.client.map(
186186
self._process_fov,
187187
# Convert dataframe iterrows into two lists of items to iterate over

setup.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -45,6 +45,7 @@
4545
]
4646

4747
requirements = [
48+
"aics_dask_utils==0.1.0",
4849
"aicsimageio>=3.1.2",
4950
"aicsshparam>=0.0.7",
5051
"bokeh",

0 commit comments

Comments
 (0)