[petsc-users] error with MPI + ifort

Adrián Amor aamor at pa.uc3m.es
Wed Mar 7 09:34:21 CST 2018


Hi Praveen,

did you try to include the PETSC_AVOID_MPIF_H? I mean, include:
-DPETSC_AVOID_MPIF_H=1 when using mpiifort and I think that the problem
will be solved.

2018-03-07 15:53 GMT+01:00 Praveen C <cpraveen at gmail.com>:

> Dear all
>
> In a code like this
>
> subroutine checkgrid(g)
>
> #include <petsc/finclude/petscsys.h>
>
>    use petscsys
>
>    use mgrid
>
>    use celldata
>
>    use comdata
>
>    implicit none
>
>    type(grid),intent(in) :: g
>
>    ! Local variables
>
>    integer        :: i, j, v, tc, nv
>
>    PetscInt       :: v1, v2
>
>    PetscErrorCode :: ierr
>
>
>    ! Sum g%nvl over all partitions.
>
>    Call MPI_Allreduce(g%nvl, nv, 1, MPI_INT, MPI_SUM, &
>
>                       PETSC_COMM_WORLD, ierr); CHKERRQ(ierr)
>
> end subroutine checkgrid
>
>
> we get an error while compiling with mpich-3.2.1 + ifort + petsc-3.8.x
>
> mpifort -c -O3 -fpp -nogen-interface -W1 -WB -DNS -DVERSION=\"f8e6c025\"
> -I/usr/local/share/applications/Intel_Compiler/petsc/include
> -I/usr/local/share/applications/Intel_Compiler/hdf5/include -DHDF5 -Tf
> checkgrid.F90 -o checkgrid.o -free
> checkgrid.F90(40): error #6405: The same named entity from different
> modules and/or program units cannot be referenced.   [MPI_SUM]
>    Call MPI_Allreduce(g%nvl, nv, 1, MPI_INT, MPI_SUM, &
>                       ---------------------------------------------^
> compilation aborted for checkgrid.F90 (code 1)
>
> It works fine with clang and gnu compilers.
>
> Thanks
> praveen
>
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.mcs.anl.gov/pipermail/petsc-users/attachments/20180307/1fee310c/attachment.html>


More information about the petsc-users mailing list