Debian Codegraph @

debian/bin/raxmlHPC

raw
1 #!/bin/sh
2
3 RAXMLDIR="$(dirname -- "$(readlink -f -- "$0")")"
4 NPROCESSOR=`grep -c 'processor[[:space:]:]\+[0-9]\+' /proc/cpuinfo`
5 NCPUS=`grep '^cpu cores' /proc/cpuinfo | head -n 1 | sed 's/cpu cores[[:space:]:]\+//'`
6 # That's wrong and lasts way longer than when using NCPUS
7 # AVX_T=$((NPROCESSOR * NCPUS))
8 AVX_T=$NCPUS
9
10 if grep -q avx /proc/cpuinfo; then
11 if echo "$@" | grep -q -- '-T[[:space:]]*[0-9]' ; then
12 echo "Use raxml with AVX support with overriden number of threads"
13 ${RAXMLDIR}/raxmlHPC-PTHREADS-AVX "$@"
14 else
15 echo "Use raxml with AVX support ($AVX_T cpus)"
16 ${RAXMLDIR}/raxmlHPC-PTHREADS-AVX -T $AVX_T "$@"
17 fi
18 elif grep -q sse3 /proc/cpuinfo; then
19 if echo "$@" | grep -q -- '-T[[:space:]]*[0-9]' ; then
20 echo "Use raxml with SSE3 support with overriden number of threads"
21 ${RAXMLDIR}/raxmlHPC-PTHREADS-SSE3 "$@"
22 else
23 echo "Use raxml with SSE3 support ($AVX_T cpus)"
24 ${RAXMLDIR}/raxmlHPC-PTHREADS-SSE3 -T $AVX_T "$@"
25 fi
26 else
27 echo "Use raxml with PTHREADS support"
28 ${RAXMLDIR}/raxmlHPC-PTHREADS "$@"
29 fi