Skip to main content
Glama
darshan-tools

darshan-tools

by Presciman

Darshan I/O analysis: skill, schema and tools

For an LLM agent that answers questions about a Darshan I/O log, where every number in the answer is retrieved from the log by a tool rather than estimated by the model.

Part

Where

What it is

Skill

.claude/skills/darshan-analysis/SKILL.md

The analysis method: which bottleneck classes to check and in what order, ranked fixes, and how to treat zeros, absent modules and -1.

Schema

darshan_tools/schema/darshan_schema.yaml

The two-layer Darshan schema template. Layer 1 holds the counter families grouped by concern; layer 2 holds the relations derived from them. darshan_to_schema.py fills it from a log.

Tools

darshan_tools/

outline / search / get over the filled schema. darshan(view) returns exact facts from the binary log, including cards: one card of canonical measures per analysis concern (volume, bandwidth, request sizes, metadata, files, rank balance, MPI-IO, Lustre, DXT, bottleneck, verdict, ...). calc does exact arithmetic.

Install

Requires Python ≥ 3.10 and PyDarshan (pip install darshan). PyDarshan needs libdarshan-util. The PyPI wheels bundle it on x86-64 Linux; elsewhere, put a darshan-util install on LD_LIBRARY_PATH or darshan-parser on PATH.

pip install -e .

Related MCP server: observe-mcp

Use

In Claude Code, open this repository as the project. The skill loads from .claude/skills/, and .mcp.json starts the tools as the darshan-tools MCP server, whose instructions explain the schema and how to answer from the cards. Then ask:

analyze /path/to/job.darshan — is it I/O-bound, and what limits its bandwidth?

In any other MCP client, run darshan-tools-mcp over stdio. Call open_log(log) first, then darshan(view="cards"), outline, search, get and calc.

From a shell:

darshan-tools schema job.darshan -o job.schema.json   # the filled two-layer schema
darshan-tools view job.darshan cards                  # all cards; also derived, job, ranks, files, ...
darshan-tools calc "10963279 / MiB"

--nodes N (CLI) or open_log(log, nodes=N) gives the node count. It is needed only when DXT did not trace every rank; otherwise the DXT hostnames give it.

Conventions worth knowing

  • Every measure is computed from the log as Darshan's own tools reduce it: accumulate_records, the same reduction as darshan-parser --total. Bandwidth is darshan-parser --perf's agg_perf_by_slowest.

  • A size is "small" when it falls in a Darshan size bin up to 1 MiB. "Strictly small" excludes accesses of exactly 1 MiB, which Darshan counts in its 100K–1M bin.

  • A card whose concern does not exist in the job (e.g. MPI-IO in a POSIX-only run) says not_applicable with the reason and carries no numbers.

  • darshan(view="derived") lists every derived metric with the formula that produced it.

License

MIT.

Available Tools

6 tools
calcA

Exact arithmetic. Use it for every computation instead of doing math in your head. Supports + - * / ** %, parentheses, lists, min max abs round sqrt log2 log10 sum mean, and the constants KiB MiB GiB TiB KB MB GB. Example: calc('1554195 / MiB / 0.0772').

Inputs: expression (required), log.

darshanA

Exact facts from this job's binary Darshan log, at full precision, by view. darshan('cards') returns one card of canonical measures per analysis concern; call it first. darshan('index') lists the views. Use darshan('derived') for any rate, fraction, ratio, mean or efficiency: it holds Darshan's standard derived metrics, each with the formula that produced it.

Inputs: view (required), log.

getA

Return one named item exactly: a counter or header field name (raw dump), or a dotted field path and its subtree (schema).

Inputs: key (required), log.

open_logA

Open a .darshan log: fill its two-layer schema and extract its exact facts. Call this before any other tool. nodes is the node count, needed only when DXT did not trace every rank.

Inputs: log (required), nodes.

outlineA

List the structure of the evidence: every field or counter name available, without values. Call this first to see what exists.

Inputs: log.

Tool Schema Changelog

Recent tool additions, removals, and schema changes observed during successful MCP inspections.

Loading tool schema changelog…

    TDQS

    A3.6/5.0

    Scored across 6 tools

    Disambiguation3/5

    open_log, outline, and darshan each instruct the agent to 'call this first,' creating conflicting entry-point guidance, and outline vs. darshan('index') both enumerate what exists. The two-layer raw/schema model and the darshan view tool do help differentiate the rest, and search/get/calc are clearly distinct.

    Naming Consistency3/5

    Most names are lowercase single verbs, but open_log is the lone snake_case compound, calc is an abbreviation, and darshan is a domain noun rather than an action. The set is still readable, but there is no single predictable convention.

    Tool Count5/5

    Six tools is well within the healthy 3-15 range, and each appears to earn its place: open_log for setup, outline/search/get for evidence querying, calc for exact arithmetic, and darshan for canonical/derived views. Nothing looks redundant in count terms.

    Completeness4/5

    The surface covers the core analysis lifecycle: opening a log, discovering structure, searching/retrieving fields, computing, and pulling canonical/derived views. Minor gaps exist around log discovery (listing available logs) and export/visualization, but agents can work around these.

    Related MCP Connectors

    Related MCP Servers

    • A
      license
      A
      quality
      B
      maintenance
      Enables language models and users to perform exact arithmetic, symbolic math, unit/date conversions, statistics, and read-only SQL queries over registered files, with every operation logged by a citable ID that humans can re-run.
      11
      MIT
    • A
      license
      A
      quality
      C
      maintenance
      Enables querying OpenObserve logs—listing streams, inspecting schemas, and running SearchSQL time-windowed searches—so you can answer what actually happened in production. Optionally correlates those logs against a database through a verified read-only connection via DbSchema and DbQuery tools.
      3
      MIT
    • A
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents to analyze, cluster, compare, and export reports from local log files through seven read-only tools, returning compact evidence packs with line-number citations instead of raw log dumps. All processing happens on the local machine, so log data never leaves the environment.
      828 PyPI
      1
      MIT
    • F
      license
      Not graded
      quality
      A
      maintenance
      Enables AI agents to query and debug trace, session, observation, and exception data, analyze latency and metrics, and manage prompts, datasets, and annotation queues. Supports selective tool-group loading, compact or file-dump output, and a read-only mode for safer access.
      -