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

一 网络聚合通信测试

以下测试用例为:
整集群测试,每节点进程数从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=65536

if [ ! -f ${node_file} ] || [ ! -f ${proc_file} ];then
    echo -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 ];then
  echo -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 $processlist


function test_osu_allgather() {
  # test osu_allgather
  echo -e "\n>>> Start to test osu_allgather :"
  echo -e "--------------------------------------------------------------------------------------"
  for ((i=0; i<$count; i++))
  do
        echo -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 2
  done
  echo "the current test time is $(date +%Y-%m-%d-%H%M%S)" >> ${logfile}/${nodenum}"nodes_osu_allgather.log"
}

function test_osu_allreduce(){
  # test osu_allreduce
  echo -e "\n>>> Start to test osu_allreduce :"
  echo -e "--------------------------------------------------------------------------------------"
  for ((i=0; i<$count; i++))
  do
        echo -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 2
  done
  echo "the current test time is $(date +%Y-%m-%d-%H%M%S)" >> ${logfile}/${nodenum}"nodes_osu_allreduce.log"
}

function test_osu_alltoall() {
  # test osu_alltoall
  echo -e "\n>>> Start to test osu_alltoall :"
  echo -e "--------------------------------------------------------------------------------------"
  for ((i=0; i<$count; i++))
  do
        echo -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 2
  done
  echo "the current test time is $(date +%Y-%m-%d-%H%M%S)" >> ${logfile}/${nodenum}"nodes_osu_alltoall.log"
}

function test_osu_barrier() {
  # test osu_barrier
  echo -e "\n>>> Start to test osu_barrier :"
  echo -e "--------------------------------------------------------------------------------------"
  for ((i=0; i<$count; i++))
  do
        echo -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 2
  done
  echo "the current test time is $(date +%Y-%m-%d-%H%M%S)" >> ${logfile}/${nodenum}"nodes_osu_barrier.log"

}

function test_osu_bcast() {
  # test osu_bcast
  echo -e "\n>>> Start to test osu_bcast :"
  echo -e "--------------------------------------------------------------------------------------"
  for ((i=0; i<$count; i++))
  do
        echo -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 2
  done
  echo "the current test time is $(date +%Y-%m-%d-%H%M%S)" >> ${logfile}/${nodenum}"nodes_osu_bcast.log"

}

function test_osu_gather() {
  # test osu_gather
  echo -e "\n>>> Start to test osu_gather :"
  echo -e "--------------------------------------------------------------------------------------"
  for ((i=0; i<$count; i++))
  do
        echo -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 2
  done
  echo "the current test time is $(date +%Y-%m-%d-%H%M%S)" >> ${logfile}/${nodenum}"nodes_osu_gather.log"

}

function test_osu_reduce() {
  # test osu_reduce
  echo -e "\n>>> Start to test osu_reduce :"
  echo -e "--------------------------------------------------------------------------------------"
  for ((i=0; i<$count; i++))
  do
        echo -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 2
  done
  echo "the current test time is $(date +%Y-%m-%d-%H%M%S)" >> ${logfile}/${nodenum}"nodes_osu_reduce.log"

}

function test_osu_scatter() {
  # test osu_scatter
  echo -e "\n>>> Start to test osu_scatter :"
  echo -e "--------------------------------------------------------------------------------------"
  for ((i=0; i<$count; i++))
  do
        echo -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 2
  done
  echo "the current test time is $(date +%Y-%m-%d-%H%M%S)" >> ${logfile}/${nodenum}"nodes_osu_scatter.log"

}



# main function
  # print menu
  echo -e "==============================================="
  while :
  do
      echo -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 input
      read -p ">>>input number>>> " nu
      if [[ "$nu" == "1" ]];then
        test_osu_allgather
      elif [[ "$nu" == "2" ]];then
        test_osu_allreduce
      elif [[ "$nu" == "3" ]];then
        test_osu_alltoall
      elif [[ "$nu" == "4" ]];then
        test_osu_barrier
      elif [[ "$nu" == "5" ]];then
        test_osu_bcast
      elif [[ "$nu" == "6" ]];then
        test_osu_gather
      elif [[ "$nu" == "7" ]];then
        test_osu_reduce
      elif [[ "$nu" == "8" ]];then
        test_osu_scatter
      elif [[ "$nu" == "9" ]];then
          echo -e "\n>>> exit"
          exit 0
      else
          echo -e "\033[41;37m unsupported input. \033[0m"
      fi
  done


日常总结,一起学习进步

本文来自互联网用户投稿,该文观点仅代表作者本人,不代表本站立场。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如若转载,请注明出处:http://www.mfbz.cn/a/720754.html

如若内容造成侵权/违法违规/事实不符,请联系我们进行投诉反馈qq邮箱809451989@qq.com,一经查实,立即删除!

相关文章

【C语言】13.数组指针与函数指针及其应用

一、数组指针 顾名思义&#xff0c;数组指针就是指向数组的指针。形如&#xff1a;int (*p)[10]; 注意&#xff1a;[]的优先级要高于*号的&#xff0c;所以必须加上&#xff08;&#xff09;来保证p先和*结合。 数组指针的使用 int arr[10] {0}; int (*parr)[10] &arr;…

鸿蒙开发网络管理:【@ohos.request (上传下载)】

上传下载 说明&#xff1a; 本模块首批接口从API version 6开始支持。后续版本的新增接口&#xff0c;采用上角标单独标记接口的起始版本。 导入模块 import request from ohos.request;限制与约束 默认支持https&#xff0c;如果要支持http&#xff0c;需要在config.json里…

SD卡可以格式化成NTFS吗 SD卡Mac怎么读取内容

SD卡作为便携式存储媒介&#xff0c;广泛应用于我们的日常生活与工作之中。而NTFS&#xff0c;作为一种先进的文件系统&#xff0c;因其强大的功能和安全性&#xff0c;在Windows平台备受青睐。然而&#xff0c;当谈及将SD卡格式化为NTFS这一话题时&#xff0c;用户的疑惑随之而…

JAVA国际版多语言语聊大厅语音聊天APP系统源码

&#x1f30d;探秘"国际版多语言语聊大厅系统"&#x1f4ac; 功能介绍 动态列表、发布动态、精准分类 创建语聊房间、房间玩法、违规公示、聊天显示 赠送礼物、上麦功能、房间管理、礼物中心、我的团队、我的投诉、我的足迹、支持个人厅、娱乐厅 个性装扮​ &…

有个网友问Webview2如何另存为mhtml

有个网友问Webview2如何另存为mhtml 。俺查了一下&#xff0c;Webview2没有直接的saveas函数。然后我查到 之后我就使用 webview2 capture 这2个关键字去查询&#xff0c;果然搜到了 一段代码 然后我把这段代码 改成成C#的&#xff0c; string data await webView21.CoreWebV…

STM32学习笔记(七)--ADC详解

&#xff08;1&#xff09;配置步骤1.配置RCC外设时钟 开启GPIO以及ADC外设2.配置预分配ADCCLK 不能超过14MHZ 一般都是除于63.配置GPIO口 初始化为模拟输入的配置 设置专属模式4.选择规则组的输入通道 选择ADCx以及通道等 去看引脚图5.配置ADC 初始化配置6.配置中断以及定时器…

基于S32K144驱动NSD8308

文章目录 1.前言2.芯片介绍2.1 芯片简介2.2 硬件特性2.3 软件资源2.4 芯片资料 3.测试环境4.软件驱动4.1 SPI4.2 寄存器4.3 SPI ON/OFF控制4.4 PWM控制 5.测试情况 1.前言 最近有些客户在前期调试NSD8308时&#xff0c;软件上遇到一些问题&#xff0c;正好笔者手上有一套NSD83…

01- ES6语法

1.ES6相关概念 1.1 什么是ES6 1.1.1 简介 ES6&#xff0c; 全称 ECMAScript 6.0 &#xff0c;是 JavaScript 的下一个版本标准&#xff0c;2015.06 发版。 ES6 主要是为了解决 ES5 的先天不足&#xff0c;比如 JavaScript 里并没有类的概念&#xff0c;但是目前浏览器的 Ja…

6月17(信息差)

1.马斯克最新预测&#xff1a;未来不再需要手机 将被脑机芯片替代 当地时间6月17日&#xff0c;马斯克高仿号“Not Elon Musk”发帖称&#xff1a;“你会在你的大脑上安装一个Neuralink接口&#xff0c;让你通过思考来控制你的新X手机吗&#xff1f;”对此&#xff0c;马斯克本…

ThinkPHP6图书借阅管理系统

有需要请加文章底部Q哦 可远程调试 ThinkPHP6图书借阅管理系统 一 介绍 此图书借阅管理系统基于ThinkPHP6框架开发&#xff0c;数据库mysql&#xff0c;前端bootstrap。系统角色分为用户和管理员。 技术栈 ThinkPHP6mysqlbootstrapphpstudyvscode 二 功能 用户 1 登录/注销…

骁龙662_高通SM6115主要参数_高通模块方案定制

骁龙662&#xff08;SM6115&#xff09;采用了全新的44 Kryo 260 CPU架构&#xff0c;由四核Cortex-A73(高达2.0 GHz)和四核Cortex-A53(高达1.8 GHz)组成。这种架构的设计使得骁龙662在性能上相较于上一代产品有了显著的提升&#xff0c;为用户提供了更快的运行速度和更流畅的使…

BarTender软件最新版下载-bartender条码标签打印软件下载

​​BarTender​​是一款遵循“look and feel”标准的​​条码打印​​软件。​​BarTender​​条码打印软件能够帮助用户挥洒自如&#xff0c;轻松制作出标签条码&#xff0c;包括文本、图形、​​条形码​​和大多数序列化功能。BarTender条码打印软件功能强大、操作简单&…

开源的数字孪生平台

欧洲对工业4.0的追求体现在三个方面&#xff1a; 数字孪生、智能制造和万物互联。 资助2440万欧元的开源数字孪生平台 源代码&#xff1a; http://www.gitpp.com/ccdan/dpqq-digital-twins 这套数字孪生是工业4.0整体规划中的中的一项技术&#xff0c;实现了一种称为“数字…

JSP之原理剖析

什么是JSP&#xff1a; java Server Pages: java服务端页面,也和Servlet一样&#xff0c;用于动态Web技术&#xff1f; 最大特点&#xff1a; 写jsp就像在写HTML区别&#xff1a; HTML只给用户提供静态的数据JSP页面中可以嵌入Java代码&#xff0c;为用户提供动态数据 JSP原…

npm发布自己的插件包:新手教程

npm&#xff08;Node Package Manager&#xff09;是Node.js的包管理工具&#xff0c;广泛用于JavaScript项目中。本文将为你介绍如何从零开始发布一个npm插件包。 前提条件 在开始之前&#xff0c;你需要确保以下几点&#xff1a; 安装Node.js和npm&#xff1a;你可以在No…

科凡定制首倡轻高定突围的蓝海战术是明星代言?

4月19日&#xff0c;科凡家居再度重磅发声&#xff0c;正式宣布国际女星舒淇为全球代言人。 纵观定制家居几大一线品牌&#xff0c;欧派代言人胡歌&#xff0c;索菲亚代言人倪妮。尚品宅配代言人赵丽颖&#xff0c;维意定制代言人黄轩&#xff0c;志邦家居代言人周杰伦......大…

【SkiaSharp绘图05】SKPaint详解(三)之ImageFilter(颜色、组合、膨胀、移位、光照、反射、阴影、腐蚀、变换)

文章目录 ImageFilterCreateColorFilter 颜色滤镜CreateCompose 滤镜组合CreateDilate 膨胀滤镜CreateDisplacementMapEffect 移位映射CreateDistantLitDiffuse 光照CreateDistantLitSpecular 反射光照CreateDropShadow阴影效果CreateDropShadowOnly 只阴影效果CreateErode腐蚀…

卡本医疗VENUS登陆香港国际医疗展,探索全球医疗发展新机遇

由香港贸易发展局主办的第15届香港国际医疗及保健展、以及联合香港特别行政区政府举办的第四届亚洲医疗健康高峰论坛在中国香港圆满落幕。 香港国际医疗及保健展是亚太地区最具影响力的B2B医疗贸易展览会之一&#xff0c;辐射海内外市场&#xff0c;本次邀请了超过8500家买家以…

读书笔记-《人人都是产品经理》

在开发工程师与产品经理的段子中&#xff0c;常看到“人人都是产品经理”这句话&#xff0c;用来调侃这个岗位似乎没有什么门槛。 很明显&#xff0c;这句话的出处&#xff0c;即本书作者想表达的是每个人都可以运用产品思维去解决问题。 01 产品 产品&#xff1a;用来解决某…

android常用知识

透明activity样式&#xff1a; android:theme"android:style/Theme.Translucent.NoTitleBar.Fullscreen"这句代码&#xff0c;当你是建的empty activity project时&#xff0c;默认继承的是AppCompat这个类。所以在AndroidMifext.xml文件中用上述代码会导致程序错误&…