On Sat, 14 Apr 2007, Ruhollah Moussavi Baygi wrote:
.
.
.
> 1- By default, wrapper compiler mpif77 refers to g77 compiler. But, I want
> to use gfortran instead of g77 in parallel mode, .i.e. I want that mpif77
> uses gfortran while compiling a FORTRAN program. Please help me.
>
In the Linux world with the bash shell, you can temporarily change
compilers with the following unset and export commands:
unset LAMHF77
export LAMHF77=gfortran (or path to other compiler)
You should be able to add the last line to your .profile file and make
this change effectively permanent.
If your gfortran compile complains about not finding the correct
libraries, you may have to unset the library path name as well:
unset LD_RUN_PATH
gfortran is a little tricky as its libraries don't reside in a single
directory, as with most other compilers. Normally, one would export a
new library path as well:
export LD_RUN_PAT=(path to fortran libraries)
You may also need to add the following to your compiler flags:
mpif77 program_name.f90 -o program_name_executable -I/usr/include
The c shell has similary comands, which I have forgotten at the
moment. BTW, I recommend g95 over gfortran; I find gfortran to be a
little buggy.
>
>
> 2- To compile and run parallel programs is it necessary to install LAM/MPI
> as well as C/F compilers in head node and ALL compute nodes? (NFS running on
> head with /home directory)
>
>
To form a LAM cluster, with a lamboot command, it is necessary to have
the same version of LAM installed on all nodes. For most compilers,
is not necessary to have the compiler installed on all nodes, but you
must tell the executable, at run time, where to find the fortran
libraries (or at least the shared objects):
mpirun -np (number of processes) -x LD_LIBRARY_PATH=(path to fortran
libraries) program_name_executable
With gfortran, this may not be feasible, and you may well have
gfortran installed on every node.
These are the gleanings from my experience; they are probably imperfect.
--
Rich Naff
U.S. Geological Survey
MS 413 Box 25046
Denver, CO 80225 USA
telephone: (303) 236-4986
Email: rlnaff_at_[hidden]
|