Skip to content

Commit

Permalink
- Added warning if hyperthreading is enabled.
Browse files Browse the repository at this point in the history
  • Loading branch information
ajamshed committed Jun 5, 2018
1 parent 37a19ff commit 2560098
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 0 deletions.
25 changes: 25 additions & 0 deletions .check_hyperthreading.sh
Original file line number Diff line number Diff line change
@@ -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 changes: 2 additions & 0 deletions configure
Original file line number Diff line number Diff line change
Expand Up @@ -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
2 changes: 2 additions & 0 deletions configure.ac
Original file line number Diff line number Diff line change
Expand Up @@ -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

0 comments on commit 2560098

Please sign in to comment.