一键导入
dftracer-smoke-test
Smoke test rules for dftracer — single-process only, environment variables, DFTRACER_INIT conflict warning, and trace file paths
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
菜单
Smoke test rules for dftracer — single-process only, environment variables, DFTRACER_INIT conflict warning, and trace file paths
用 Codex 或 Claude 帮你安装 复制这段 Prompt,粘贴到 Codex、Claude 或其他助手里,让它检查 Skill 页面并帮你完成安装。
基于 SOC 职业分类
Communication-component (MPI/collective/network) bottleneck-to-optimization mappings, papers, and L1/L2/L3 strategies for the dftracer optimization pipeline
Compute-component bottleneck-to-optimization mappings, papers, and L1/L2/L3 strategies for the dftracer optimization pipeline
Key literature, bottleneck-to-optimization mappings, and strategies for the dftracer I/O optimization pipeline
Memory-component bottleneck-to-optimization mappings, papers, and L1/L2/L3 strategies for the dftracer optimization pipeline
VPIC-Kokkos-specific knowledge: build/annotation quirks, the two-stage deck-compile pattern, deck sizing for smoke vs validation runs, and the measured MPI-communication-bound diagnosis on Tuolumne. Load this skill whenever working with vpic-kokkos (github.com/lanl/vpic-kokkos).
Install and build dftracer into the session using the MCP install tool and record tool pitfalls early.
| name | dftracer-smoke-test |
| description | Smoke test rules for dftracer — single-process only, environment variables, DFTRACER_INIT conflict warning, and trace file paths |
Always run smoke tests as a single process — never with MPI or any parallelism.
session_run_smoke_test automatically strips MPI launchers (mpirun, mpiexec,
srun, jsrun, aprun, flux run) and their flags (-np, -n, --ntasks, etc.)
from the command before running.-j N (parallel make) inside a smoke test command.OMP_NUM_THREADS > 1 or GOMP_SPINCOUNT in smoke test env vars.MPI_Init unconditionally), run it with mpirun -np 1 <binary> <args> so the
tool strips it to a single rank — NOT with multiple ranks.HARD RULE — every smoke test, baseline run, and optimization iteration must write
its data and trace output to the system-detected PFS, never to /tmp or the shared
home filesystem.
system_detect / dftracer-system-detect./p/lustre5/$USER.session_run_smoke_test and session_run_with_dftracer tools route trace
files into the workspace automatically, but the application's data files
(checkpoints, plotfiles, IOR output, datasets) must be directed to the PFS by the
run command or parameter file.Example for IOR:
# Good — single process, minimal run, output on Lustre
mkdir -p /p/lustre5/$USER/workspaces/ior
./src/ior -a POSIX -b 1m -t 1m -s 1 -F -C -o /p/lustre5/$USER/workspaces/ior/ior_smoke_test
# Bad — MPI multi-process
mpirun -np 4 ./src/ior -a POSIX -b 1m -t 1m -s 1 -F -C -o /p/lustre5/$USER/workspaces/ior/ior_smoke_test
# Bad — output on /tmp or home filesystem
./src/ior -a POSIX -b 1m -t 1m -s 1 -F -C -o /tmp/ior_smoke_test
session_run_with_dftracer sets all of these automatically — do not pass them
in env_extra unless you have a specific override reason:
| Variable | Value set by the tool | Purpose |
|---|---|---|
DFTRACER_ENABLE | 1 | Activate tracing (required) |
DFTRACER_INC_METADATA | 1 | Include process/thread metadata |
DFTRACER_LOG_FILE | workspaces/<run_id>/traces/<run_id> | Trace file prefix |
DFTRACER_DATA_DIR | all (always) | Which paths to record POSIX/HDF5 I/O for |
DFTRACER_INIT | FUNCTION (see note below) | Auto-initialise without an explicit API call |
HARD RULE — always set DFTRACER_DATA_DIR=all. DFTRACER_DATA_DIR is a
path filter: dftracer only records POSIX/HDF5 events whose file paths fall under
it. Any narrower value silently drops every I/O event outside that dir — including
checkpoints/datasets on Lustre, /tmp, or the real cwd — leaving a trace with only
C_APP annotation events (which are NOT path-filtered) and no POSIX/HDF5. Set it to
all for every run and every smoke test; never scope it to a single dir. FUNCTION
mode with the app linked against dftracer already captures POSIX + HDF5 + MPI via the
built-in brahma interceptors — no PRELOAD needed — but ONLY for paths that pass the
DATA_DIR filter, so all is what makes those categories appear.
Also forward it to every rank. Exporting DFTRACER_DATA_DIR=all in a launcher
script is not enough — MPI launchers do not propagate env to compute ranks by
default. With flux run, pass each var explicitly (-x DFTRACER_DATA_DIR -x DFTRACER_ENABLE -x DFTRACER_INIT -x DFTRACER_LOG_FILE -x LD_LIBRARY_PATH ...), or
the ranks inherit a stale/leaked value and I/O gets filtered out. Verify after a run:
the trace should contain FH (file-hash) metadata entries for the actual data files
(e.g. the Lustre checkpoints), not just the run dir — a single FH pointing at one dir
means DATA_DIR was wrong.
Empty/partial-trace troubleshooting — FUNCTION mode is correct; fix DATA_DIR/LOG_FILE first.
A 0-byte trace with FUNCTION-compiled annotations is almost always a
DFTRACER_DATA_DIR / DFTRACER_LOG_FILE misconfiguration, NOT a reason to
switch to PRELOAD/HYBRID. Before suspecting the library:
DFTRACER_DATA_DIR=all when the app writes I/O anywhere outside the
monitored source dir (checkpoints, plotfiles, datasets on Lustre, /tmp, cwd).
A narrow DATA_DIR silently drops all POSIX/HDF5 events whose paths fall outside
it, yielding an empty or metadata-only trace even though annotations executed.DFTRACER_LOG_FILE is an absolute path into the run's traces/raw dir
and that dir exists (create it first — a missing dir logs unable to create log file ... errno=2 and produces a 0-byte file).DFTRACER_INIT=FUNCTION for annotated binaries. Verified on Flash-X Sedov
3D at 768 ranks: FUNCTION + DFTRACER_DATA_DIR=all + valid LOG_FILE dir →
~284k events with HDF5 I/O categories. The earlier empty smoke trace was purely
the DATA_DIR/LOG_FILE issue above.DFTRACER_INIT conflict warning: If the annotated source already contains explicit
DFTRACER_C_INIT() / DFTRACER_CPP_INIT() calls (added during Pass 1), do NOT set
DFTRACER_INIT=1. Both active simultaneously causes double-init, producing an empty
or corrupted trace file. Pass env_extra='{"DFTRACER_INIT":"FUNCTION"}' in that case.
Heuristic: grep -r "DFTRACER_C_INIT\|DFTRACER_CPP_INIT" annotated/ — if any matches,
set DFTRACER_INIT=FUNCTION.
DFTRACER_LOG_FILE must always be an absolute path inside the workspace run directory.
Trace files land at workspaces/<run_id>/traces/<run_id>.<pid>.pfw.
Never set DFTRACER_LOG_FILE to /tmp/ or any path outside the workspace.
If running the application manually outside the MCP tool:
export DFTRACER_ENABLE=1
export DFTRACER_INC_METADATA=1
export DFTRACER_LOG_FILE=/absolute/path/to/workspaces/<run_id>/traces/<run_id>
export DFTRACER_DATA_DIR=all # use 'all' when I/O lands outside the source dir (checkpoints/datasets on Lustre)
export DFTRACER_INIT=FUNCTION # FUNCTION for annotated binaries; only use PRELOAD for un-annotated apps