ML with OpenMPI

Satish Balay balay at mcs.anl.gov
Tue Mar 25 11:45:30 CDT 2008


I think our usage of ML is broken.  We use "#include "ml_config.h"" in
ml.c. However looks like ml requires HAVE_CONFIG_H defined for other
things aswell.

So the correct fix is to change the above line to:

#define HAVE_CONFIG_H

Satish


On Tue, 25 Mar 2008, Lisandro Dalcin wrote:

> OK. Now all is clear to me. Sorry about my confusion.  So I have to
> conclude that ML machinery for including headers is a bit broken, I
> think. Many thanks for your explanation.
> 
> 
> On 3/25/08, Jed Brown <jed at 59a2.org> wrote:
> > No, ML was built correctly.  The build output has -DHAVE_CONFIG_H on every build
> >  line.  What *is* happening is that the headers included by ksp/pc/impls/ml/ml.c
> >  were essentially for a non-MPI build because HAVE_CONFIG_H was not defined.
> >  That is, including ml_config.h defines the autoconf'd macros (like HAVE_MPI) and
> >  ml_common.h uses them to set ML-local macros (like ML_MPI) *only* if
> >  HAVE_CONFIG_H is defined.  So when we include ml_include.h without defining
> >  HAVE_CONFIG_H, we see the interface for a default (non-MPI) build.  This
> >  interface is (apparently) the same as an MPI build with MPICH2, but not with
> >  OpenMPI.  Since the library was built with MPI, there was no dangerous type
> >  casting, and you were using it with MPI, there was no problem.  When using
> >  OpenMPI, it sees a conflict between the ML's dummy MPI interface and OpenMPI's
> >  because ML and MPICH2 use MPI_Comm = int while OpenMPI uses an opaque pointer
> >  value.
> >
> >
> >  > Looking at ML configure script and generated makefiles, in them there
> >  > is a line saying>
> >  >
> >  > DEFS = -DHAVE_CONFIG_H
> >  >
> >  > Do you have that line? Next, this $(DEFS) is included in compiler
> >  > command definition.
> >  >
> >  > Additionally, I did
> >  >
> >  > $ nm -C libml.a | grep MPI
> >  >
> >  > and undefined references to the MPI functions appered as expected.
> >  >
> >  >
> >  > Sorry about my insinstence, but I believe we need to figure out what's
> >  > exactly going on.
> >
> >
> > No problem.  I agree it is important.  Does my explanation above make sense to
> >  you?
> >
> >
> >  Jed
> >
> >
> 
> 
> 




More information about the petsc-dev mailing list