Detect number of cores

This commit is contained in:
Eric Coissac
2025-05-24 08:46:13 +02:00
parent 534c5c74a8
commit c5b92799b1
2 changed files with 8 additions and 2 deletions

View File

@ -22,6 +22,12 @@
THIS_DIR="$(dirname ${BASH_SOURCE[0]})"
source "${THIS_DIR}/../../../scripts/bash_init.sh"
if [[ -z "$ANNOT_MAXCPU" ]] ; then
Threads=$(nproc)
else
Threads=$ANNOT_MAXCPU
fi
needarg 1
Fasta=$1; shift
@ -74,7 +80,7 @@ if [[ "$cdsdetection_pass1" == "yes" ]] ; then
echo tcsh -f $PROG_DIR/do_exonerate.csh Pass1 $Fasta $f $AnnotFile $DbRoot/models $temp
done
fi
done ) | parallel -j 8
done ) | parallel -j $Threads
mv $temp/genome.cds.fasta $Genome.cds_pass1.fasta
fi
@ -103,7 +109,7 @@ if [[ "$cdsdetection_pass3" == "yes" ]] ; then
echo tcsh -f $PROG_DIR/do_exonerate.csh Pass3 $Fasta $f $AnnotFile $DbRoot/models $temp
done
fi
done) | parallel -j 8
done) | parallel -j $Threads
mv $temp/genome.cds.fasta $Genome.cds_pass2.fasta
fi