下载Darshan源码
官网下载地址:https://www.mcs.anl.gov/research/projects/darshan/download/
解压源码压缩包
#解压安装包
tar -xvzf darshan-<version-number>.tar.gz
#生成配置文件
cd darshan-<version-number>
./prepare
Darshan的源文件结构主要分为:
- darshan-runtime: 检测 MPI 应用程序和生成 I/O 特征日志所必需的 Darshan 运行时框架,它是 Darshan 特征工具的检测部分。Darshan 通过编译时包装器或动态库预加载来检测应用程序。使用 Darshan 检测的应用程序每次执行时都会生成一个日志文件。此日志总结了应用程序使用的 I/O 访问模式。darshan-runtime 检测传统上仅支持 MPI 应用程序(特别是那些调用 和 的应用程序MPI_Init())MPI_Finalize(),但从版本 3.2.0 开始,Darshan 还支持非 MPI 应用程序的检测。无论是否使用 MPI,Darshan 都会提供有关应用程序进行的 POSIX 级别文件访问的详细统计信息。对于 MPI 应用程序,Darshan 还捕获有关 MPI-IO 和 HDF5 级别访问的详细信息,以及有关 PnetCDF 访问的有限信息。请注意,非 MPI 应用程序的检测目前仅在 Darshan 的共享库中受支持,应用程序必须支持该库LD_PRELOAD。
- darshan-util: 用于分析给定 Darshan I/O 特征日志内容的 Darshan 实用程序,这是一个用于解析和汇总 Darshan 检测生成的日志文件的工具集合。darshan-util 软件包可以在任何系统上安装和使用,无论日志最初在哪里生成。Darshan 日志文件与平台无关。
安装Darshan-runtime
cd darshan-runtime
./configure --with-log-path=/darshan-logs --with-log-path-by-env=$LOGNAME --with-jobid-env=PBS_JOBID CC=mpicc
make -j 16
make install
Darshan-runtime的使用
#指定生成日志路径和日志名
export DARSHAN_LOGPATH=/opt/testfile
export DARSHAN_LOGFILE=/opt/testfile/log
#非mpi程序
export DARSHAN_ENABLE_NONMPI=1
LD_PRELOAD=/opt/software/darshan-3.4.3/darshan-runtime/lib/.libs/libdarshan.so io-test
#mpi程序
mpiexec -n 4 LD_PRELOAD /home/carns/darshan-install/lib/libdarshan.so mpi-io-test
安装Darshan-util
cd darshan-util
./configure
make -j 16
make install
Darshan-util的使用
#依赖包安装
apt-get install texlive-latex-extra
apt-get install texlive-latex-base
apt-get install texlive-font-utils
apt-get install gnuplot
1.darshan-job-summary.pl
使用图形摘要工具生成作业 I/O 活动的图形摘要,使用参数–output指定输出文件名称。
darshan-job-summary.pl log --output logoutput.pdf
输出样例:
2. darshan-summary-per-file.sh
该实用程序类似于 darshan-job-summary.pl,不同之处在于它为应用程序访问的每个文件生成单独的 pdf 摘要。
darshan-summary-per-file.sh log logdir
3.darshan-parser
使用darshan-parser命令行实用程序获取日志文件中包含的所有信息的完整、人类可读的文本格式转储。
darshan-parser log > job-characterization.txt
输出样例:
遇到的问题
Base class package "Pod::Select" is empty.
(Perhaps you need to 'use' the module which defines that package first,
or make that module available in @INC (@INC contains: /usr/local/lib /etc/perl /usr/local/lib/x86_64-linux-gnu/perl/5.34.0 /usr/local/share/perl/5.34.0 /usr/lib/x86_64-linux-gnu/perl5/5.34 /usr/share/perl5 /usr/lib/x86_64-linux-gnu/perl-base /usr/lib/x86_64-linux-gnu/perl/5.34 /usr/share/perl/5.34 /usr/local/lib/site_perl).
at /usr/local/lib/Pod/LaTeX.pm line 29.
BEGIN failed--compilation aborted at /usr/local/lib/Pod/LaTeX.pm line 29.
Compilation failed in require at /usr/local/lib/TeX/Encode.pm line 10.
BEGIN failed--compilation aborted at /usr/local/lib/TeX/Encode.pm line 10.
Compilation failed in require at /usr/local/bin/darshan-job-summary.pl line 12.
BEGIN failed--compilation aborted at /usr/local/bin/darshan-job-summary.pl line 12
这个错误表明在运行 darshan-job-summary.pl 脚本时,Perl 编译器无法找到 Pod::Select 模块。解决这个问题的一种方法是确保你的系统上安装了 Pod::Select 模块。使用 CPAN(Comprehensive Perl Archive Network)来安装 Perl 模块。首先,打开终端并运行以下命令:
sudo cpan
install Pod::Select
安装完成后退出。
exit
Darshan文档
Darshan官方文档:https://www.mcs.anl.gov/research/projects/darshan/documentation/