mirror of
https://github.com/seanwhe/xmrig-bash-scripts.git
synced 2024-11-28 05:26:22 +03:00
better calculate number of threads to use
This commit is contained in:
parent
7837c86a98
commit
097d5a426a
@ -50,9 +50,13 @@ check_cpu () {
|
||||
}
|
||||
|
||||
calc_threads () {
|
||||
# Each thread needs 2048 byte (2 Megabyte)
|
||||
# Calculate number of threads supported with L3 cache size
|
||||
|
||||
_ENV_THREAD_QTY=$(( ($_ENV_CORE_L3/2048)/1000 ))
|
||||
|
||||
# Affine number of threads for _CPU_CN
|
||||
_COUNTER="$(( $_ENV_CORE-1 ))"
|
||||
_COUNTER="$(( $_ENV_THREAD_QTY-1 ))"
|
||||
|
||||
_ENV_CPU_THREAD_AFFINITY="$(seq -s " " 0 $_COUNTER)"
|
||||
|
||||
@ -69,7 +73,7 @@ calc_hugepages () {
|
||||
sudo sysctl -p
|
||||
else
|
||||
# Set value in current env
|
||||
sudo sysctl -w vm.nr_hugepages="$_ENV_CORE"
|
||||
sudo sysctl -w vm.nr_hugepages="$_ENV_THREAD_QTY"
|
||||
# Add value to sysctl
|
||||
sudo sysctl -p
|
||||
fi
|
||||
|
@ -1,11 +1,11 @@
|
||||
#!/bin/bash
|
||||
|
||||
_DEBUG=true
|
||||
_DEBUG=$1
|
||||
|
||||
if $_DEBUG; then
|
||||
set -x
|
||||
else
|
||||
set +x
|
||||
else
|
||||
set -x
|
||||
fi
|
||||
|
||||
# Set that user passwdless sudo
|
||||
|
Loading…
Reference in New Issue
Block a user