LAM/MPI logo

LAM/MPI General User's Mailing List Archives

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

From: Jeff Squyres (jsquyres_at_[hidden])
Date: 2004-02-02 07:08:03


On Thu, 29 Jan 2004, etienne gondet wrote:

> I compile with pgi and link with lam a small fortran program with
> a basic local array in a subroutine bosse. When I use the pgi flag -mp
> the subroutine bosse either failed or never finish.

What does the "-mp" flag do?

> Is it any stack limitations with lam .

I'm not sure what you mean -- LAM should not be corrupting your stack in
any way. However, many compilers and/or OS's have inherent limits as to
how much data you can have on the stack before they will fail. An easy
way to test this is to try to run a comprable serial program (i.e.,
without MPI_INIT/MPI_FINALIZE) and try to have the same sized array on the
stack as your parallel program. If it seg faults upon execution, it's
possible that your array is too large to be on the stack.

> What I don't understand: it's why if I used an automatic array
> (local array but with dimension through argument) in subroutine bosse
> there isn' any problems.

I'm not much of a fortran programmer, but if I had to guess, I'd stay that
the compiler makes the array get allocated on the heap instead of the
stack.

> Note the problems is solved if not using -mp but it should be a
> severe limitation for hybrid parallel algorithm with both mpi and OpenMP
> using lam.

If -mp changes the compile-time or run-time characteristics of your
application, you might need to compile LAM with that flag as well.
However, if this is the flag that enables OpenMP, then I'm not sure what
the Right course of action is here (I've never played with mixing MPI and
OpenMP). LAM won't have any OpenMP compile-time directives, of course, so
theoretically there shouldn't be any harm in compiling LAM with -mp. But
this should only be necessary if there is bootstrapping that the compiler
adds that all compilation units need in order for OpenMP to work.

-- 
{+} Jeff Squyres
{+} jsquyres_at_[hidden]
{+} http://www.lam-mpi.org/