|
Article ID: 681
Last updated: 19 Dec, 2025
Darshan is an open-source, lightweight high-performance computing I/O characterization toolkit developed at Argonne National Lab. Darshan instruments applications and captures calls to the POSIX, MPI-IO, STDIO, and HDF5 interfaces, and provides some limited information about PnetCDF. Statistics collected by Darshan include (but are not limited to) the number, size, and time spent on I/O calls, as well as the number and names of files, POSIX I/O access patterns (such as the access sizes and the numbers of total, consecutive, and sequential operations), timespan from first to last access, and estimated performance. Darshan on NAS SystemsTwo different Darshan builds are available. One was built on a PFE for MPI applications that use HPE MPT, and the other was built for non-MPI applications. Both are described below. Note that the two builds are installed in different locations. Darshan for HPE MPI ApplicationsAfter loading an Intel compiler module and an HPE MPT module, this Darshan runtime was built with these options:
Darshan for Non-MPI ApplicationsThis Darshan runtime was built with these options:
Instrumenting Your Application Using darshan-runtimeYou can enable Darshan instrumentation either at compile/link time or at runtime. Runtime instrumentation is a quicker way to get started using Darshan, as it does not require modification to your existing executable; rather, it's done by setting the LD_PRELOAD environment variable for your PBS batch job as described below. As the application runs, Darshan records statistics for each process. At the end of the run, Darshan collects, aggregates, compresses, and writes a log file to a location specified by the environment variable DARSHAN_LOG_PATH. The filename of the Darshan binary log will likely follow this format: <USERNAME>_<BINARY_NAME>_<JOB_ID>_<DATE>_<UNIQUE_ID>_<TIMING>.darshan. You can change the location and name of the Darshan log by setting the variable DARSHAN_LOGFILE=/path/name.darshan. Using darshan-runtime for HPE MPI ApplicationsUse the following PBS script to run your HPE MPI application with Darshan. Note: For MPI applications, the MPI_SHEPHERD environment variable must be set to true (highlighted in the script below) to avoid deadlock when preloading the Darshan shared library.
TIP: By default, Darshan aggregates statistics for files accessed by all ranks and collapses them into a single cumulative file record. If you want to retain the per-process information (which will result in a larger log file), set this variable:
export DARSHAN_DISABLE_SHARED_REDUCTION=1 Using darshan-runtime for Non-MPI ApplicationsUse the following PBS script to run your non-MPI application with Darshan. Note: For non-MPI applications, the DARSHAN_ENABLE_NONMPI environment variable must be set to 1 (highlighted in the script, below).
Note: Darshan does not necessarily interfere with other profiling tools, such as the NAS-developed mpiprof tool. However, outputs generated by other profiling tools will likely also be counted in the Darshan binary log, which may confuse your analysis. Darshan Extended TracingDarshan can perform eXtended Tracing (DXT) of the MPI-IO and POSIX I/O to provide details on each read or write operation issued by each rank, as well as which ranks are performing I/O and how long they are spending on I/O. A memory limit of 2 MebiByte (MiB) each for DXT_MPIIO and DXT_POSIX modules is set as default. Note: DXT may result in longer runtime and higher memory overheads. It is also possible that the tracing log may be incomplete if a Darshan DXT module runs out of memory to store new record data. To use DXT to trace all files, add one of the following lines in your PBS script:
You can also select which items you want to include in or exclude from DXT (for example—files, ranks, or small I/O operations) by providing a trace configuration file or by setting certain DXT environment variables. For more information, read Darshan-runtime installation and usage documentation. Analyzing Darshan Log Files with darshan-util ToolsThe Darshan log file generated can be ported to and analyzed on systems where darshan-util is installed. You can perform the analysis on a PFE by loading either the HPE MPI version or the non-MPI version of the Darshan modulefiles, as shown below. Note: Some of the darshan-util tools also require Perl, pdflatex, gnuplot, and epstopdf, which can be found in the pkgsrc/2023Q3 directory on NAS systems.
After you load the Darshan and pkgsrc modulefiles, you can use one of the following darshan-util tools on a PFE. darshan-job-summary.plThe darshan-job-summary.pl tool processes the Darshan binary log (for example, name.darshan) and generates a multi-page PDF (name.darshan.pdf) containing graphs, tables, and performance estimates characterizing the I/O activity of the job: pfe% darshan-job-summary.pl name.darshan A sample PDF provided by the Darshan developers can be found here. darshan-summary-per-file.shThis script is similar to darshan-job-summary.pl except that it produces a separate PDF summary for every file accessed by the application: pfe% darshan-summary-per-file.sh name.darshan output-dir where output-dir is a directory to be created; it will contain the collection of PDFs (one PDF per file). Note: Using this utility is not recommended if your application opens a large number of files. darshan-parserThe darshan-parser tool extracts everything from a Darshan log and displays it in text format. It provides more information than darshan-job-summary.pl. pfe% darshan-parser [options] name.darshan > name.txt To show the available options, do: darshan-parser -h To extract information for a specific file from a Darshan log containing statistics for many files, and produce a Darshan log for that file, complete these steps:
darshan-dxt-parserIf you used DXT to generate a trace file (for example, dxt_name.darshan), use the darshan-dxt-parser tool to generate a text output: pfe% darshan-dxt-parser [--show-incomplete] dxt_name.darshan > dxt_name.txt The option --show-incomplete will display results even if the log is incomplete. Known IssuesWhen you post-process the Darshan binary log for runs performed under a Lustre filesystem with progressive file layout, the following error will occur:
However, this error does not affect other I/O statistics (such as the POSIX or MPIIO stats) collected by Darshan for your application. References |