5 Star 25 Fork 0

hpc4you / linux

加入 Gitee
与超过 1200万 开发者一起发现、参与优秀开源项目,私有仓库也完全免费 :)
免费加入
克隆/下载
pi.sh 845 Bytes
一键复制 编辑 原始数据 按行查看 历史
hpc4you 提交于 2021-04-13 09:54 . add pi.sh.
#!/bin/bash
## to burn all cpu cores with SuperPI.
## how to?
# timeout 5h bash pi.sh
# default for 5 hours.
# get CPU number
cpu_num=`cat /proc/cpuinfo | grep 'processor' | wc -l `
# export x=${cpu_num}
export x=$((${cpu_num}*5))
echo -e "I will start \033[1;31m ${x}\033[0;35m\033[0m threads to run SuperPI."
echo -e "\033[1;31mNeeds several hours, maybe. \033[0;35m\033[0m"
echo -e "\033[1;32mPress Enter to continue. \033[0;35m\033[0m"
echo -e "\033[1;33mReboot server to stop SuperPI, \033[0;35m\033[0m"
echo -e "Or run \033[1;34m pkill -9 bc \033[0;35m\033[0m as root user."
echo -e "\033[1;30mIf your server dies in the first 30 minutes, then ask the seller for money back.\033[0;35m\033[0m"
while [ ${x} -gt 0 ]
do
echo "scale = 80000 ; 4*a(1)" | bc -l -q > /dev/null 2>&1 &
x=$((${x}-1))
done
Shell
1
https://gitee.com/hpc4you/linux.git
git@gitee.com:hpc4you/linux.git
hpc4you
linux
linux
master

搜索帮助