On Wed, 24 Sep 2003, Reuben D. Budiardja wrote:
> We needed to recompile the mpich to work with intel fortran compiler. I
> want to change the path to the mpi executable to our own mpi
> installation rather than the one that came with OSCAR globally. But I
> can't where oscar set the PATH environment variable, so that I can
> change it. It's not in the /etc/profile, nor /etc/bashrc. Could someone
> help? Thanks.
You have a variety of choices, but I'll tell you my highest preference:
write a short module.
A "module" is a short TCL script (don't let "TCL" scare you -- it's very
short and the syntax is trivial) that will automatically be loaded upon
all shell invocations (interactive and non-interactive -- although I doubt
that matters much for a compiler :-). Two major bonuses that you get
with modules:
1. They work with all shell flavors (sh and csh); so you only write
one module, but it works in both.
2. They are reversible. So you can "load" and "unload" modules, and
it sets/resets your $path (etc.) as appropriate.
OSCAR supports two kinds of modules: switched and non-switched. The
difference is user choice: users can easily "turn off" switched modules
(i.e., prevent them from ever being loaded in the first place).
Non-switched modules are always loaded for all users.
Since this is probably your first foray into modules, you can probably
just do a simple, non-switched module. Here's what you can do (I'm
assuming that your Intel compiler is version 7.1? Replace "7.1" below
with whatever version it is):
-----
# cd /opt/modules/oscar-modulefiles
# mkdir icc
# cd icc
# cp ../hdf/1* 7.1
-----
Now edit that 7.1 file in whatever your favorite text editor is. You'll
see it's a very simple format:
-----
#%Module -*- tcl -*-
#
# HDF5 modulefile for OSCAR clusters
#
proc ModulesHelp { } {
puts stderr "\tThis module adds HDF5 to the PATH."
}
module-whatis "Sets up the HDF5 environment for an OSCAR cluster."
append-path PATH /opt/hdf5-oscar-1.4.4-post2/bin/
-----
Just do a search/replace for "HDF5" with "Intel compiler", and then set
the last statement to have the right path for your intel compiler.
If you need any additional environment variables, you can set them with
the "setenv" command (just like you would expect). I'm guessing that your
resulting file will look something like this:
-----
#%Module -*- tcl -*-
#
# Intel compiler modulefile for OSCAR clusters
#
proc ModulesHelp { } {
puts stderr "\tThis module adds the Intel compiler to the PATH."
}
module-whatis "Sets up the Intel compiler environment for an OSCAR cluster."
append-path PATH /path/to/your/icc/installation/bin
setenv SOME_ENV_VAR "the env var value"
-----
When you put that file there, all new shells will automatically load
that module. You'll see that /path/to/your/icc/installation/bin is at
the end of the $path, and that $SOME_ENV_VAR is set. (you can
prepend-path instead of append-path, if you want).
You can also "module load icc/7.1" manually, and/or "module unload
icc/7.1". See the module(1) man page for more details on the "module"
command.
Many, many more things are possible with modulefiles, including having
multiple versions of icc installed and switching seamlessly between
them. See the modulefile(4) man page for more details. Modules are
your friends. :-)
Finally, if you want to evolve into the world of switched modules, see
the switcher(1) man page. switched modules is how OSCAR clusters
allow there to be a system default MPI implementation but let users
override with their own choice (if they want to).
--
{+} Jeff Squyres
{+} [EMAIL PROTECTED]
{+} http://www.lam-mpi.org/
-------------------------------------------------------
This sf.net email is sponsored by:ThinkGeek
Welcome to geek heaven.
http://thinkgeek.com/sf
_______________________________________________
Oscar-users mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/oscar-users