huangyh09 / brie

BRIE: Bayesian Regression for Isoform Estimate in Single Cells
https://brie.readthedocs.io
Apache License 2.0
41 stars 15 forks source link

Brie-count Multiprocessing using only 1 core #52

Closed nilcam closed 1 year ago

nilcam commented 1 year ago

Hello,

When I run brie-count, several processes are spawned but only one is actually using the CPU (see screenshot of top output). If I try using the parameter -p or --nproc, brie-count changes it's message [BRIE2] counting reads for 28303 genes in 1 sam files with 8 cores... accordingly, and the correct number of processes are spawned; but only one is actually doing something. I'm trying to process smartseq data, so the problematic function is probably get_smartseq_matrix. I've tried using the multiprocessing package with a stress test and it worked correctly (ie. all spawned processed were using 100% CPU). Any help would be appreciated.

image

huangyh09 commented 1 year ago

Hi,

Thanks for sharing this issue. In brie-count, it supports multiple processes but only in parallel for cells (i.e., multiple bams for smart-seq or multiple cell barcodes for 10x genomics). In your case, it looks like there is only one bam, so providing -p larger than 1 won't result in parallel computing here. If you have multiple bam files, you can input them together and use -p for parallel computing.

Yuanhua

nilcam commented 1 year ago

Hi Yuanhua, thanks for your response. You're right, I have a single combined bam with all the cells.