Openmpi flavors in Nvidia HPC toolkit

The nvida hpc toolkit 23.3 comes with openmpi 3.1.5 which has a softlink comm_libs/mpi pointing to it. There is also an openmpi4/openmpi-4.0.5 under comm_libs.

What is the proper way to use openmpi4 with the toolkit? Simply change the softlink is there some other setting or flag that should be used?

I usually just set my PATH to point at the OpenMPI4 bin directory and where needed, LD_LIBRARY_PATH to the lib directory. Though if you want to change the “mpi” link to “openmpi4/openmpi-4.0.5” that would work as well.

Note that there’s also a third MPI implementation installed, HPCX.