fi\_mon\_sampler(1) #VERSION# fi\_mon\_sampler(1)

# [NAME](#NAME)

fi\_mon\_sampler - Simple sampler for ofi\_hook\_monitor provider.

# [SYNOPSIS](#SYNOPSIS)

```


 fi_mon_sampler [OPTIONS] <target>      sample from file(s) at <target>
    
```

# [DESCRIPTION](#DESCRIPTION)

Extract data from the ofi\_hook\_monitor provider via communication files. &lt;target&gt; can either be one communication file or a folder of files. Data is exported based on -f &lt;format&gt; and either printed to stdout (only for single files), or stored per communication file at -o &lt;outpath&gt;. The sampler can watch the communication files for changes via the option -w &lt;msec&gt; for repeated sampling.

The name format of the output files is based on the ofi\_hook\_monitor provider and is as follows: &lt;ppid&gt;\_&lt;pid&gt;\_&lt;sequential id&gt;\_&lt;job id&gt;\_&lt;provider name&gt;. ppid and pid are taken from the perspective of the monitored application. In a batched environment running SLURM, job id is set to the SLURM job ID, otherwise it is set to 0.

# [HOW TO RUN](#HOW_TO_RUN)

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)](/man/enterprise-packages/libfabric/fi_hook.7).

Then launch the sampler via fi\_mon\_sampler -o &lt;output&gt; &lt;target&gt;. By default, the ofi\_hook\_monitor provider stores data at /dev/shm/ofi/&lt;uid&gt;/&lt;hostname&gt;.

The sampler will generate output files in the directory specified at &lt;output&gt;, one for each monitored provider.

# [OPTIONS](#OPTIONS)

[*-w &lt;msec&gt;*](#w)

Watch files for changes, check every &lt;msec&gt; milliseconds.

[*-f &lt;format&gt;*](#f)

Output format. Currently only supports CSV.

[*-o &lt;outpath&gt;*](#o)

Output file path. Uses stdout if unset.

# [USAGE EXAMPLES](#USAGE_EXAMPLES)

Launch a libfabric application and enable the ofi\_hook\_monitor provider:

```
FI_HOOK=monitor fi_pingpong [OPTIONS]
    
```

Launch another fi\_pingpong with the respective settings.

Finally, launch the sampler:

```
fi_mon_sampler -o $HOME -w 1000 -f csv /dev/shm/ofi/$UID/$HOSTNAME
    
```

# [OUTPUT](#OUTPUT)

Output files will be generated in the folder specified at -o &lt;output&gt;.

In -f csv mode, this will contain a CSV file with data for all monitored libfabric functions. For each function, both the count and sum counters are exported, indicated by the column name suffix \_c and \_s respectively. In addition, each function is monitored for each data size bucket. Refer to [fi\_hook(7)](/man/enterprise-packages/libfabric/fi_hook.7) for more details.

Example CSV output, first four columns, 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
    
```

# [SEE ALSO](#SEE_ALSO)

[fi\_hook(7)](/man/enterprise-packages/libfabric/fi_hook.7)

# [AUTHORS](#AUTHORS)

OpenFabrics.

2025-06-06 Libfabric Programmer’s Manual

---

Document: fi_mon_sampler(1) from libfabric 2.7.0-r2 (Chainguard OS)
Source: https://github.com/ofiwg/libfabric
