- Added warning if hyperthreading is enabled.

master
Asim Jamshed 2018-06-05 09:56:28 -04:00
parent 37a19ffc88
commit 2560098986
3 changed files with 29 additions and 0 deletions

25
.check_hyperthreading.sh Executable file
View File

@ -0,0 +1,25 @@
#!/bin/bash
RED='\033[0;31m'
CYAN='\033[0;36m'
YELLOW='\033[1;33m'
LIGHTRED='\033[1;31m'
NC='\033[0m' # No Color
#str=$(grep -o '^flags\b.*: .*\bht\b' /proc/cpuinfo | tail -1)
nproc=$(grep -i "processor" /proc/cpuinfo | sort -u | wc -l)
phycore=$(cat /proc/cpuinfo | egrep "core id|physical id" | tr -d "\n" | sed s/physical/\\nphysical/g | grep -v ^$ | sort | uniq | wc -l)
if [ -z "$(echo "$phycore *2" | bc | grep $nproc)" ]
then
str=""
else
str="ht-enabled"
fi
if [ "$str" ]
then
printf "${RED}mTCP works best when hyperthreading is DISABLED. Please disable this feature from BIOS.${NC}\n"
fi
printf "${CYAN}Type ${YELLOW}make${CYAN} to compile mTCP ${LIGHTRED}src/${CYAN} and ${LIGHTRED}apps/${CYAN}.${NC}\n"

2
configure vendored
View File

@ -10981,3 +10981,5 @@ if test -n "$ac_unrecognized_opts" && test "$enable_option_checking" != no; then
$as_echo "$as_me: WARNING: unrecognized options: $ac_unrecognized_opts" >&2;}
fi
bash ./.check_hyperthreading.sh

View File

@ -121,3 +121,5 @@ AC_OUTPUT(mtcp/src/Makefile)
AC_OUTPUT(apps/example/Makefile)
AC_OUTPUT(util/Makefile)
AC_OUTPUT(io_engine/lib/Makefile)
bash ./.check_hyperthreading.sh