@badgunt3r GNU parallel é a forma mais elegante: parallel -j12 comando ::: entradas
Pra algo mais simples, xargs -P 12 ou laçar jobs com & e usar wait no fim do bloco
O SO deixa usar todos os cores, mas o script precisa criar os processos explicitamente pra aproveitar cada um
New release of #GNU Parallel https://t.co/kA6zMCqLfa
New in this release https://t.co/FbZhTpFFc0
See the intro videos https://t.co/x8Rzap1o2I
10 secs installation: https://t.co/hW0YTAp83H
GNU Parallel - for people who live life in the parallel lane.
@tangming2005 Personally I prefer computing the R2 name from the R1 name. This way if one is missing thing are not messed up.
parallel -j 4 "bwa mem ref.fa {} {=s/_R1/_R2/=} > {/.}.sam" ::: *_R1.fastq
@tangming2005 Almost: The above will run all combinations. That is not what you want. You want the 4th R1.fq to be run with the 4th R2.fq. So add a +
parallel -j 4 "bwa mem ref.fa {1} {2} > {1/.}.sam" ::: *_R1.fastq :::+ *_R2.fastq
>>
5/ What Does GNU parallel Do?
Unlike xargs, parallel intelligently distributes tasks across available CPU cores.
📌 Example: Run bwa mem on multiple samples in parallel
ls *.fastq | parallel -j 8 "bwa mem ref.fa {} > {.}.sam"