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

news2024/7/4 5:22:46

一 网络聚合通信测试

以下测试用例为:
整集群测试,每节点进程数从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.coloradmin.cn/o/1837159.html

如若内容造成侵权/违法违规/事实不符,请联系多彩编程网进行投诉反馈,一经查实,立即删除!

相关文章

[面试题]Redis

[面试题]Java【基础】[面试题]Java【虚拟机】[面试题]Java【并发】[面试题]Java【集合】[面试题]MySQL[面试题]Maven[面试题]Spring Boot[面试题]Spring Cloud[面试题]Spring MVC[面试题]Spring[面试题]MyBatis[面试题]Nginx[面试题]缓存[面试题]Redis 什么是 Redis &#xff…

使用Minikube部署Kubernetes环境

使用Minikube部署Kubernetes环境 1. Minikube简介 Minikube是一个轻量级的Kubernetes实现&#xff0c;它在本地运行一个Kubernetes集群&#xff0c;可以是单节点或者集群环境&#xff0c;主要用于开发和测试。Minikube支持Kubernetes的所有主要功能&#xff0c;包括Dashboard…

【Linux基础IO】常见的对文件操作的函数、文件描述符fd、访问文件的本质分析

目录 fopen函数 chdir函数 fclose函数 fwrite和fread函数 open函数 umask函数 write函数 read函数 close函数 文件描述符fd 进程访问文件的本质分析 fopen函数 参数mode&#xff1a; w方式打开文件&#xff1a;1、如果被打开文件不存在&#xff0c;系统会在使用fopen函…

DGit的使用

将Remix连接到远程Git仓库 1.指定克隆的分支和深度 2.清理&#xff0c;如果您不在工作区上工作&#xff0c;请将其删除或推送至 GitHub 或 IPFS 以确保安全。 为了进行推送和拉取&#xff0c;你需要一个 PAT — 个人访问令牌 当使用 dGIT 插件在 GitHub 上推送、拉取、访问私…

火灾数据的另一个下载源 MOD14 MODIS火灾检测和热异常数据集

地图资源工具&#xff0c;有对于同一种数据会有多个数据源&#xff0c;起火点数据除了下载全球范围内的实时和历史火灾数据矢量下载源外 还有另一个火灾数据的栅格下载源 利用地图资源工具下载&#xff0c; 下载方式基本统一&#xff0c;可以最大程度简化您数据获取的操作并节省…

CSS打印设置页眉页脚

之前写过一篇文章CSS实现自动分页打印同时每页保留重复的自定义内容&#xff0c;可以实现window.print()打印时多张页面保留相同的内容&#xff08;如header、footer&#xff09;&#xff0c;但其并不是真正意义上的页眉页脚&#xff0c;footer内容在最后一张页面未撑满时不能置…

MyBatis系列四: 动态SQL

动态SQL语句-更复杂的查询业务需求 官方文档基本介绍案例演示if标签应用实例where标签应用实例choose/when/otherwise应用实例foreach标签应用实例trim标签应用实例[使用较少]set标签应用实例[重点]课后练习 上一讲, 我们学习的是 MyBatis系列三: 原生的API与配置文件详解 现在…

【proteus仿真】基于51单片机的秒表设计

【proteus仿真】基于51单片机的秒表设计 资料获取在文章结尾处&#xff01; 更多资料获取链接&#xff1a; https://docs.qq.com/sheet/DTExIc2dPUUJ5enZZ?tabBB08J2 1.资料内容 源码proteus仿真图 演示视频&#xff1a; 【proteus仿真】基于51单片机的秒表设计_哔哩哔…

注意力机制和Transformer模型各部分功能解释

文章目录 Transformer1、各部分功能解释2、通过例子解释a.输入预处理位置编码b.Encoder 的处理c.Decoder的输入Decoder的工作流程d.输出预测总结 Attention代码和原理理解 Transformer 运行机理&#xff1a; &#xff08;1&#xff09;假设我们需要进行文本生成任务。我们将已…

TikTok养号新手保姆级教程

对于很多刚开始运营TikTok的新手小白来说&#xff0c;都会有一个同样的疑问&#xff0c;那就是&#xff1a;TikTok到底需不需要养号&#xff1f;这里明确告诉大家是需要养号的&#xff0c;今天就把我自己实操过的养号经验和策略总结出来&#xff0c;分享给大家。 一、什么是Ti…

Android 配置蓝牙遥控器键值

文章目录 篇头一、规格书二、红外按键配置三、蓝牙按键配置3.1 查看设备号3.1.1 方式一&#xff1a;dumpsys input3.1.2 方式二&#xff1a; cat /proc/bus/input/devices 3.2 配置kl文件3.2.1 方案商原始配置3.2.2 Generic.kl 文件3.2.3 重映射蓝牙按键3.2.4 完成 Vendor\_568…

Boosting原理代码实现

1&#xff0e;提升方法是将弱学习算法提升为强学习算法的统计学习方法。在分类学习中&#xff0c;提升方法通过反复修改训练数据的权值分布&#xff0c;构建一系列基本分类器&#xff08;弱分类器&#xff09;&#xff0c;并将这些基本分类器线性组合&#xff0c;构成一个强分类…

git提交遇见的<<<<<<<< HEAD无法运行程序问题

在项目文件目录下打开git bash Here 在命令行中输入 git reset --hard HEAD~1 进行复原 git reset --hard HEAD~1 即可

基于Java + Swing + MySQL的学生选课及成绩管理系统(Java课程设计)

目录 开发工具系统结构功能展示登录与注册界面&#xff08;通用&#xff09;主界面&#xff08;通用&#xff09;学生信息查询界面&#xff08;学生用户&#xff09;学生信息管理界面&#xff08;教师用户 管理员用户&#xff09;学生选课界面&#xff08;学生用户&#xff09;…

跟TED演讲学英文:A tale of mental illness -- from the inside by Elyn Saks

A tale of mental illness – from the inside Link: https://www.ted.com/talks/elyn_saks_a_tale_of_mental_illness_from_the_inside Speaker: Elyn Saks Date: June 2012 文章目录 A tale of mental illness -- from the insideIntroductionVocabularySummaryTranscriptA…

【C语言】数组参数和指针参数详解

在写代码的时候难免要把【数组】或者【指针】传给函数&#xff0c;那函数的参数该如何设计呢&#xff1f; 1 一维数组传参 #include <stdio.h> void test(int arr[])//ok? {} void test(int arr[10])//ok? {} void test(int* arr)//ok? {} void test2(int* arr[20])…

爬虫可以做什么?Python爬虫入门必看保姆级教程!(学习资源+学习路线)

一、什么是爬虫&#xff1f; Python爬虫&#xff0c;也称为Python网络爬虫或网页蜘蛛&#xff0c;是一种使用Python编程语言编写的程序&#xff0c;用于自动地抓取互联网上的信息。这种程序按照预设的规则&#xff0c;模拟浏览器请求站点的行为&#xff0c;从网站上抓取数据并…

【长春理工大学主办 | EI检索稳定 | SPIE出版 | 过往4届均检索 】第五届计算机视觉和数据挖掘国际学术会议(ICCVDM 2024)

第五届计算机视觉和数据挖掘国际学术会议&#xff08;ICCVDM 2024&#xff09; 2024 5th International Conference on Computer Vision and Data Mining 会议简介 第五届计算机视觉与数据挖掘国际学术会议&#xff08;ICCVDM 2024&#xff09;将于2024年7月19-21日在中国长春…

中国剩余定理——AcWing 204. 表达整数的奇怪方式

中国剩余定理 定义 中国剩余定理最早出自我国古代的《孙子算经》&#xff0c;是数论中的一个重要定理。它描述了这样一种情况&#xff1a;在模运算下&#xff0c;对于一组线性同余方程组&#xff0c;存在唯一解的条件和求解方法。 运用情况 常用于在一些涉及到按不同模的余…

ROS std_msgs消息包

ROS std_msgs消息包 基本概述 std_msgs 是 ROS&#xff08;Robot Operating System&#xff09;的一个核心消息包&#xff0c;包含了一系列基本的消息类型&#xff0c;这些类型用于节点之间的标准通信。std_msgs 中的消息类型设计得非常简单&#xff0c;以便用作更复杂消息的…