ML with OpenMPI

Lisandro Dalcin dalcinl at gmail.com
Fri Mar 21 17:31:03 CDT 2008


Mmm... I believe this is a configuration issue... if ML_MPI were
defined, then ML_USR_COMM should be MPI_Comm. But the problem is
perhaps on the ML side, not the PETSc side.

"ml_common.h" #define ML_MPI if macro HAVE_MPI is defined. In turn
HAVE_MPI is at "ml_config.h", and that file is surelly generated by ML
configure script. For some reason ML's configure failed to found MPI
with the command line stuff PETSc pass to it.  Look at the
'config.log' file inside the "ml-5.0" dir to find what happened.



On 3/21/08, Jed Brown <jed at 59a2.org> wrote:
> The MPI standard does not specify that MPI_Comm = int and in fact
>  OpenMPI uses a pointer value which lets the compiler do slightly more
>  type checking.  This type checking recently caused me trouble when
>  building with-download-ml.
>
>  There is a line in ml_comm.h which defines their communicator to be an
>  int when ML_MPI is not defined.  It was not immediately clear why this
>  is not defined, but result is that the compiler chokes when building
>  PETSc.  This patch fixes the problem as long as sizeof(int) =
>  sizeof(MPI_Comm), but this is *not* the case on x86_64 with OpenMPI.
>  It's not clear to me how much of this is an upstream issue and how much
>  is a configuration issue.
>
>  Jed
>
>
>  diff -r c074838b79ed src/ksp/pc/impls/ml/ml.c
>  --- a/src/ksp/pc/impls/ml/ml.c  Thu Mar 20 17:04:05 2008 -0500
>  +++ b/src/ksp/pc/impls/ml/ml.c  Fri Mar 21 22:50:32 2008 +0100
>  @@ -815,7 +815,7 @@ PetscErrorCode MatWrapML_SHELL(ML_Operat
>
>    MLcomm = mlmat->comm;
>    ierr = PetscNew(Mat_MLShell,&shellctx);CHKERRQ(ierr);
>  -  ierr =
>  MatCreateShell(MLcomm->USR_comm,m,n,PETSC_DETERMINE,PETSC_DETERMINE,shellctx,newmat);CHKERRQ(ierr);
>  +  ierr =
>  MatCreateShell((MPI_Comm)MLcomm->USR_comm,m,n,PETSC_DETERMINE,PETSC_DETERMINE,shellctx,newmat);CHKERRQ(ierr);
>    ierr =
>    MatShellSetOperation(*newmat,MATOP_MULT,(void(*)(void))MatMult_ML);CHKERRQ(ierr);
>    ierr =
>    MatShellSetOperation(*newmat,MATOP_MULT_ADD,(void(*)(void))MatMultAdd_ML);CHKERRQ(ierr);
>    shellctx->A         = *newmat;
>  @@ -844,7 +844,7 @@ PetscErrorCode MatWrapML_MPIAIJ(ML_Opera
>    n = mlmat->invec_leng;
>    if (m != n) SETERRQ2(PETSC_ERR_ARG_OUTOFRANGE,"m %d must equal to n
>    %d",m,n);
>
>  -  ierr = MatCreate(mlmat->comm->USR_comm,&A);CHKERRQ(ierr);
>  +  ierr = MatCreate((MPI_Comm)mlmat->comm->USR_comm,&A);CHKERRQ(ierr);
>    ierr = MatSetSizes(A,m,n,PETSC_DECIDE,PETSC_DECIDE);CHKERRQ(ierr);
>    ierr = MatSetType(A,MATMPIAIJ);CHKERRQ(ierr);
>    ierr = PetscMalloc3(m,PetscInt,&nnzA,m,PetscInt,&nnzB,m,PetscInt,&nnz);CHKERRQ(ierr);
>
>


-- 
Lisandro Dalcín
---------------
Centro Internacional de Métodos Computacionales en Ingeniería (CIMEC)
Instituto de Desarrollo Tecnológico para la Industria Química (INTEC)
Consejo Nacional de Investigaciones Científicas y Técnicas (CONICET)
PTLC - Güemes 3450, (3000) Santa Fe, Argentina
Tel/Fax: +54-(0)342-451.1594




More information about the petsc-dev mailing list