Open MPI logo

Open MPI User's Mailing List Archives

  |   Home   |   Support   |   FAQ   |   all Open MPI User's mailing list

From: Jeff Dusenberry (jdusenberry_at_[hidden])
Date: 2007-07-23 15:18:53

I'm trying to use MPI_TYPE_MATCH_SIZE (Fortran interface) and no matter
what I give it, it always fails with MPI_ERR_ARG.

The last line of code in type_match_size_f.c seems to be the source of
the problem, as it always calls the error handler:


Putting this in the preceding if-else statement seems to work for me,
although I'm not sure if that is the appropriate fix, ie:

      if( c_type != &ompi_mpi_datatype_null )
          *ierr = OMPI_INT_2_FINT( MPI_SUCCESS );
      else {
          *ierr = OMPI_INT_2_FINT( MPI_ERR_ARG );

Test code is below - I linked against OpenMPI 1.2.3.

program test_type_match
   use mpi
   implicit none

   integer, parameter :: nval=5
   real, dimension(nval) :: testvals
   integer :: ierr, isize
   integer :: my_type

   call MPI_INIT(ierr)
   call MPI_SIZEOF(testvals,isize,ierr)
   call MPI_TYPE_MATCH_SIZE(MPI_TYPECLASS_REAL, isize, my_type, ierr)
   call MPI_FINALIZE(ierr)

end program test_type_match