[refactor] Use nproc to calculate number of cpu cores

This commit is contained in:
William Wernert
2020-04-22 14:48:52 -04:00
parent 212e57a16c
commit 8404453cec

View File

@@ -3,7 +3,7 @@
total_mem=$(grep MemTotal /proc/meminfo | awk '{print $2}' | sed -r 's/.{3}$//')
export total_mem
num_cpu_cores=$(grep -c "processor" /proc/cpuinfo | grep -v "KVM")
num_cpu_cores=$(nproc)
export num_cpu_cores
readarray -t cpu_core_list <<< "$(grep "processor" /proc/cpuinfo | grep -v "KVM" | awk '{print $3 ""}')"