Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 6 additions & 3 deletions Utilities/Tools/jobutils2.sh
Original file line number Diff line number Diff line change
Expand Up @@ -395,10 +395,13 @@ getNumberOfPhysicalCPUCores() {
fi
else
# Do something under GNU/Linux platform
CORESPERSOCKET=`lscpu | grep "Core(s) per socket" | awk '{print $4}'`
SOCKETS=`lscpu | grep "Socket(s)" | awk '{print $2}'`
#
# Gets the cores per socket by counting unique cores on socket 0.
# Gets sockets by counting unique socket ids. The grepping is done in any case to avoid matching comments.
CORESPERSOCKET=$(lscpu -p=cpu,socket | grep "^[0-9]\+,0" | sort | uniq | wc -l)
SOCKETS=$(lscpu -p=socket | grep -e "^[0-9]" | sort | uniq | wc -l)
fi
N=`bc <<< "${CORESPERSOCKET}*${SOCKETS}"`
N=$((${CORESPERSOCKET}*${SOCKETS}))
echo "${N}"
}

Expand Down