LAM/MPI logo

LAM/MPI General User's Mailing List Archives

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

From: Brian W. Barrett (brbarret_at_[hidden])
Date: 2003-05-22 15:42:01


On Thu, 22 May 2003, Jones, Donald E wrote:

> Is LAM thread safe? We are using the BLAS routines dgemm/zgemm from the
> Intel Math Kernel Library on a Linux 7.2 system. Intel threads these
> routines using OpenMP. Is LAM compatible with OpenMP?

LAM is thread safe, to some degree. It is ok if threads are running, but
there are restrictions on who can call MPI functions - basically, in LAM
6.5.x, only the thread that called MPI_INIT can call other MPI functions.
However, this shouldn't cause any problems for the type of threading you
are talking about - OpenMP isn't going to be making MPI calls and your
application sounds like it is still single threaded. And as far as we are
aware, LAM works fine with OpenMP.

If your application isn't single threaded, you might want to look at the
threading section of the MPI-2 spec. LAM 6.5.x reports support for
MPI_THREAD_SINGLE, but will work without problems if you follow the
restrictions of MPI_THREAD_FUNNELED (for various reasons, we don't
advertise support for it in MPI_THREAD_INIT). LAM 7.0 (coming soon) will
support THREAD_SINGLE through THREAD_SERIALIZED.

> We are using Portland Group compilers and have found that we need to
> include the -mp flag to get threading of the routines. This flag informs
> the compiler to interpret OpenMP statements. It also sets a reentrant
> flag, where local variables are placed on the stack and optimizations
> that may result in non-reentrant code are disabled.

You may have to compile LAM with the -mp flag in order to properly enable
threading support. LAM will not detect the need for this flag
automatically, so you would have to set the flags for the C, C++, and
Fortran compilers when compiling LAM.

Hope this helps,

Brian

-- 
  Brian Barrett
  LAM/MPI developer and all around nice guy
  Have a LAM/MPI day: http://www.lam-mpi.org/