<div dir="ltr"><div><div><div><div><div><div>Hi,<br></div><div>To precise the question about mpich/openmpi, I have been working on packaging numerical libraries like PETSc, ATLAS, Hypre, ARPACK in the past weeks. Unfortunately, research and teaching have slowed down the process a lot...<br>
</div></div><br></div>I would like to open a discussion about where to install mpich [1] and openmpi [2] and libraries built against them. There are two aspects to be considered:<br></div></div>- the MPI implementation is compiled to be used with one compiler.<br>
</div><div>- the libraries built with mpich and openmpi cannot be mixed (they might compile and link but will generally fail at runtime).<br><br></div><div>Since the MPI binaries and libraries should be compiler dependent they cannot live in /usr/ and moreover the libraries compiled with mpicc/mpicxx etc.. are MPI implementation-dependent.<br>
</div><div>In the past I have been installing the "bundle" (i.e for one pair (MPI implementation, compiler)) in the prefix /usr/lib/$MPI/$COMPILER and switching between them using the environment-modules tool [3]. Moreover 32bit and 64bit should be provided.<br>
</div><div><br></div>I wrote a file "<a href="http://mpi-macros.mk">mpi-macros.mk</a>" which contains predefined variables and paths like the following:<br clear="all"><div><div><div><div><div><div><div><div><div>
<pre><div class="" id="LC35"><span class=""># Default to mpich</span></div><div class="" id="LC36"><span class="">MPI_IMPLEMENTATION</span> <span class="">?=</span> <span class="">$(</span>MPI.mpich<span class="">)</span></div>
<div class="" id="LC37"><span class="">MPI_COMPILER</span> <span class="">=</span> <span class="">$(</span>COMPILER<span class="">)</span></div><div class="" id="LC38"><br></div><div class="" id="LC39"><span class="">MPI_BUNDLE</span> <span class="">=</span>        <span class="">$(</span>MPI_IMPLEMENTATION<span class="">)</span>-<span class="">$(</span>MPI_COMPILER<span class="">)</span></div>
<div class="" id="LC40"><br></div><div class="" id="LC41"><span class="">MPI_PREFIX</span> <span class="">=</span>        <span class="">$(</span>USRLIBDIR<span class="">)</span>/<span class="">$(</span>MPI_IMPLEMENTATION<span class="">)</span>/<span class="">$(</span>MPI_COMPILER<span class="">)</span></div>
<div class="" id="LC42"><br></div><div class="" id="LC43"><span class="">CONFIGURE_DEFAULT_DIRS</span><span class="">=</span>no</div><div class="" id="LC44"><br></div><div class="" id="LC45"><span class="">MPI_BINDIR.32</span> <span class="">=</span>     <span class="">$(</span>MPI_PREFIX<span class="">)</span>/bin</div>
<div class="" id="LC46"><span class="">MPI_BINDIR.64</span> <span class="">=</span>     <span class="">$(</span>MPI_PREFIX<span class="">)</span>/bin/<span class="">$(</span>MACH64<span class="">)</span></div><div class="" id="LC47">
<span class="">MPI_BINDIR</span>    <span class="">=</span>     <span class="">$(</span>MPI_BINDIR.<span class="">$(</span>BITS<span class="">))</span></div></pre>(same with libraries, but data/doc/man system wide)<br><br>
</div><div>And added Makefiles to create packages with fmri library/mpich-gcc, library/openmpi-gcc and other libraries with the same naming scheme. The same could be done with studio if needed.<br></div><div>I chose the MPI_PREFIX like that as it is usually discouraged to add something in /usr (/usr/mpich,/usr/openmpi) and since putting things in /usr/gcc could not allow to get something consistent for studio (there is no /usr/studio).<br>
</div><div><br></div><div>In each case, after including <a href="http://shared-macros.mk">shared-macros.mk</a> I declare MPI_IMPLEMENTATION = mpich (or openmpi) and then<br><pre><span class="">include $(WS_MAKE_RULES)/<a href="http://mpi-macros.mk">mpi-macros.mk</a></span></pre>
</div><div><br></div><div>I would like to know if it sounds reasonable to you before I convert all my makefiles to use oi-build.<br><br>Finally, I intend to provide modulefiles to be able to switch easily between these "bundles" using environment-modules. This latter requires bash-completion: has someone already packaged it ?<br>
</div><div>Some Linux distributions provide a tool to switch between MPI by changing symlinks in /usr but this is not satisfactory and error-prone.<br></div><div><br></div><div>Thank you for your comments.<br></div><div>Best regards,<br>
<br>Aurélien<br></div><div><br><br>[1] <a href="http://www.mpich.org/">http://www.mpich.org/</a><br>[2] <a href="http://www.open-mpi.org/">http://www.open-mpi.org/</a><br>[3] <a href="http://modules.sourceforge.net/">http://modules.sourceforge.net/</a><br>
<br>-- <br><font style="font-family:courier new,monospace" size="1">-------------------------------------------------------------------------------<br>LARCHER Aurélien            | KTH, School of Computer Science and Communication<br>

Work: <a value="+4687907142">+46 (0) 8 790 71 42</a>   | Lindstedtsvägen 5, Plan 5<br>Mob.: <a value="+46709464017">+46 (0) 7 09 46 40 17</a> | 100 44 Stockholm, SWEDEN<br>-------------------------------------------------------------------------------<br>
Praise the Caffeine embeddings ...</font>
</div></div></div></div></div></div></div></div></div></div>