To compile OpenMPI against Infiniband
you only have to specify the directory where its support header files and libraries were installed to Open MPI's configure script
--with-openib=
Build support for OpenFabrics (previously known as "Open IB", for Infiniband and iWARP networks -- note that iWARP support was added in the v1.3 series).
# ./configure --with-openib=/path/to/openib/installation
For more information on myrinet etc, do go to the FAQs.