Cannot compile mp.f90 with Intel

Issue #27 closed
Joseph Parker created an issue

On next, I get the error

mp.f90(2939): error #8284: If the actual argument is scalar, the dummy argument shall be
scalar unless the actual argument is of type character or is an element of an array that is 
not assumed shape, pointer, or polymorphic.   [STATUS]
    call mpi_wait(request,MPI_STATUS_IGNORE,ierror)
---------^

when compiling with Intel 17.0.2. STATUS is the second argument, so I'm confused that just giving it MPI_STATUS_IGNORE doesn't work.

Comments (9)

  1. Joseph Parker reporter
    ! ********************* non-blocking checks **********************
      subroutine wait_nostat (request)
        !AJ This routine waits for the communication, given by the
        !message request, to complete. We ignore the status
        !information
        implicit none
        integer, intent (inout) :: request
        !Note mpi_wait will set the request handle to MPI_NULL (or similar)
        !when message complete so have to set requests as inout
        integer :: ierror
        call mpi_wait(request,MPI_STATUS_IGNORE,ierror)
      end subroutine wait_nostat
    
  2. Joseph Parker reporter

    This is fixed by replacing MPI_STATUS_IGNORE with a status of the correct size which gets ignored, i.e., by replacing

        call mpi_wait(request,MPI_STATUS_IGNORE,ierror)
    

    with

        integer, dimension(MPI_STATUS_SIZE) :: status
        call mpi_wait(request,status,ierror)
    

    I suspect this is an intel bug. The error comes about from passing something which has the wrong size, so the "expected" fix would be

        call mpi_wait(request,MPI_STATUS_IGNORE(1:MPI_STATUS_SIZE),ierror)
    

    but that gives another error: mp.f90(2941): error #6514: Substring or array slice notation requires CHARACTER type or array. [MPI_STATUS_IGNORE]. It looks like MPI_STATUS_IGNORE is not being recognized as special.

  3. Joseph Parker reporter

    That gives a different error:

    mp.f90(2939): error #7983: The storage extent of the dummy argument exceeds that of the actual argument.   [MPI_STATUSES_IGNORE]
        call mpi_wait(request,MPI_STATUSES_IGNORE,ierror)
    
  4. David Dickinson

    From the mpi standard "Note that MPI_STATUS_IGNORE is not a special type of MPI_STATUS object; rather, it is a special value for the argument. In C one would expect it to be NULL, not the address of a special MPI_STATUS". Some interesting notes at https://www.mcs.anl.gov/research/projects/mpi/mpi-standard/mpi-report-2.0/node13.htm#Node13 as well.

    Just so it's explicitly noted -- your fix is to not ignore the status but to actually obtain it and then throw it away.

    Do you have other versions of intel you can try with? Is it sensitive to the optimisation level?

    Do you have a different mpi implementation you can test with?

  5. Joseph Parker reporter

    Thanks David. It's not sensitive to optimization level. In principle, I have access to other Intel versions... but I'm waiting on a couple of support calls...

  6. Joseph Parker reporter

    It turns out this was a problem with the module set up - Intel compilers using the wrong version of MPI. Fixed now, and the problem goes away. Thanks David for your comments.

  7. Log in to comment