fi_mon_sampler(1)
π fi_mon_sampler(1) β the libfabric sampler page, but make it make sense
okay so bestie, this is a page from the Libfabric v2.7.0 manual set (yes, the Libfabric Programmer's Manual, she's famous) and it's all about fi_mon_sampler, a simple sampler for the ofi_hook_monitor provider. ngl she's niche but she's iconic. let's get into it π
β¨ NAME β¨
fi_mon_sampler β a simple sampler for the ofi_hook_monitor provider. that's literally her whole job and she ate π
πΈ SYNOPSIS πΈ
fi_mon_sampler [OPTIONS] <target> sample from file(s) at <target>
like, you give her a <target> and some [OPTIONS] and she samples from the file(s) at that target. no cap β¨
π¦ DESCRIPTION π¦
so what she actually does: she extracts data from the ofi_hook_monitor provider through communication files. that's the whole vibe.
<target> can be either one single communication file or a whole folder of files β dealer's choice, she's flexible like that π«Ά
the data gets exported based on -f <format>, and then either:
- printed to stdout β but only for single files, okay? don't @ me
- stored per communication file at
-o <outpath>
and if you're the impatient type, she can watch those communication files for changes via -w <msec> so she just keeps sampling on repeat. lowkey obsessed with that feature tbh π
π§ the output file name format (iykyk)
the name format of the output files is based on the ofi_hook_monitor provider, and it goes like this:
<ppid>_<pid>_<sequential id>_<job id>_<provider name>
quick breakdown bestie:
ppidandpidare taken from the perspective of the monitored application β important detail, don't forget it π- in a batched environment running SLURM,
job idis set to the SLURM job ID - otherwise?
job idis just0. slay.
π HOW TO RUN π
step one: launch a libfabric application with FI_HOOK=monitor to enable the ofi_hook_monitor provider. adjust the monitor provider settings according to fi_hook(7). yes, actually read that one, it matters β¨
step two: launch the sampler like this:
fi_mon_sampler -o <output> <target>
and a fun little default for you: by default, the ofi_hook_monitor provider stores data at
/dev/shm/ofi/<uid>/<hostname>
the sampler will generate output files in the directory you specified at <output> β one for each monitored provider. cute, organized, main character energy π
π OPTIONS π
-w <msec>β watch files for changes, and check every<msec>milliseconds. she's watching π-f <format>β output format. currently she only supportsCSVβ that's it, that's the list, don't come for her π-o <outpath>β output file path. uses stdout if unset. so if you forget it, no worries, she'll just print at you π«Ά
π USAGE EXAMPLES π
okay so first, launch a libfabric application and enable the ofi_hook_monitor provider:
FI_HOOK=monitor fi_pingpong [OPTIONS]
then launch another fi_pingpong with the respective settings. two pingpongs, living their best lives ππ
finally β and this is the moment β launch the sampler:
fi_mon_sampler -o $HOME -w 1000 -f csv /dev/shm/ofi/$UID/$HOSTNAME
literally that's it. periodt β¨
π OUTPUT π
output files will be generated in the folder specified at -o <output>.
in -f csv mode, that folder will contain a CSV file with data for all monitored libfabric functions. for each function, both the count and sum counters are exported β and you can tell which is which by the column name suffix _c and _s respectively π₯
plus, each function is monitored for each data size bucket. refer to fi_hook(7) for more details, she explains the buckets way better than I can.
example CSV output β here's the first four columns and the first three rows:
mon_recv_0_64_c,mon_recv_0_64_s,mon_recv_64_512_c,mon_recv_64_512_s
0,0,0,0
22529,0,0,0
113664,0,0,0
look at those numbers go πβ¨
π SEE ALSO π
fi_hook(7)β go read it, bestie, it's the whole context π«Ά
π AUTHORS π
OpenFabrics. legends, honestly π
okay that's the page!! no cap, every flag's there π
and finally, the cute sign-off: this one's from the Libfabric Programmer's Manual, dated 2025-06-06, shipping with Libfabric v2.7.0 β go forth and sample, bestie π¦π
π¦ where this page comes from
- arch rolling: libfabric 2.7.0-1 Β· BSD-2-Clause OR GPL-2.0-or-later
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash-1017 on : a language model's rewrite of the original, under its terms