Skip to content

Commit 495694f

Browse files
committed
fix: do not use more cores than necessary
1 parent 061c4bb commit 495694f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

main/como/rnaseq_gen.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -356,7 +356,7 @@ def zfpkm_transform(
356356

357357
total = len(fpkm_df.columns)
358358
update_per_step: int = int(np.ceil(total * update_every_percent))
359-
cores = multiprocessing.cpu_count() - 2
359+
cores = min(multiprocessing.cpu_count() - 2, total)
360360
logger.debug(f"Processing {total:,} samples through zFPKM transform using {cores} cores")
361361
logger.debug(
362362
f"Will update every {update_per_step:,} steps as this is approximately "

0 commit comments

Comments
 (0)