HPL 源码结构分析
文件夹结构:
$ cd /home/hipper/ex_hpl_hpcg/
$ pwd
$ mkdir ./openmpi
$mkdir ./openblas
$mkdir ./hpl
$ tree
1. 安装openmpi
1.1.1 使用Makefile下载配置编译安装 openmpi
Makefile:
all:wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.6.tar.gz && \tar zxf openmpi-4.1.6.tar.gz && \cd openmpi-4.1.6/ && \./configure --enable-mpi-cxx --with-cuda --prefix=${PWD}/local/ 2>&1 | tee config.out && \make -j all 2>&1 | tee make.outinstall:make -C openmpi-4.1.6/ install 2>&1 | tee install.out.PHONY: clean
clean:-rm -rf ./openmpi-4.1.6/ ./openmpi-4.1.6.tar.gz
$ make
$ make install
$ ls
1.1.2 注意事项
如果 是 openmpi 5.0及其以上,则./configure 时不能要选项:
--enable-mpi-cxx
mpi 以后仅支持使用相对广泛很多的 C 语言风格的 API,不再支持 C++ 风格的使用方式,虽然有在用,但很不主流,C 风格 api 足够强大,足够使用。
无论4.x还是5.x,如果没有安装cuda,则 ./configure 时不需要该项:
--with-cuda
而,指定安装目录时需要指定绝对路径,例如:
--prefix=${PWD}/local/
或者不使用 Makefile 方式,而使用命令行安装 openmpi:
$ wget https://download.open-mpi.org/release/open-mpi/v4.1/openmpi-4.1.6.tar.g
$ tar zxf openmpi-4.1.6.tar.gz
$ cd openmpi-4.1.6/其中 configure 选项 --prefix=/.../ 需要使用绝对路径,例如:
$ ./configure --enable-mpi-cxx --with-cuda --prefix=/home/hipper/ex_hpl/openmpi/local/ 2>&1 | tee config.out
$ make -j all 2>&1 | tee make.out
$ make install 2>&1 | tee install.out
1.1.3 配置环境变量
export PATH=/home/hipper/ex_openmpi/local/bin:$PATHexport LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/home/hipper/ex_openmpi/local/libcd examplesmakempirun -np 7 hello_c
2. 安装 openblas
all:wget https://github.com/OpenMathLib/OpenBLAS/archive/refs/tags/v0.3.27.tar.gztar zxf v0.3.27.tar.gz make -C OpenBLAS-0.3.27 FC=gfortran -jinstall:make -C OpenBLAS-0.3.27 install PREFIX=../local/
#PREFIX=/opt/OpenBLAS
# PREFIX=../local/clean:-rm -rf ./local/ ./OpenBLAS-0.3.27/ ./v0.3.27.tar.gz
$ make
$ make install
$ ls
3. 配置编译运行 hpl
1.3.1 下载 hpl 源代码
$ wget https://www.netlib.org/benchmark/hpl/hpl-2.3.tar.gz
$ tar zxf hpl-2.3.tar.gz
$ cd hpl-2.3/
1.3.2 配置
$ cd hpl-2.3/
$ hpl-2.3$ cp ./setup/Make.Linux_PII_CBLAS ./
vim ./Make.Linux_PII_CBLAS
# ######################################################################
#
# ----------------------------------------------------------------------
# - shell --------------------------------------------------------------
# ----------------------------------------------------------------------
#
SHELL = /bin/sh
#
CD = cd
CP = cp
LN_S = ln -s
MKDIR = mkdir
RM = /bin/rm -f
TOUCH = touch
#
# ----------------------------------------------------------------------
# - Platform identifier ------------------------------------------------
# ----------------------------------------------------------------------
#
ARCH = Linux_PII_CBLAS
#
# ----------------------------------------------------------------------
# - HPL Directory Structure / HPL library ------------------------------
# ----------------------------------------------------------------------
#
#/home/hipper/ex_hpl_hpcg/hpl/hpl-2.3
TOPdir = $(HOME)/ex_hpl_hpcg/hpl/hpl-2.3
INCdir = $(TOPdir)/include
BINdir = $(TOPdir)/bin/$(ARCH)
LIBdir = $(TOPdir)/lib/$(ARCH)
#
HPLlib = $(LIBdir)/libhpl.a
#
# ----------------------------------------------------------------------
# - Message Passing library (MPI) --------------------------------------
# ----------------------------------------------------------------------
# MPinc tells the C compiler where to find the Message Passing library
# header files, MPlib is defined to be the name of the library to be
# used. The variable MPdir is only used for defining MPinc and MPlib.
#
#MPdir = /usr/local/mpi
MPdir = $(HOME)/ex_hpl_hpcg/openmpi/local
MPinc = -I$(MPdir)/include
MPlib = $(MPdir)/lib/libmpi.so
#
# ----------------------------------------------------------------------
# - Linear Algebra library (BLAS or VSIPL) -----------------------------
# ----------------------------------------------------------------------
# LAinc tells the C compiler where to find the Linear Algebra library
# header files, LAlib is defined to be the name of the library to be
# used. The variable LAdir is only used for defining LAinc and LAlib.
#
#LAdir = $(HOME)/netlib/ARCHIVES/Linux_PII
LAdir = $(HOME)/ex_hpl_hpcg/openblas/local
LAinc =
LAlib = $(LAdir)/lib/libopenblas.a
#
# ----------------------------------------------------------------------
# - F77 / C interface --------------------------------------------------
# ----------------------------------------------------------------------
# You can skip this section if and only if you are not planning to use
# a BLAS library featuring a Fortran 77 interface. Otherwise, it is
# necessary to fill out the F2CDEFS variable with the appropriate
# options. **One and only one** option should be chosen in **each** of
# the 3 following categories:
#
# 1) name space (How C calls a Fortran 77 routine)
#
# -DAdd_ : all lower case and a suffixed underscore (Suns,
# Intel, ...), [default]
# -DNoChange : all lower case (IBM RS6000),
# -DUpCase : all upper case (Cray),
# -DAdd__ : the FORTRAN compiler in use is f2c.
#
# 2) C and Fortran 77 integer mapping
#
# -DF77_INTEGER=int : Fortran 77 INTEGER is a C int, [default]
# -DF77_INTEGER=long : Fortran 77 INTEGER is a C long,
# -DF77_INTEGER=short : Fortran 77 INTEGER is a C short.
#
# 3) Fortran 77 string handling
#
# -DStringSunStyle : The string address is passed at the string loca-
# tion on the stack, and the string length is then
# passed as an F77_INTEGER after all explicit
# stack arguments, [default]
# -DStringStructPtr : The address of a structure is passed by a
# Fortran 77 string, and the structure is of the
# form: struct {char *cp; F77_INTEGER len;},
# -DStringStructVal : A structure is passed by value for each Fortran
# 77 string, and the structure is of the form:
# struct {char *cp; F77_INTEGER len;},
# -DStringCrayStyle : Special option for Cray machines, which uses
# Cray fcd (fortran character descriptor) for
# interoperation.
#
F2CDEFS =
#
# ----------------------------------------------------------------------
# - HPL includes / libraries / specifics -------------------------------
# ----------------------------------------------------------------------
#
HPL_INCLUDES = -I$(INCdir) -I$(INCdir)/$(ARCH) $(LAinc) $(MPinc) -lpthread
HPL_LIBS = $(HPLlib) $(LAlib) $(MPlib) -lpthread
#
# - Compile time options -----------------------------------------------
#
# -DHPL_COPY_L force the copy of the panel L before bcast;
# -DHPL_CALL_CBLAS call the cblas interface;
# -DHPL_CALL_VSIPL call the vsip library;
# -DHPL_DETAILED_TIMING enable detailed timers;
#
# By default HPL will:
# *) not copy L before broadcast,
# *) call the BLAS Fortran 77 interface,
# *) not display detailed timing information.
#
HPL_OPTS = -DHPL_CALL_CBLAS
#
# ----------------------------------------------------------------------
#
HPL_DEFS = $(F2CDEFS) $(HPL_OPTS) $(HPL_INCLUDES)
#
# ----------------------------------------------------------------------
# - Compilers / linkers - Optimization flags ---------------------------
# ----------------------------------------------------------------------
#
CC = $(HOME)/ex_hpl_hpcg/openmpi/local/bin/mpicc
CCNOOPT = $(HPL_DEFS)
CCFLAGS = $(HPL_DEFS) -fomit-frame-pointer -O3 -funroll-loops
#
# On some platforms, it is necessary to use the Fortran linker to find
# the Fortran internals used in the BLAS library.
#
LINKER = $(HOME)/ex_hpl_hpcg/openmpi/local/bin/mpif77
LINKFLAGS = $(CCFLAGS)
#
ARCHIVER = ar
ARFLAGS = r
RANLIB = echo
#
# ----------------------------------------------------------------------
前后区别:
$ diff Make.Linux_PII_CBLAS setup/Make.Linux_PII_CBLAS
hipper@hipper-G21:~/ex_hpl_hpcg/hpl/hpl-2.3$ diff Make.Linux_PII_CBLAS setup/Make.Linux_PII_CBLAS
70,71c70
< #/home/hipper/ex_hpl_hpcg/hpl/hpl-2.3
< TOPdir = $(HOME)/ex_hpl_hpcg/hpl/hpl-2.3
---
> TOPdir = $(HOME)/hpl
85,86c84
< #MPdir = /usr/local/mpi
< MPdir = /home/hipper/ex_hpl_hpcg/openmpi/local
---
> MPdir = /usr/local/mpi
88c86
< MPlib = $(MPdir)/lib/libmpi.so
---
> MPlib = $(MPdir)/lib/libmpich.a
97,98c95
< #LAdir = $(HOME)/netlib/ARCHIVES/Linux_PII
< LAdir = $(HOME)/ex_hpl_hpcg/openblas/local
---
> LAdir = $(HOME)/netlib/ARCHIVES/Linux_PII
100c97
< LAlib = $(LAdir)/lib/libopenblas.a
---
> LAlib = $(LAdir)/libcblas.a $(LAdir)/libatlas.a
147,148c144,145
< HPL_INCLUDES = -I$(INCdir) -I$(INCdir)/$(ARCH) $(LAinc) $(MPinc) -lpthread
< HPL_LIBS = $(HPLlib) $(LAlib) $(MPlib) -lpthread
---
> HPL_INCLUDES = -I$(INCdir) -I$(INCdir)/$(ARCH) $(LAinc) $(MPinc)
> HPL_LIBS = $(HPLlib) $(LAlib) $(MPlib)
172c169
< CC = $(HOME)/ex_hpl_hpcg/openmpi/local/bin/mpicc
---
> CC = /usr/bin/gcc
179c176
< LINKER = $(HOME)/ex_hpl_hpcg/openmpi/local/bin/mpif77
---
> LINKER = /usr/bin/g77
hipper@hipper-G21:~/ex_hpl_hpcg/hpl/hpl-2.3$
1.3.3编译运行
make arch=Linux_PII_CBLAS
$ ls
单节点运行:
$ /home/hipper/ex_hpl_hpcg/openmpi/local/bin/mpirun -np 4 ./xhpl > HPL-Benchmark.txt
效果: 多节点: mpirun -np 8 --host node1,node2 ./xhpl > HPL-Benchmark.txt
https://www.advancedclustering.com/act_kb/tune-hpl-dat-file
mpirun 的参数 np 值需要跟 HPL.dat 的 (P x Q) 相等。
2,hpl 源码框架分析
先保存备忘,待续。。。。
相关文章:

HPL 源码结构分析
文件夹结构: $ cd /home/hipper/ex_hpl_hpcg/ $ pwd $ mkdir ./openmpi $mkdir ./openblas $mkdir ./hpl $ tree 1. 安装openmpi 1.1.1 使用Makefile下载配置编译安装 openmpi Makefile: all:wget https://download.open-mpi.org/release/open-m…...

Java代码审计篇 | ofcms系统审计思路讲解 - 篇3 | 文件上传漏洞审计
文章目录 0. 前言1. 文件上传代码审计【有1处】1.1 可疑点1【无漏洞】1.1.1 直接搜索upload关键字1.1.2 选择第一个,点进去分析一下1.1.3 分析this.getFile()方法1.1.4 分析new MultipartRequest(request, uploadPath)1.1.5 分析isSafeFile()方法1.1.6 分析request.…...

【Kubernetes】常见面试题汇总(五)
目录 13.简述 Kubernetes Replica Set 和 Replication Controller 之间有什么区别? 14.简述 kube-proxy 作用? 15.简述 kube-proxy iptables 原理? 16.简述 kube-proxy ipvs 原理? 13.简述 Kubernetes Replica Set 和 Replicat…...

MySQL 解决时区相关问题
在使用 MySQL 的过程中,你可能会遇到时区相关问题,比如说时间显示错误、时区不是东八 区、程序取得的时间和数据库存储的时间不一致等等问题。其实,这些问题都与数据库时区设 置有关。 MySQL Server 中有 2 个环境变量和时区有关,…...

SpringSecurity Context 中 获取 和 更改 当前用户信息的问题
SpringSecurity Context 获取和更改用户信息的问题 SecurityContext 异步线程中获取用户信息 今天在做项目时遇到了一个问题,我需要获取当前用户的 ID。之前,前端并没有存储用户信息,我一直是在后端的 service 中通过 SecurityContext 来获…...

Makefile的四种赋值运算符
Makefile有四种赋值运算符:简单赋值(:)、递归赋值()、条件赋值(?)和追加赋值() 1. 简单赋值(:) 作用:覆盖之前的值。若在多次简单赋…...

framebuffer
framebuffer:帧缓冲、帧缓存 Linux内核为显示提供的一套应用程序接口(驱动内核支持) 分辨率:像素点的总和 像素点: 显示屏:800*600(横向有800个像素点,纵向有600个像素点&#x…...

7.科学计算模块Numpy(4)ndarray数组的常用操作(二)
引言 书接上回,numpy能作为python中最受欢迎的数据处理模块,脱离不了它最核心的部件——ndarray数组。那么,我们今天就来了解一下numpy中对ndarray的常用操作。 通过阅读本篇博客,你可以: 1.掌握ndarray数组的分割 …...

抖音评论区截流脚本软件详细使用教学,抖音私域获客引流的五种方法。
1.先说下什么是抖音截流玩法,截流顾名思义就是在别的博主的视频下面去截流评论潜在流量,然后用评论文案的形式或者其它方式吸引用户加我们的私域~ 玩截流一定不是主动去私信别人,这个就不叫截流了,且一个账号私信多了一定会降权和…...

Linux_kernel移植uboot07
一、移植 根据硬件平台的差异,将代码进行少量的修改,修改过后的代码在目标平台上运行起来 移植还需要考虑硬件环境,驱动只需要考虑内核的环境 二、移植内容 1、移植Uboot uboot属于bootloader的一种,还有其他的bootloader&#x…...

Day-04-QFile打开文件的两种方式
一、UI界面设置两个按键,并直接转到槽函数 二、两种代码展示 #include <QFile> #include <QDebug>//此两种方式中调用函数,应包含的头文件void Widget::on_btnReadFile01_clicked()//第一种打开方式 {//1. 打开文件QFile file;file.setFile…...

第三部分:4---进程地址空间
目录 数组的空间分配解析: 物理地址和虚拟地址: 虚拟地址空间: 进程地址空间的本质: 为什么要有进程地址空间? 页表对进程访问内存的检查: 进程地址空间和页表如何关联起来? 进程的独立…...

【Android】程序开发组件—探究Jetpack
引言 Jetpack是一个开发组件工具集,它的主要目的是帮助我们编写出更加简洁的代码,并简化我们的开发过程,在这么多的组件当中,最需要我们关注的其实还是架构组件,接下来就对Jetpack的主要架构组件进行学习!…...

pytorch torch.norm函数介绍
torch.norm 函数用于计算张量的范数(norm),可以理解为张量的“长度”或“大小”。根据范数的不同类型,它可以衡量不同的张量性质。该函数可以计算 向量 和 矩阵 的多种范数,如 L1范数、L2范数、无穷范数 等。 1. 函数…...

【lc_hot100】刷题心得
链表 二叉树 二叉树相关的题目基本都有个基本的框架,基本框架就是二叉树的四种遍历方法:前序遍历、中序遍历、后序遍历、层序遍历 往往常用的是前序遍历和中序遍历 图 图跟二叉树一样都有自己的的基本框架,基本框架就是图的两种遍历方法&am…...

FANUC 数控 A06B-6058-H227 伺服放大器
发那科伺服放大器是一种控制电机的电子装置,属于电机控制系统的一部分,用于将输入信号放大并转换成电动机可以理解的信号,从而实现运动控制和定位。 发那科伺服放大器的主要作用包括: 实现运动控制:通过控制…...

Python将表格文件中某些列的数据整体向上移动一行
本文介绍基于Python语言,针对一个文件夹下大量的Excel表格文件,对其中的每一个文件加以操作——将其中指定的若干列的数据部分都向上移动一行,并将所有操作完毕的Excel表格文件中的数据加以合并,生成一个新的Excel文件的方法。 首…...

基于YOLOv8的PCB缺陷检测算法,加入一种基于内容引导注意力(CGA)的混合融合方案(一)
💡💡💡本文内容:针对基于YOLOv8的PCB缺陷检测算法进行性能提升,加入各个创新点做验证性试验。 1)提出了一种基于内容引导注意力(CGA)的混合融合方案,mAP0.5由原始的0.966提升至0.975 1.PCB缺陷…...

如何在红米手机中恢复已删除的照片?(6 种方式可供选择)
凭借出色的相机和实惠的价格,小米红米系列已成为全球知名品牌。但是,最近有些人抱怨他们在 红米设备上丢失了许多珍贵的图片或视频,并希望弄清楚如何从小米手机恢复已删除的照片。好吧,在小米设备上恢复已删除的视频/照片并不难。…...

嵌入式实时操作系统(RTOS):原理、应用与发展
摘要:本文围绕嵌入式实时操作系统(RTOS)展开。首先介绍嵌入式系统与实时操作系统的概念,阐述嵌入式 RTOS 的体系结构。接着分析其关键特性,包含任务管理(如任务的创建与删除、调度、同步与通信)…...

C#里使用位图容器BitArray
由于经常需要操作一些位表示的数据结构,那么就需要采用位图的管理方式。 在C#里就是使用BitArray来管理位图数据结构,这样就比较方便处理。 这个类可以有多种构造函数,可以满足绝大部分的要求。 比如从网络协议里传送过来的字节流,就可以直接写入到里面,就可以直接获取…...

如何在 Kali Linux 上安装 pip3
如何在 Kali Linux 上安装 pip3 在 Kali Linux 上安装 pip3 的过程非常简单。按照以下步骤,你可以轻松完成安装并开始使用 pip3 管理 Python 软件包。 步骤 1:打开终端 首先,打开你的 Kali Linux 终端。 步骤 2:更新软件包列表…...

5.2 排列与代数余子式
一、求行列式的方法 计算机是利用主元计算行列式的。本节介绍其它两种计算行列式的方法。一是 “大公式”(big formula),它使用了全部 n ! n! n! 个排列计算;二是 “代数余子式公式”(cofactor formula)&…...

java框架第五课(终极版本)SpringBoot
一.关于SpringBoot (1)回忆Spring 传统的Spring由Spring 框架(ioc,aop)加mybatis加Springweb组成,虽然相比原生的java程序Spring框架帮我们大大减少了代码量,减少了冗余,提高了开发效率但是由于Spring框架下的配置和相关的jar包依赖过多&am…...

聚类案例——汽车是否值得购买
对汽车是否值得购买,进行聚类分析: 1、数据指标解释: buying, 购买费用 maint, 维修费用 doors, 车门数量 person, 乘坐人数 lug_boot, 行李箱容量 safety, 安全性 2、对数据进行转换 将字符串转换映射量化为数字 数据加载:…...

网络编程9.10
使用数据库完成工人管理系统: ubuntuubuntu:DB$ ubuntuubuntu:DB$ cat 2.c #include <myhead.h> #include <sqlite3.h> #include <string.h>typedef struct {int id;char name[20];double salary; } Worker;int do_insert(sqlite3 *ppDb) {Worker work;pri…...

如何在SQL Server中恢复多个数据库?
一次性恢复多个 SQL数据库吗可以吗? "是的,可以一次性恢复多个 SQL 数据库。通常情况下,只要备份文件的名称与相应的数据库匹配,且没有附加的日期或时间信息,就可以通过有效的 T-SQL 脚本来完成恢复。如果你希望…...

炸裂!新版 SD WebUI Forge 出图速度更快!支持最新Flux 模型!(保姆级安装教程)
大家是不是经常为SD WebUI卡顿、爆显存而苦恼?一启动SD 电脑就开始发烫, 尤其低显存用户屡屡"中招",不得不一遍遍重启。作为AI绘画的必备工具,WebUI却还有这么多"坑",着实让人不爽!😠 好消息是,…...

laserOdometry.cpp源码注释
本博客用于a-loam源码学习,用于和slam初学者一起学习。 #include <cmath>#include <nav_msgs/Odometry.h>#include <nav_msgs/Path.h> //这两行代码是C中包含头文件的指令,它们用于在ROS(Robot Operating System…...

STM32时钟配置图详解
一图概述: 左侧输入时钟源 Input Frequency (LSE/LSI/HSI/HSE) LSE (Low-Speed External):外部32.768 kHz晶体振荡器,通常用于RTC(实时时钟)。LSI (Low-Speed Internal):内部低速时钟,频率为…...