From 66066d52202ecaf47f843aa647e6623b0478ac37 Mon Sep 17 00:00:00 2001 From: helloworld664 <3226476857@qq.com> Date: Sat, 19 Apr 2025 16:15:57 +0800 Subject: [PATCH] add HPC Benchmarks --- benchmark/hpcg/run.sh | 64 +++++++++++++++++++++++++++++++ benchmark/hpl/run.sh | 70 ++++++++++++++++++++++++++++++++++ benchmark/ior/run.sh | 72 +++++++++++++++++++++++++++++++++++ benchmark/osu/run.sh | 71 ++++++++++++++++++++++++++++++++++ benchmark/stream/run.sh | 65 +++++++++++++++++++++++++++++++ benchmark/vdbench/8k_randread | 19 +++++++++ benchmark/vdbench/readme | 14 +++++++ benchmark/vdbench/run.sh | 68 +++++++++++++++++++++++++++++++++ 8 files changed, 443 insertions(+) create mode 100644 benchmark/hpcg/run.sh create mode 100644 benchmark/hpl/run.sh create mode 100644 benchmark/ior/run.sh create mode 100644 benchmark/osu/run.sh create mode 100644 benchmark/stream/run.sh create mode 100644 benchmark/vdbench/8k_randread create mode 100644 benchmark/vdbench/readme create mode 100644 benchmark/vdbench/run.sh diff --git a/benchmark/hpcg/run.sh b/benchmark/hpcg/run.sh new file mode 100644 index 0000000..a17006c --- /dev/null +++ b/benchmark/hpcg/run.sh @@ -0,0 +1,64 @@ +#!/bin/bash +#set -x +np=`nproc` +download_dir=${JARVIS_DOWNLOAD} +run_dir=$JARVIS_ROOT/bench_run +download(){ + . ${DOWNLOAD_TOOL} -u https://mirrors.huaweicloud.com/kunpeng/archive/HPC/benchmark/Benchmark24.0.0.sif +} + + +check(){ + + + #if ! $CHECK_DEPS gcc singularity; then + if ! type singularity >/dev/null 2>&1; then + echo "==================请检查当前环境是否已经加载singularity==================" + exit 1 + fi + if ! type mpicc >/dev/null 2>&1;then + echo "==================请检查当前环境是否已经加载mpi==================" + exit 1 + fi + if ! echo `mpicc -v 2>&1` | grep -i "Bisheng";then + echo "==================请检查当前mpi是否由毕昇编译器编译生成==================" + fi +} + +check_file(){ + if [ "$#" -ne 1 ];then + echo "Usage: check_file " + return 1 + fi + local dir=$JARVIS_ROOT + local filename=$1 + + if [ ! -d "$dir" ];then + echo "Directory '$dir' does not exist" + return 1 + fi + + if [ ! -e "$dir/$filename" ];then + echo "File '$dir/$filename' does not exist" + return 1 + fi +} + + + +hpcg_test(){ + mkdir -p $run_dir + if ! check_file "hostfile";then + echo "==================hpcg_test测试:缺少hostfile文件,请在$JARVIS_ROOT下编写hostfile==================" + return 1 + fi + cd ${run_dir} + singularity run ${download_dir}/Benchmark24.0.0.sif cat /hpcrunner/tools/hpcg/hpcg.dat > ${run_dir}/hpcg.dat + mpirun --allow-run-as-root -map-by ppr:$((np/8)):node:pe=8 --hostfile $JARVIS_ROOT/hostfile -x OMP_WAIT_POLICY=active -x OMP_DISPLAY_ENV=true -x OMP_DISPLAY_AFFINITY=true -x OMP_PLACES=cores -x OMP_PROC_BIND=close -x UCX_TLS=self,sm,rc -x UCX_NET_DEVICES=mlx5_0:1 singularity exec --bind=${PWD} ${download_dir}/Benchmark24.0.0.sif xhpcg +} + + +download +check +hpcg_test + diff --git a/benchmark/hpl/run.sh b/benchmark/hpl/run.sh new file mode 100644 index 0000000..0a1c855 --- /dev/null +++ b/benchmark/hpl/run.sh @@ -0,0 +1,70 @@ +#!/bin/bash +#set -x +np=`nproc` +download_dir=${JARVIS_DOWNLOAD} +run_dir=$JARVIS_ROOT/bench_run +download(){ + . ${DOWNLOAD_TOOL} -u https://mirrors.huaweicloud.com/kunpeng/archive/HPC/benchmark/Benchmark24.0.0.sif +} + + +check(){ + + if ! type singularity >/dev/null 2>&1; then + echo "==================请检查当前环境是否已经加载singularity==================" + exit 1 + fi + if ! type mpicc >/dev/null 2>&1;then + echo "==================请检查当前环境是否已经加载mpi==================" + exit 1 + fi + if ! echo `mpicc -v 2>&1` | grep -i "Bisheng";then + echo "==================请检查当前mpi是否由毕昇编译器编译生成==================" + fi +} + +check_file(){ + if [ "$#" -ne 1 ];then + echo "Usage: check_file " + return 1 + fi + local dir=$JARVIS_ROOT + local filename=$1 + + if [ ! -d "$dir" ];then + echo "Directory '$dir' does not exist" + return 1 + fi + + if [ ! -e "$dir/$filename" ];then + echo "File '$dir/$filename' does not exist" + return 1 + fi +} + + +hpl_test(){ + mkdir -p $run_dir + #根据核数生成HPL.dat + if [[ np -eq 160 ]];then + singularity run ${download_dir}/Benchmark24.0.0.sif cat /hpcrunner/tools/hpl/open/HPL.dat > $run_dir/HPL.dat + else + singularity run ${download_dir}/Benchmark24.0.0.sif cat /hpcrunner/tools/hpl/optimize/HPL.dat > $run_dir/HPL.dat + fi + + #单节点 + mpirun --allow-run-as-root -np $((np/4)) -mca pml ucx -mca btl ^vader,tcp,openib -mca io romio321 -x UCX_TLS=self,sm,rc_x -x UCX_NET_DEVICES=mlx5_0:1 -x OMP_NUM_THREADS=4 -x OMP_WAIT_POLICY=active -x OMP_PLACES=cores -x OMP_PROC_BIND=close -map-by ppr:$((np/16)):numa:pe=4 singularity exec --bind=$run_dir --pwd=$run_dir ${download_dir}/Benchmark24.0.0.sif xhpl + + #多节点 + if ! check_file "hostfile";then + echo "==================hpl多节点测试:缺少hostfile文件,请在$JARVIS_ROOT下编写hostfile==================" + return 1 + fi + #\cp $JARVIS_ROOT/hostfile $run_dir + node_num=`grep -v "^$" $JARVIS_ROOT/hostfile | wc -l` + mpirun --allow-run-as-root -np $((np*node_num/4)) -N $((np/4)) --hostfile $JARVIS_ROOT/hostfile -mca pml ucx -mca btl ^vader,tcp,openib -mca io romio321 -x UCX_TLS=self,sm,rc_x -x UCX_NET_DEVICES=mlx5_0:1 -x PATH -x LD_LIBRARY_PATH -x OMP_NUM_THREADS=4 -x OMP_WAIT_POLICY=active -x OMP_PLACES=cores -x OMP_PROC_BIND=close -map-by ppr:$((np/16)):numa:pe=4 singularity exec --bind=$run_dir --pwd=$run_dir ${download_dir}/Benchmark24.0.0.sif xhpl +} + +download +check +hpl_test diff --git a/benchmark/ior/run.sh b/benchmark/ior/run.sh new file mode 100644 index 0000000..2b97912 --- /dev/null +++ b/benchmark/ior/run.sh @@ -0,0 +1,72 @@ +#!/bin/bash +set -x +np=`nproc` +download_dir=${JARVIS_DOWNLOAD} +dpc_dir=${dpc_dir:=/workspace} +run_dir=$JARVIS_ROOT/bench_run +download(){ + . ${DOWNLOAD_TOOL} -u https://mirrors.huaweicloud.com/kunpeng/archive/HPC/benchmark/Benchmark24.0.0.sif +} + + +check(){ + + + #if ! $CHECK_DEPS gcc singularity; then + if ! type singularity >/dev/null 2>&1; then + echo "==================请检查当前环境是否已经加载singularity==================" + exit 1 + fi + if ! type mpicc >/dev/null 2>&1;then + echo "==================请检查当前环境是否已经加载mpi==================" + exit 1 + fi + if ! echo `mpicc -v 2>&1` | grep -i "Bisheng";then + echo "==================请检查当前mpi是否由毕昇编译器编译生成==================" + fi +} + +check_file(){ + if [ "$#" -ne 1 ];then + echo "Usage: check_file " + return 1 + fi + local dir=$JARVIS_ROOT + local filename=$1 + + if [ ! -d "$dir" ];then + echo "Directory '$dir' does not exist" + return 1 + fi + + if [ ! -e "$dir/$filename" ];then + echo "File '$dir/$filename' does not exist" + return 1 + fi +} + + + +ior_test(){ + #单节点 + mkdir -p $run_dir + echo "当前DPC挂载目录设置为$dpc_dir,如需修改,可通过export dpc_dir=...指定其他目录" + mkdir -p ${dpc_dir}/test_data/ior + mpirun --allow-run-as-root -np 1 -mca pml ucx -mca btl ^vader,tcp,openib,uct -mca io romio321 -x UCX_TLS=self,sm,rc -x UCX_NET_DEVICES=mlx5_0:1 singularity exec --bind=${dpc_dir} ${download_dir}/Benchmark24.0.0.sif ior -i 3 -w -r -t 1M -b 1024g -F -e -k -o ${dpc_dir}/test_data/ior/ior1M1T1.data + rm -rf ${dpc_dir}/test_data/ior/ior1M1T1.data + mpirun --allow-run-as-root -np 8 -mca pml ucx -mca btl ^vader,tcp,openib,uct -mca io romio321 -x UCX_TLS=self,sm,rc -x UCX_NET_DEVICES=mlx5_0:1 singularity exec --bind=${dpc_dir} ${download_dir}/Benchmark24.0.0.sif ior -i 3 -w -r -t 1M -b 128g -F -e -k -o ${dpc_dir}/test_data/ior/ior1M1T8P.data + rm -rf ${dpc_dir}/test_data/ior/ior1M1T8P.data + #多节点 + if ! check_file "hostfile";then + echo "==================ior多节点测试:缺少hostfile文件,请在$JARVIS_ROOT下编写hostfile==================" + return 1 + fi + + mpirun --allow-run-as-root -N 8 -hostfile hostfile -x LD_LIBRARY_PATH -x PATH -mca pml ucx -mca btl ^vader,tcp,openib,uct -mca io romio321 -x UCX_TLS=self,sm,rc -x UCX_NET_DEVICES=mlx5_0:1 singularity exec --bind=${dpc_dir} ${download_dir}/Benchmark24.0.0.sif ior -i 3 -w -r -t 1M -b 16g -F -e -k -o ${dpc_dir}/test_data/ior/ior1M1T8P8N.data + rm -rf ${dpc_dir}/test_data/ior/ior1M1T8P8N.data +} + + +download +check +ior_test diff --git a/benchmark/osu/run.sh b/benchmark/osu/run.sh new file mode 100644 index 0000000..f3e6212 --- /dev/null +++ b/benchmark/osu/run.sh @@ -0,0 +1,71 @@ +#!/bin/bash +#set -x +np=`nproc` +download_dir=${JARVIS_DOWNLOAD} +run_dir=$JARVIS_ROOT/bench_run +download(){ + . ${DOWNLOAD_TOOL} -u https://mirrors.huaweicloud.com/kunpeng/archive/HPC/benchmark/Benchmark24.0.0.sif +} + + +check(){ + + + if ! type singularity >/dev/null 2>&1; then + echo "==================请检查当前环境是否已经加载singularity==================" + exit 1 + fi + if ! type mpicc >/dev/null 2>&1;then + echo "==================请检查当前环境是否已经加载mpi==================" + exit 1 + fi + if ! echo `mpicc -v 2>&1` | grep -i "Bisheng";then + echo "==================请检查当前mpi是否由毕昇编译器编译生成==================" + fi +} + +check_file(){ + if [ "$#" -ne 1 ];then + echo "Usage: check_file " + return 1 + fi + local dir=$JARVIS_ROOT + local filename=$1 + + if [ ! -d "$dir" ];then + echo "Directory '$dir' does not exist" + return 1 + fi + + if [ ! -e "$dir/$filename" ];then + echo "File '$dir/$filename' does not exist" + return 1 + fi +} + + +osu_test(){ + #单节点 + if ! check_file "rankfile";then + echo "==================osu测试:缺少rankfile文件,请在$JARVIS_ROOT下编写rankfile==================" + return 1 + fi + + mpirun --allow-run-as-root -np 2 --rankfile $JARVIS_ROOT/rankfile -x PATH -x LD_LIBRARY_PATH -mca pml ucx -mca btl ^vader,tcp,openib,uct -x UCX_TLS=rc_x --bind-to core -x UCX_RNDV_THRESH=64k -x UCX_NET_DEVICES=mlx5_0:1 singularity exec ${download_dir}/Benchmark24.0.0.sif osu_bw -i 5000 -W 128 + + mpirun --allow-run-as-root -np 2 --rankfile $JARVIS_ROOT/rankfile -x PATH -x LD_LIBRARY_PATH -mca pml ucx -mca btl ^vader,tcp,openib,uct -x UCX_TLS=rc_x --bind-to core -x UCX_RNDV_THRESH=64k -x UCX_NET_DEVICES=mlx5_0:1 singularity exec ${download_dir}/Benchmark24.0.0.sif osu_latency -i 1000 + + #多节点 + if ! check_file "hostfile";then + echo "==================osu多节点测试:缺少hostfile文件,请在$JARVIS_ROOT下编写hostfile==================" + return 1 + fi + + mpirun --allow-run-as-root -N $np -hostfile $JARVIS_ROOT/hostfile -x PATH -x LD_LIBRARY_PATH -mca pml ucx -mca btl ^vader,tcp,openib,uct -x UCX_TLS=self,sm,rc -x UCX_NET_DEVICES=mlx5_0:1 singularity exec ${download_dir}/Benchmark24.0.0.sif osu_bcast -i 1000 + + mpirun --allow-run-as-root -N $np -hostfile $JARVIS_ROOT/hostfile -x PATH -x LD_LIBRARY_PATH -mca pml ucx -mca btl ^vader,tcp,openib,uct -x UCX_TLS=self,sm,rc -x UCX_NET_DEVICES=mlx5_0:1 singularity exec ${download_dir}/Benchmark24.0.0.sif osu_alltoall -i 1000 +} + +download +check +osu_test diff --git a/benchmark/stream/run.sh b/benchmark/stream/run.sh new file mode 100644 index 0000000..d162d8f --- /dev/null +++ b/benchmark/stream/run.sh @@ -0,0 +1,65 @@ +#!/bin/bash +#set -x +np=`nproc` +download_dir=${JARVIS_DOWNLOAD} +run_dir=$JARVIS_ROOT/bench_run +download(){ + . ${DOWNLOAD_TOOL} -u https://mirrors.huaweicloud.com/kunpeng/archive/HPC/benchmark/Benchmark24.0.0.sif +} + + +check(){ + + + #if ! $CHECK_DEPS gcc singularity; then + if ! type singularity >/dev/null 2>&1; then + echo "==================请检查当前环境是否已经加载singularity==================" + exit 1 + fi + if ! type mpicc >/dev/null 2>&1;then + echo "==================请检查当前环境是否已经加载mpi==================" + exit 1 + fi + if ! echo `mpicc -v 2>&1` | grep -i "Bisheng";then + echo "==================请检查当前mpi是否由毕昇编译器编译生成==================" + fi +} + +check_file(){ + if [ "$#" -ne 1 ];then + echo "Usage: check_file " + return 1 + fi + local dir=$JARVIS_ROOT + local filename=$1 + + if [ ! -d "$dir" ];then + echo "Directory '$dir' does not exist" + return 1 + fi + + if [ ! -e "$dir/$filename" ];then + echo "File '$dir/$filename' does not exist" + return 1 + fi +} + + + +stream_test(){ + mkdir -p $run_dir + if ! type tuned-adm >/dev/null 2>&1;then + echo "==================stream测试:安装tuned==================" + . $CHECK_ROOT && yum install -y tuned + fi + #tuned-adm profile throughput-performance + cd $run_dir + tuned-adm profile throughput-performance + singularity run ${download_dir}/Benchmark24.0.0.sif stream.sh +} + + +download +check +stream_test + diff --git a/benchmark/vdbench/8k_randread b/benchmark/vdbench/8k_randread new file mode 100644 index 0000000..a7a32a9 --- /dev/null +++ b/benchmark/vdbench/8k_randread @@ -0,0 +1,19 @@ +hd=default,vdbench=/share/software/tools/vdbench,user=root,shell=ssh +hd=hostname001,system=hostname001 +hd=hostname002,system=hostname002 +hd=hostname003,system=hostname003 +hd=hostname004,system=hostname004 + +fsd=fsd1,anchor=/workspace/vdtest/1,depth=1,width=10,files=200,size=20m +fsd=fsd2,anchor=/workspace/vdtest/2,depth=1,width=10,files=200,size=20m +fsd=fsd3,anchor=/workspace/vdtest/3,depth=1,width=10,files=200,size=20m +fsd=fsd4,anchor=/workspace/vdtest/4,depth=1,width=10,files=200,size=20m + +fwd=format,xfersize=8k,fileio=random,fileselect=random,threads=128 + +fwd=fwd1,fsd=fsd1,operation=read,threads=128,host=hostname001,xfersize=8k,fileio=random,fileselect=random +fwd=fwd2,fsd=fsd2,operation=read,threads=128,host=hostname002,xfersize=8k,fileio=random,fileselect=random +fwd=fwd3,fsd=fsd3,operation=read,threads=128,host=hostname003,xfersize=8k,fileio=random,fileselect=random +fwd=fwd4,fsd=fsd4,operation=read,threads=128,host=hostname004,xfersize=8k,fileio=random,fileselect=random + +rd=rd1,fwd=(fwd*),fwdrate=max,format=restart,elapsed=300,interval=1,warmup=30 diff --git a/benchmark/vdbench/readme b/benchmark/vdbench/readme new file mode 100644 index 0000000..6d20d05 --- /dev/null +++ b/benchmark/vdbench/readme @@ -0,0 +1,14 @@ + hd、system、host指定参数为主机名,请用户根据实际规划修改 + vdbench指定参数为执行测试路径,请用户根据实际规划修改 + anchor表明在哪个路径下创建新的目录结构,通常情况为DPC挂载路径,请用户根据实际规划修改 + depth为目录的深度 + width是每一层目录的数量 + files为目录下面文件的数量 + size是文件大小 + fileio、fileselect表示文件操作方式,分为sequential和random + operation表示最终操作,分为read、write、create + threads为format的线程数 + xfersize是步长,相当于blocksize,没有这一行也行,format默认是64k + fwdrate是每秒的操作数,max表示不做限制,按最大强度自适应,也可以设置指定大小或递增变化 + format是文件预处理参数,有三个选项,“no”是不改变当前文件,如operation=read但指定目录中没有文件,则不运行;“yes”会删除当前的目录结构,重新按照fsd的要求来生成新的目录结构,并初始化文件到size的大小;“restart”仅创建尚未创建的文件,并将文件扩展到适当的大小 + interval是结果输出间隔,每秒输出一次 diff --git a/benchmark/vdbench/run.sh b/benchmark/vdbench/run.sh new file mode 100644 index 0000000..f5447f2 --- /dev/null +++ b/benchmark/vdbench/run.sh @@ -0,0 +1,68 @@ +#!/bin/bash +set -x +np=`nproc` +download_dir=${JARVIS_DOWNLOAD} +run_dir=$JARVIS_ROOT/bench_run +download(){ + . ${DOWNLOAD_TOOL} -u https://mirrors.huaweicloud.com/kunpeng/archive/HPC/benchmark/Benchmark24.0.0.sif +} + + +check(){ + + + #if ! $CHECK_DEPS gcc singularity; then + if ! type singularity >/dev/null 2>&1; then + echo "==================请检查当前环境是否已经加载singularity==================" + exit 1 + fi + if ! type mpicc >/dev/null 2>&1;then + echo "==================请检查当前环境是否已经加载mpi==================" + exit 1 + fi + if ! echo `mpicc -v 2>&1` | grep -i "Bisheng";then + echo "==================请检查当前mpi是否由毕昇编译器编译生成==================" + fi +} + +check_file(){ + if [ "$#" -ne 1 ];then + echo "Usage: check_file " + return 1 + fi + local dir=$JARVIS_ROOT + local filename=$1 + + if [ ! -d "$dir" ];then + echo "Directory '$dir' does not exist" + return 1 + fi + + if [ ! -e "$dir/$filename" ];then + echo "File '$dir/$filename' does not exist" + return 1 + fi +} + + +vdbench_test(){ + if ! type java >/dev/null 2>&1;then + echo "==================vdbench测试:安装java==================" + . $CHECK_ROOT && yum install -y java-1.8.0 + fi + if ! check_file "8k_randread";then + echo "==================hpcg_test测试:缺少8k_randread文件,请在$JARVIS_ROOT下编写8k_randread==================" + return 1 + fi + mkdir -p ${run_dir} + singularity run -B ${run_dir}:/root --pwd=${run_dir} ${download_dir}/Benchmark24.0.0.sif cp -r /hpcrunner/tools/vdbench ./ + cd ${run_dir}/vdbench + \cp $JARVIS_ROOT/8k_randread ./ + ./vdbench -f 8k_randread +} + + +download +check +vdbench_test + -- Gitee