Commit c989a6d
refactor: replace multiprocessing.Pool with ThreadPoolExecutor in process_single_position
The transform functions passed to process_single_position (numpy, scipy,
PyTorch, ANTsPy) all release the GIL, making threads sufficient for
parallelism. ThreadPoolExecutor avoids the overhead of spawn-based
multiprocessing (re-importing libraries, serializing arguments) and
plays better with Nextflow's per-task resource accounting.
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>1 parent 9beb2a4 commit c989a6d
1 file changed
Lines changed: 10 additions & 12 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
8 | 9 | | |
9 | 10 | | |
10 | 11 | | |
| |||
395 | 396 | | |
396 | 397 | | |
397 | 398 | | |
398 | | - | |
399 | | - | |
400 | | - | |
401 | | - | |
| 399 | + | |
| 400 | + | |
| 401 | + | |
402 | 402 | | |
403 | 403 | | |
404 | 404 | | |
405 | | - | |
406 | | - | |
407 | | - | |
408 | | - | |
409 | | - | |
| 405 | + | |
| 406 | + | |
| 407 | + | |
410 | 408 | | |
411 | | - | |
412 | | - | |
| 409 | + | |
| 410 | + | |
413 | 411 | | |
414 | 412 | | |
415 | 413 | | |
| |||
0 commit comments