locked
Problem with MPI_ALLGATHERV RRS feed

  • Question

  • I am trying to run the attached test case with MS-MPI. I tested it with OpenMPI and it worked as I expected. With MS-MPI, it fails; that is, the information to be gathered is not.
    PROGRAM MPI_TEST
    
    IMPLICIT NONE
    
    INCLUDE 'mpif.h'
    
    INTEGER, ALLOCATABLE, DIMENSION(:) :: COUNTS,DISPLS
    CHARACTER(30) :: PNAME
    INTEGER :: IERR,MYID,NUMPROCS,PNAMELEN,NM,N,LU_ERR=0
    REAL(8), ALLOCATABLE, DIMENSION(:) :: DT
    
    CALL MPI_INIT(IERR)
    CALL MPI_COMM_RANK(MPI_COMM_WORLD, MYID, IERR)
    CALL MPI_COMM_SIZE(MPI_COMM_WORLD, NUMPROCS, IERR)
    CALL MPI_GET_PROCESSOR_NAME(PNAME, PNAMELEN, IERR)
    
    IF (PNAME/='null') THEN
       WRITE(LU_ERR,'(A,I3,A,I3,A,A)') 'Process ',MYID,' of ',NUMPROCS-1,' is running on ',PNAME(1:PNAMELEN)
    ENDIF
    
    CALL MPI_BARRIER(MPI_COMM_WORLD,IERR)
    
    ALLOCATE(COUNTS(0:NUMPROCS-1))
    ALLOCATE(DISPLS(0:NUMPROCS-1))
    ALLOCATE(DT(NUMPROCS))
    
    COUNTS = 1
    
    DISPLS(0) = 0
    DO N=1,NUMPROCS-1
       DISPLS(N) = COUNTS(N-1) + DISPLS(N-1)
    ENDDO
    
    DT = 0.
    DT(MYID+1) = (MYID+1)*10.
    
    WRITE(LU_ERR,'(A,I1.1,A,10F5.1)') 'DT on Process ',MYID,' before call: ',DT
    
    CALL MPI_ALLGATHERV(MPI_IN_PLACE,COUNTS(MYID),MPI_DOUBLE_PRECISION,DT,COUNTS,DISPLS,MPI_DOUBLE_PRECISION,MPI_COMM_WORLD,IERR)
    
    WRITE(LU_ERR,'(A,I1.1,A,10F5.1)') 'DT on Process ',MYID,' after call : ',DT
    
    CALL MPI_FINALIZE(IERR)
    
    END PROGRAM
    

    Thursday, April 3, 2014 2:20 PM

Answers

  • /Qlowercase solved the problem, which, by the way, is a deprecated option to be replaced by /names:lowercase. I am using the latest Intel Fortran compiler (14.0.0.103). I noticed that this option is the default on linux and OSX, which is why we haven't encountered this problem before. Are there any other compiling options needed for MS-MPI that are not needed by MPICH? I have never encountered this one before.

    Thanks for your help, problem solved.

    Thursday, April 3, 2014 7:19 PM

All replies

  • Hi Kevin,

    What Fortran compiler are you using?  We recently found out about an issue with our sentinel values (like MPI_IN_PLACE) when using PGI Fortran.  If you are using Intel Fortran, please specify /Qlowercase when compiling to properly resolve MPI_IN_PLACE.

    Let us know if this resolves your issue, or if you have any further questions.

    Thanks,
    -Fab

    Thursday, April 3, 2014 6:33 PM
  • /Qlowercase solved the problem, which, by the way, is a deprecated option to be replaced by /names:lowercase. I am using the latest Intel Fortran compiler (14.0.0.103). I noticed that this option is the default on linux and OSX, which is why we haven't encountered this problem before. Are there any other compiling options needed for MS-MPI that are not needed by MPICH? I have never encountered this one before.

    Thanks for your help, problem solved.

    Thursday, April 3, 2014 7:19 PM
  • Hi Kevin,

    The only other settings have to do with selecting the right library to link with, which depends on the calling convention as well as mixed/no mixed string lengths.  The first character after 'msmpif' in the library filename indicates the string length argument handling, with 'm' indicating /iface:mixed_str_len_arg and 'e' indicating /iface:nomixed_str_len_arg.

    For 32-bit applications, you also need to select the library that matches your calling convention, where you can pick between /iface:cref and /iface:stdref.  The calling convention is encoded into the library name as the last character, either 'c' for cref or 's' for stdref.

    As an example, 'msmpifec.lib' is for nomixed_str_len_arg and cref calling convention, while 'msmpifms.lib' is for mixed_str_len_arg and stdref. 

    Generally, we would recommend cref nomixed_str_len_arg lowercase, as there can be issues with both stdref and mixed_str_len_arg when using CHARACTER buffers.

    Hope that helps,
    -Fab

    Thursday, April 3, 2014 7:44 PM