From 001f322eab4c9398dadd1cbddc7b73c628970eb7 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sun, 10 Nov 2024 05:30:26 +0100 Subject: Simplifying calc-max-parallel.sh by using numbers in variables names for ram sizes rather than words. Signed-off-by: Daniel Baumann --- debian/calc-max-parallel.sh | 40 ++++++++++++++++++++-------------------- 1 file changed, 20 insertions(+), 20 deletions(-) diff --git a/debian/calc-max-parallel.sh b/debian/calc-max-parallel.sh index 81e1c8f02..947701c87 100755 --- a/debian/calc-max-parallel.sh +++ b/debian/calc-max-parallel.sh @@ -13,36 +13,36 @@ fi total_ram=$(grep MemTotal /proc/meminfo | awk '{ print $2 }') -fivehundred_g=$((512*1024*1024)) -twohundredtwentysix_g=$((256*1024*1024)) -hundredtwenty_g=$((128*1024*1024)) -nightysix_g=$((96*1024*1024)) -sixtyfour_g=$((64*1024*1024)) -fourtyheight_g=$((48*1024*1024)) -thirtytwo_g=$((32*1024*1024)) -sixteen_g=$((16*1024*1024)) -eight_g=$((8*1024*1024)) -four_g=$((4*1024*1024)) +ram_512gb=$((512*1024*1024)) +ram_256gb=$((256*1024*1024)) +ram_128gb=$((128*1024*1024)) +ram_96gb=$((96*1024*1024)) +ram_64gb=$((64*1024*1024)) +ram_48gb=$((48*1024*1024)) +ram_32gb=$((32*1024*1024)) +ram_16gb=$((16*1024*1024)) +ram_8gb=$((8*1024*1024)) +ram_4gb=$((4*1024*1024)) -if [ ${total_ram} -le ${four_g} ]; then +if [ ${total_ram} -le ${ram_4gb} ]; then echo "--max-parallel=1" -elif [ ${total_ram} -le ${eight_g} ]; then +elif [ ${total_ram} -le ${ram_8gb} ]; then echo "--max-parallel=2" -elif [ ${total_ram} -le ${sixteen_g} ]; then +elif [ ${total_ram} -le ${ram_16gb} ]; then echo "--max-parallel=3" -elif [ ${total_ram} -le ${thirtytwo_g} ]; then +elif [ ${total_ram} -le ${ram_32gb} ]; then echo "--max-parallel=12" -elif [ ${total_ram} -le ${fourtyheight_g} ]; then +elif [ ${total_ram} -le ${ram_48gb} ]; then echo "--max-parallel=20" -elif [ ${total_ram} -le ${sixtyfour_g} ]; then +elif [ ${total_ram} -le ${ram_64gb} ]; then echo "--max-parallel=32" -elif [ ${total_ram} -le ${nightysix_g} ]; then +elif [ ${total_ram} -le ${ram_96gb} ]; then echo "--max-parallel=48" -elif [ ${total_ram} -le ${hundredtwenty_g} ]; then +elif [ ${total_ram} -le ${ram_128gb} ]; then echo "--max-parallel=64" -elif [ ${total_ram} -le ${twohundredtwentysix_g} ]; then +elif [ ${total_ram} -le ${ram_256gb} ]; then echo "--max-parallel=128" -elif [ ${total_ram} -le ${fivehundred_g} ]; then +elif [ ${total_ram} -le ${ram_512gb} ]; then echo "--max-parallel=256" else echo "--max-parallel=512" -- cgit v1.2.3