Skip to content

Commit

Permalink
constrain number of threads
Browse files Browse the repository at this point in the history
  • Loading branch information
akhanf committed Oct 4, 2024
1 parent 6079e6d commit edea152
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
2 changes: 1 addition & 1 deletion workflow/rules/import.smk
Original file line number Diff line number Diff line change
Expand Up @@ -280,7 +280,7 @@ rule tif_to_zarr_gcs:
),
group:
"preproc"
threads: config["cores_per_rule"]
threads: 8
container:
config["containers"]["spimprep"]
script:
Expand Down
2 changes: 2 additions & 0 deletions workflow/scripts/tif_to_zarr_gcs.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,11 +11,13 @@
from lib.dask_image import imread_pages
import gcsfs
import pyvips
from dask.distributed import Client, LocalCluster

gcsfs_opts={'project': snakemake.params.storage_provider_settings['gcs'].get_settings().project,
'token': snakemake.input.creds}
fs = gcsfs.GCSFileSystem(**gcsfs_opts)

cluster = LocalCluster(n_workers=snakemake.threads, threads_per_worker=1)

def replace_square_brackets(pattern):
"""replace all [ and ] in the string (have to use
Expand Down

0 comments on commit edea152

Please sign in to comment.