当前位置: 首页 > news >正文

网络聚合通信测试--自动化测试脚本

一 网络聚合通信测试

以下测试用例为:
整集群测试,每节点进程数从2开始以2的幂次增加至满核心;
测试常见的通信聚合测试8个条目

在这里插入图片描述

二 测试前准备

  • 待测节点已完成OS安装及基础配置
  • 待测节点已配置完IP(若存在IB,则需要配置IB IP)
  • 待测节点做完互信操作
  • 所有节点具有共享存储
  • 编译安装osu_benchmark测试工具至共享目录

三 测试

  • 上传测试脚本至osu_benchmark测试工具目录,如:
/share/opt/osu/libexec/osu-micro-benchmarks/mpi/collective/
  • 在该目录创建nodelist文件并填入待测节点IP
vim nodelist
10.186.121.102
10.186.121.103
10.186.121.104
10.186.121.105
10.186.121.106
10.186.121.107
10.186.121.108
10.186.121.109
10.186.121.110
........
  • 在该目录创建processlist文件并填入测试进程数
#假设每节点总核数为64,从2开始,已2的幂次增加
vim processlist
2
4
8
16
32
64
  • `脚本赋予执行权限
chmod +x osu_batch_test.sh
  • 执行脚本进行测试
[root@linux ~]# bash osu_batch_test.sh
===============================================>>> Please choose a number to continue:
1 osu_allgather
2 osu_allreduce
3 osu_alltoall
3 osu_barrier
5 osu_bcast
6 osu_gather
7 osu_reduce
8 osu_scatter
9 Exit
>>>input number>>>
  • 执行完成后会所有的日志会保存在在当前目录下的log文件夹中

四 脚本

#!/bin/bash
current_dir=`pwd`
node_file=${current_dir}/nodelist
proc_file=${current_dir}/processlist
mkdir -p ${current_dir}/log
logfile=$current_path/log/
size=65536if [ ! -f ${node_file} ] || [ ! -f ${proc_file} ];thenecho -e "Error: Nodes file ${node_file} or Process file ${proc_file} is not exist."exit 1
fi#获取节点及进程总数
cat ${proc_file} | grep -v "^#"  | grep -v "^$" > process.temp
processlist=process.temp
cat ${node_file} | grep -v "^#"  | grep -v "^$" > nodes.temp
nodelist=nodes.temp
count=`grep -v '^$' $processlist | wc -l `
nodenum=`grep -v '^$' $nodelist | wc -l `
if [ $count -eq 0 ] || [ $nodenum -eq 0 ];thenecho -e "Warning: Nodes file ${node_file} or process file ${proc_file}  is empty, skip."exit 1
fi#获取进程数内容
proc_list=(`awk '{print $1}' $processlist`)
rm -rf $processlistfunction test_osu_allgather() {# test osu_allgatherecho -e "\n>>> Start to test osu_allgather :"echo -e "--------------------------------------------------------------------------------------"for ((i=0; i<$count; i++))doecho -e "\n>>> Start to test ppn=${proc_list[$i]} :"echo -e "\n>>>> ppn=${proc_list[$i]}" >> ${logfile}/${nodenum}"nodes_osu_allgather.log"mpirun -ppn ${proc_list[$i]}  -hostfile ${node_file} ${current_dir}/osu_allgather -m $size >> ${logfile}/${nodenum}"nodes_osu_allgather.log"sleep 2doneecho "the current test time is $(date +%Y-%m-%d-%H%M%S)" >> ${logfile}/${nodenum}"nodes_osu_allgather.log"
}function test_osu_allreduce(){# test osu_allreduceecho -e "\n>>> Start to test osu_allreduce :"echo -e "--------------------------------------------------------------------------------------"for ((i=0; i<$count; i++))doecho -e "\n>>> Start to test  ppn=${proc_list[$i]} :"echo -e "\n>>>> ppn=${proc_list[$i]}" >> ${logfile}/${nodenum}"nodes_osu_allreduce.log"mpirun -ppn ${proc_list[$i]}  -hostfile ${node_file} ${current_dir}/osu_allreduce -m $size >> ${logfile}/${nodenum}"nodes_osu_allreduce.log"sleep 2doneecho "the current test time is $(date +%Y-%m-%d-%H%M%S)" >> ${logfile}/${nodenum}"nodes_osu_allreduce.log"
}function test_osu_alltoall() {# test osu_alltoallecho -e "\n>>> Start to test osu_alltoall :"echo -e "--------------------------------------------------------------------------------------"for ((i=0; i<$count; i++))doecho -e "\n>>> Start to test ppn=${proc_list[$i]} :"echo -e "\n>>>> ppn=${proc_list[$i]}" >> ${logfile}/${nodenum}"nodes_osu_alltoall.log"mpirun -ppn ${proc_list[$i]}  -hostfile ${node_file} ${current_dir}/osu_alltoall -m $size >> ${logfile}/${nodenum}"nodes_osu_alltoall.log"sleep 2doneecho "the current test time is $(date +%Y-%m-%d-%H%M%S)" >> ${logfile}/${nodenum}"nodes_osu_alltoall.log"
}function test_osu_barrier() {# test osu_barrierecho -e "\n>>> Start to test osu_barrier :"echo -e "--------------------------------------------------------------------------------------"for ((i=0; i<$count; i++))doecho -e "\n>>> Start to test ppn=${proc_list[$i]} :"echo -e "\n>>>> ppn=${proc_list[$i]}" >> ${logfile}/${nodenum}"nodes_osu_barrier.log"mpirun -ppn ${proc_list[$i]}  -hostfile ${node_file} ${current_dir}/osu_barrier -m $size >> ${logfile}/${nodenum}"nodes_osu_barrier.log"sleep 2doneecho "the current test time is $(date +%Y-%m-%d-%H%M%S)" >> ${logfile}/${nodenum}"nodes_osu_barrier.log"}function test_osu_bcast() {# test osu_bcastecho -e "\n>>> Start to test osu_bcast :"echo -e "--------------------------------------------------------------------------------------"for ((i=0; i<$count; i++))doecho -e "\n>>> Start to test ppn=${proc_list[$i]} :"echo -e "\n>>>> ppn=${proc_list[$i]}" >> ${logfile}/${nodenum}"nodes_osu_bcast.log"mpirun -ppn ${proc_list[$i]}  -hostfile ${node_file} ${current_dir}/osu_bcast -m $size >> ${logfile}/${nodenum}"nodes_osu_bcast.log"sleep 2doneecho "the current test time is $(date +%Y-%m-%d-%H%M%S)" >> ${logfile}/${nodenum}"nodes_osu_bcast.log"}function test_osu_gather() {# test osu_gatherecho -e "\n>>> Start to test osu_gather :"echo -e "--------------------------------------------------------------------------------------"for ((i=0; i<$count; i++))doecho -e "\n>>> Start to test ppn=${proc_list[$i]} :"echo -e "\n>>>> ppn=${proc_list[$i]}" >> ${logfile}/${nodenum}"nodes_osu_gather.log"mpirun -ppn ${proc_list[$i]}  -hostfile ${node_file} ${current_dir}/osu_gather -m $size >> ${logfile}/${nodenum}"nodes_osu_gather.log"sleep 2doneecho "the current test time is $(date +%Y-%m-%d-%H%M%S)" >> ${logfile}/${nodenum}"nodes_osu_gather.log"}function test_osu_reduce() {# test osu_reduceecho -e "\n>>> Start to test osu_reduce :"echo -e "--------------------------------------------------------------------------------------"for ((i=0; i<$count; i++))doecho -e "\n>>> Start to test ppn=${proc_list[$i]} :"echo -e "\n>>>> ppn=${proc_list[$i]}" >> ${logfile}/${nodenum}"nodes_osu_reduce.log"mpirun -ppn ${proc_list[$i]}  -hostfile ${node_file} ${current_dir}/osu_reduce -m $size >> ${logfile}/${nodenum}"nodes_osu_reduce.log"sleep 2doneecho "the current test time is $(date +%Y-%m-%d-%H%M%S)" >> ${logfile}/${nodenum}"nodes_osu_reduce.log"}function test_osu_scatter() {# test osu_scatterecho -e "\n>>> Start to test osu_scatter :"echo -e "--------------------------------------------------------------------------------------"for ((i=0; i<$count; i++))doecho -e "\n>>> Start to test ppn=${proc_list[$i]} :"echo -e "\n>>>> ppn=${proc_list[$i]}" >> ${logfile}/${nodenum}"nodes_osu_scatter.log"mpirun -ppn ${proc_list[$i]}  -hostfile ${node_file} ${current_dir}/osu_scatter -m $size >> ${logfile}/${nodenum}"nodes_osu_scatter.log"sleep 2doneecho "the current test time is $(date +%Y-%m-%d-%H%M%S)" >> ${logfile}/${nodenum}"nodes_osu_scatter.log"}# main function# print menuecho -e "==============================================="while :doecho -e "\n>>> Please choose a number to continue:"echo -e "1 osu_allgather"echo -e "2 osu_allreduce"echo -e "3 osu_alltoall"echo -e "3 osu_barrier"echo -e "5 osu_bcast"echo -e "6 osu_gather"echo -e "7 osu_reduce"echo -e "8 osu_scatter"echo -e "9 Exit"# read inputread -p ">>>input number>>> " nuif [[ "$nu" == "1" ]];thentest_osu_allgatherelif [[ "$nu" == "2" ]];thentest_osu_allreduceelif [[ "$nu" == "3" ]];thentest_osu_alltoallelif [[ "$nu" == "4" ]];thentest_osu_barrierelif [[ "$nu" == "5" ]];thentest_osu_bcastelif [[ "$nu" == "6" ]];thentest_osu_gatherelif [[ "$nu" == "7" ]];thentest_osu_reduceelif [[ "$nu" == "8" ]];thentest_osu_scatterelif [[ "$nu" == "9" ]];thenecho -e "\n>>> exit"exit 0elseecho -e "\033[41;37m unsupported input. \033[0m"fidone

日常总结,一起学习进步

相关文章:

  • 6月20日(周四)A股行情总结:A股险守3000点,恒生科技指数跌1.6%
  • EVALUATE与XLWT与XLRD一种使用方式
  • 【机器学习300问】125、什么是双向循环神经网络(BRNN)?什么是深度循环神经网络(DRNN)?
  • 吴恩达机器学习 第二课 week4 决策树
  • 如何配置node.js环境
  • 软件设计师笔记-系统开发和运行知识(一)
  • 总结 CSS 选择器的常见用法
  • 硬盘数据恢复软件,推荐5种适合你的方法来恢复硬盘数据
  • 医学记录 --- 腋下异味
  • 手持弹幕LED滚动字幕屏夜店表白手灯接机微信抖音小程序开源版开发
  • 20-OWASP top10--XXS跨站脚本攻击
  • websocket 安全通信
  • 计算机组成入门知识
  • Memcached缓存系统详解
  • android 在线程中更新界面
  • 【140天】尚学堂高淇Java300集视频精华笔记(86-87)
  • 【RocksDB】TransactionDB源码分析
  • 11111111
  • css布局,左右固定中间自适应实现
  • iOS | NSProxy
  • JavaScript 基本功--面试宝典
  • jdbc就是这么简单
  • Linux快速复制或删除大量小文件
  • ng6--错误信息小结(持续更新)
  • PAT A1017 优先队列
  • TiDB 源码阅读系列文章(十)Chunk 和执行框架简介
  • Vue.js-Day01
  • 案例分享〡三拾众筹持续交付开发流程支撑创新业务
  • 浮现式设计
  • 机器学习 vs. 深度学习
  • 基于遗传算法的优化问题求解
  • 简单实现一个textarea自适应高度
  • 那些年我们用过的显示性能指标
  • 前端工程化(Gulp、Webpack)-webpack
  • 前端面试之闭包
  • 如何用Ubuntu和Xen来设置Kubernetes?
  • 我建了一个叫Hello World的项目
  • ​ 无限可能性的探索:Amazon Lightsail轻量应用服务器引领数字化时代创新发展
  • ​ssh-keyscan命令--Linux命令应用大词典729个命令解读
  • ​人工智能之父图灵诞辰纪念日,一起来看最受读者欢迎的AI技术好书
  • # wps必须要登录激活才能使用吗?
  • ###项目技术发展史
  • #define、const、typedef的差别
  • #if和#ifdef区别
  • #pragma预处理命令
  • #ubuntu# #git# repository git config --global --add safe.directory
  • ( 用例图)定义了系统的功能需求,它是从系统的外部看系统功能,并不描述系统内部对功能的具体实现
  • (1综述)从零开始的嵌入式图像图像处理(PI+QT+OpenCV)实战演练
  • (2.2w字)前端单元测试之Jest详解篇
  • (Oracle)SQL优化基础(三):看懂执行计划顺序
  • (二)Kafka离线安装 - Zookeeper下载及安装
  • (附源码)计算机毕业设计SSM疫情社区管理系统
  • (附源码)计算机毕业设计大学生兼职系统
  • (四)七种元启发算法(DBO、LO、SWO、COA、LSO、KOA、GRO)求解无人机路径规划MATLAB
  • (一)十分简易快速 自己训练样本 opencv级联haar分类器 车牌识别