Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

Intel MPI ALLGATHERV vs GATHERV

Kevin_McGrattan
394 Views

This might not be the right forum for this question, but I gave up trying to find the "Intel MPI" forum. I have a Fortran code that is compiled with Intel Fortran and MPI. I use this call a lot

CALL MPI_ALLGATHERV(MPI_IN_PLACE,0,MPI_DATATYPE_NULL,REAL_BUFFER,COUNTS,DISPLS,MPI_DOUBLE_PRECISION,MPI_COMM_WORLD,IERR)

Works fine. Then I do this

CALL MPI_GATHERV(MPI_IN_PLACE,0,MPI_DATATYPE_NULL,REAL_BUFFER,COUNTS,DISPLS,MPI_DOUBLE_PRECISION,0,MPI_COMM_WORLD,IERR)

and it hangs. However, if I do this

IF (RANK>0) THEN

   CALL MPI_GATHERV(MPI_IN_PLACE,...

   CALL MPI_BARRIER(MPI_COMM_WORLD,IERR)

ENDIF

It works. I fear that I do not completely understand the role of MPI_IN_PLACE. It seems like a bit of a hack to enclose the statement in this IF construct.

Labels (1)
0 Kudos
3 Replies
Kevin_McGrattan
388 Views

Correction to my original question. I have to do this to get GATHERV to work with MPI_IN_PLACE

IF (RANK>0) THEN

   CALL MPI_GATHERV(MPI_IN_PLACE,...

ENDIF

CALL MPI_BARRIER

Steve_Lionel
Black Belt Retired Employee
381 Views

The Intel MPI forum changes its name on a biweekly basis. I think today it's Intel® oneAPI HPC Toolkit - Intel Community

Kevin_McGrattan
343 Views

Thanks. I've done some more searching and from what I can tell, there was some discussion about the use of MPI_IN_PLACE by the MPI standards folks. For whatever reason, it was decided to that it was OK to do this at all processes

CALL MPI_ALLGATHERV(MPI_IN_PLACE,...)

but for GATHERV

IF (RANK==MPI_ROOT) THEN

   CALL MPI_GATHERV(MPI_IN_PLACE, ...)

ELSE

   CALL MPI_GATHERV(SEND_BUFFER, ...)

ENDIF

If anyone has any more insight on this, I'd be glad to hear it, but otherwise my issue is resolved.

Reply