LAM/MPI logo

LAM/MPI General User's Mailing List Archives

  |   Home   |   Download   |   Documentation   |   FAQ   |   all just in this list

From: Davide Cesari (dcesari_at_[hidden])
Date: 2006-05-19 04:50:41


Valter Dal Bo ha scritto:
> Dear Brian,
>
> Thank you 4 your kind help.
> Very interesting that modules application that you pointed out !
> I will definately take into consideration.
>
> Cheers
> Valter
>
> <snip>
>

As a simpler and more limited alternative to using modules, supposing
that all mpi versions reside in /usr/local/* and that bash is used as
default shell, I propose the following script (let's call it defmpi and
put it somewhere in PATH) which I use on our cluster:

----
#!/bin/bash
mpi=${1:-lam}
if [ ! -d /usr/local/$1 ]; then
   echo "Errore: non esiste la directory /usr/local/$mpi"
else
   if [ -n "$MPI" ]; then
     PATH=${PATH//:\/usr\/local\/$MPI\/bin}
   fi
   PATH=$PATH:/usr/local/$mpi/bin
   MPI=$mpi
   export MPI PATH
fi
unset mpi
----
It should be launched as
. defmpi
to use the default implementation or
. defmpi lam-xx.xx
to use another one.
This adds or replaces the desired mpi directory in the PATH variable. 
The big limitation of this approach is that, in a networked environment, 
it should not be started by hand but you have to put the . defmpi 
command in the .bashrc of each user in order for the script to work 
through rsh/ssh when you lamboot; this means that, unless you change by 
hand the .bashrc, every user is by default limited to use a single lam 
version. I used it to switch between lam and mpich (and of course lam is 
the default :-)), but it may work also for different lam versions; if 
you use dynamic libraries you may have to add a line to change 
LD_LIBRARY_PATH along with PATH.
	Hope this helps, ciao, Davide
-- 
__________________________________________________________
Davide Cesari	ARPA-Servizio Idro Meteorologico      __
  tel       (39) 051/525926                            ||\
  fax       (39) 051/6497501                           |||\
  e-mail    dcesari_at_[hidden]                        |||/
  www       http://www.arpa.emr.it/sim                 ---
  Address:  ARPA-SIM, Viale Silvani 6, 40122 Bologna, Italy
__________________________________________________________