Choosing a Specific Collective Algorithm Implementation in OpenMPI

Saliya Ekanayake
1 min readJun 19, 2019

--

Unless you are profiling the performance of specific collective routine, this is not something an everyday MPI programmer would have to do. Typically, OpenMPI implementation will select the best algorithm to use in a particular collective call depending on factors such as the message size and the number of communicating processes.

Well, if you are a poor soul like me benchmarking these stuff, then here’s what you can do.

ompi_info --param coll tuned -l 9

The above command will return everything you’ll ever want to know about the tuned collectives available in OpenMPI. For example, here’s what it shows me for the allgatherv algorithm.

MCA coll: 
parameter "coll_tuned_allgatherv_algorithm"
(current value: "ring",
data source: file ($HOME/.openmpi/mca-params.conf),
level: 5 tuner/detail,
type: int)
Which allallgatherv algorithm is used.
Can be locked down to choice of:
0 ignore,
1 default (allgathervv + bcast),
2 bruck,
3 ring,
4 neighbor exchange,
5: two proc only.
Valid values: 0:"ignore", 1:"default", 2:"bruck", 3:"ring", 4:"neighbor", 5:"two_proc"

If you want to pick a specific algorithm to be used irrespective of data size or the number of processes, you can set that in the $HOME/.openmpi/mca-params.conf. For example, here’s how you can pick the bruck algorithm.

coll_tuned_use_dynamic_rules = 1
coll_tuned_allgatherv_algorithm = 2

--

--