Skip to content

Commit

Permalink
Rely on CONTIGUOUS keyword in MPI wrapper (#375)
Browse files Browse the repository at this point in the history
* Since CP2K moved to F2008, the CONTIGUOUS keyword can be used. The MPI standard requires contiguous buffers hence CP2K's MPI-wrapper can safely apply this attribute.
* This fixes occurrences of "created temporary array" (unveiled with related GNU Fortran flags).
* Fixed typos (code comments).
  • Loading branch information
hfp committed May 23, 2019
1 parent 2525487 commit a0eab37
Showing 1 changed file with 12 additions and 12 deletions.
24 changes: 12 additions & 12 deletions src/mpiwrap/message_passing.f90
Original file line number Diff line number Diff line change
Expand Up @@ -584,7 +584,7 @@ END SUBROUTINE mp_alltoall_${nametype1}$54

! *****************************************************************************
!> \brief Send one datum to another process
!> \param[in] msg Dum to send
!> \param[in] msg Scalar to send
!> \param[in] dest Destination process
!> \param[in] tag Transfer identifier
!> \param[in] gid Message passing environment identifier
Expand Down Expand Up @@ -658,7 +658,7 @@ END SUBROUTINE mp_send_${nametype1}$v
! *****************************************************************************
!> \brief Receive one datum from another process
!> \param[in,out] msg Place received data into this variable
!> \param[in,out] source Process to receieve from
!> \param[in,out] source Process to receive from
!> \param[in,out] tag Transfer identifier
!> \param[in] gid Message passing environment identifier
!> \par MPI mapping
Expand Down Expand Up @@ -702,7 +702,7 @@ END SUBROUTINE mp_recv_${nametype1}$

! *****************************************************************************
!> \brief Receive rank-1 data from another process
!> \param[in,out] msg Place receieved data into this rank-1 array
!> \param[in,out] msg Place received data into this rank-1 array
!> \param source ...
!> \param tag ...
!> \param gid ...
Expand Down Expand Up @@ -1115,7 +1115,7 @@ END SUBROUTINE mp_sum_${nametype1}$m
!> \note see mp_sum_${nametype1}$
! *****************************************************************************
SUBROUTINE mp_sum_${nametype1}$m3(msg,gid)
${type1}$, INTENT(INOUT) :: msg( :, :, : )
${type1}$, INTENT(INOUT), CONTIGUOUS :: msg( :, :, : )
INTEGER, INTENT(IN) :: gid

CHARACTER(len=*), PARAMETER :: routineN = 'mp_sum_${nametype1}$m3', &
Expand Down Expand Up @@ -1275,9 +1275,9 @@ END SUBROUTINE mp_sum_root_${nametype1}$m
!> \param[in] gid Message passing environment identifier
! *****************************************************************************
SUBROUTINE mp_sum_partial_${nametype1}$m(msg,res,gid)
${type1}$, INTENT(IN) :: msg( :, : )
${type1}$, INTENT(OUT) :: res( :, : )
INTEGER, INTENT(IN) :: gid
${type1}$, CONTIGUOUS, INTENT(IN) :: msg( :, : )
${type1}$, CONTIGUOUS, INTENT(OUT) :: res( :, : )
INTEGER, INTENT(IN) :: gid

CHARACTER(len=*), PARAMETER :: routineN = 'mp_sum_partial_${nametype1}$m' &
, routineP = moduleN//':'//routineN
Expand Down Expand Up @@ -1413,7 +1413,7 @@ END SUBROUTINE mp_min_${nametype1}$
!> \note see mp_min_${nametype1}$
! *****************************************************************************
SUBROUTINE mp_min_${nametype1}$v(msg,gid)
${type1}$, INTENT(INOUT) :: msg( : )
${type1}$, INTENT(INOUT), CONTIGUOUS :: msg( : )
INTEGER, INTENT(IN) :: gid

CHARACTER(len=*), PARAMETER :: routineN = 'mp_min_${nametype1}$v', &
Expand All @@ -1439,7 +1439,7 @@ END SUBROUTINE mp_min_${nametype1}$v
!> \brief Multiplies a set of numbers scattered across a number of processes,
!> then replicates the result.
!> \param[in,out] msg a number to multiply (input) and result (output)
!> \param[in] gid mssage passing environment identifier
!> \param[in] gid message passing environment identifier
!> \par MPI mapping
!> mpi_allreduce
! *****************************************************************************
Expand Down Expand Up @@ -2826,7 +2826,7 @@ SUBROUTINE mp_sendrecv_${nametype1}$m4(msgin,dest,msgout,source,comm)
END SUBROUTINE mp_sendrecv_${nametype1}$m4

! *****************************************************************************
!> \brief Non-blocking send and receieve of a scalar
!> \brief Non-blocking send and receive of a scalar
!> \param[in] msgin Scalar data to send
!> \param[in] dest Which process to send to
!> \param[out] msgout Receive data into this pointer
Expand Down Expand Up @@ -2886,7 +2886,7 @@ SUBROUTINE mp_isendrecv_${nametype1}$(msgin,dest,msgout,source,comm,send_request
END SUBROUTINE mp_isendrecv_${nametype1}$

! *****************************************************************************
!> \brief Non-blocking send and receieve of a vector
!> \brief Non-blocking send and receive of a vector
!> \param[in] msgin Vector data to send
!> \param[in] dest Which process to send to
!> \param[out] msgout Receive data into this pointer
Expand Down Expand Up @@ -3714,7 +3714,7 @@ END SUBROUTINE mp_deallocate_${nametype1}$
!> (serial) Unformatted stream write
!> \param[in] fh file handle (file storage unit)
!> \param[in] offset file offset (position)
!> \param[in] msg data to be writen to the file
!> \param[in] msg data to be written to the file
!> \param msglen ...
!> \par MPI-I/O mapping mpi_file_write_at
!> \par STREAM-I/O mapping WRITE
Expand Down

0 comments on commit a0eab37

Please sign in to comment.