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:

  • ppid and pid are taken from the perspective of the monitored application β€” important detail, don't forget it πŸ’€
  • in a batched environment running SLURM, job id is set to the SLURM job ID
  • otherwise? job id is just 0. 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 supports CSV β€” 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