Community
cancel
Showing results for 
Search instead for 
Did you mean: 
Wukie__Nathan
Beginner
53 Views

MPI_ISend bug on Fortran allocatable character

I am encountering what I believe to be a bug associated with allocatable character arrays and MPI_ISend. Sending allocatable character array with MPI_ISend and receiving with MPI_Recv returns junk. See test program below, compiled with -assume realloc_lhs. Same code with GNU compiler and OpenMPI receives and prints the expected result. Are there any other compiler flags that I should be working with that would influence compiler behavior here? Statically declaring the send string produces the expected result. This is commented out in the example below.

Intel Fortran Linux 17.0.1 20161005
Intel MPI Linux 5.1.3

program main
    use mpi_f08
    implicit none

    integer                      :: ierr
    !character(11)               :: send_char
    character(:),   allocatable  :: send_char
    character(11)                :: recv_char
    type(mpi_request)            :: handle

    call MPI_Init(ierr)

    send_char = 'test string'

    call MPI_ISend(send_char,11,MPI_CHARACTER,0,0,MPI_COMM_WORLD,handle,ierr)
    call MPI_Recv(recv_char, 11,MPI_CHARACTER,0,0,MPI_COMM_WORLD,MPI_STATUS_IGNORE,ierr)
    call MPI_Wait(handle,MPI_STATUS_IGNORE,ierr)

    print*, recv_char

end program main
0 Kudos
1 Reply
James_T_Intel
Moderator
53 Views

Thank you for this information.  I've escalated it to our engineering team.  As a workaround, you can make the following changes:

!use mpi_f08
use mpi

and

!type(mpi_request) :: handle
integer :: handle

These changes will allow the program to run as expected.

James.

Reply