[petsc-users] MPI_Scan under Fortran

Satish Balay balay at mcs.anl.gov
Wed Aug 24 15:20:43 CDT 2011


On Wed, 24 Aug 2011, Jed Brown wrote:

> On Wed, Aug 24, 2011 at 09:33, Wienand Drenth <w.drenth at gmail.com> wrote:
> 
> > The program compiles without troubles, but running it gives me an error. It
> > is, I think, related to the MPI_SUM operation:
> > [walrus:463] *** An error occurred in MPI_Scan: the reduction operation
> > MPI_SUM is not defined on the MPI_BYTE datatype
> > [walrus:463] *** on communicator MPI_COMM_WORLD
> > [walrus:463] *** MPI_ERR_OP: invalid reduce operation
> > [walrus:463] *** MPI_ERRORS_ARE_FATAL (your MPI job will now abort)
> >
> > In addition, I needed to declare MPIU_INT explicitly as integer; this was
> > not required for the C program.
> >
> 
> I believe MPIU_INT (which is normally made to match PetscInt) is not defined
> in Fortran. You can use MPI_INTEGER4 or MPI_INTEGER8 as needed.
> 
> Perhaps PETSc should define MPIU_INT, MPIU_SCALAR, etc in Fortran too?

MPI does MPI_INT (c) vs MPI_INTEGER (fortran) - so we have
MPIU_INTEGER on the fortran side. [in finclude/petscsys.h]

And we do have MPIU_SCALAR on the fortran side.

Satish

> 



More information about the petsc-users mailing list