TABLE OF CONTENTS


ABINIT/xmpi_isend [ Functions ]

[ Top ] [ Functions ]

NAME

  xmpi_isend

FUNCTION

  This module contains functions that calls MPI routine MPI_ISEND,
  to send data from one processor to another,
  if we compile the code using the MPI CPP flags.
  xmpi_isend is the generic function.

COPYRIGHT

  Copyright (C) 2001-2022 ABINIT group
  This file is distributed under the terms of the
  GNU General Public License, see ~ABINIT/COPYING
  or http://www.gnu.org/copyleft/gpl.txt .

TODO

SOURCE


ABINIT/xmpi_isend_dp1d [ Functions ]

[ Top ] [ Functions ]

NAME

  xmpi_isend_dp1d

FUNCTION

  Sends data from one proc to another.
  Target: double precision two-dimensional arrays.

INPUTS

  dest :: rank of destination process
  tag :: integer message tag
  comm :: MPI communicator

OUTPUT

  ierr= exit status, a non-zero value meaning there is an error

SIDE EFFECTS

  xval= buffer array

SOURCE

 94 subroutine xmpi_isend_dp1d(xval,dest,tag,comm,request,ierr)
 95 
 96 !Arguments-------------------------
 97  real(dp) ABI_ASYNC, intent(inout) :: xval(:)
 98  integer, intent(in) :: dest,tag,comm
 99  integer, intent(out)   :: ierr
100  integer, intent(out) :: request
101 
102 !Local variables-------------------
103 #if defined HAVE_MPI
104  integer :: ier,my_tag,n1
105 #endif
106 
107 ! *************************************************************************
108 
109  ierr=0
110 #if defined HAVE_MPI
111  if (comm /= MPI_COMM_SELF .and. comm /= MPI_COMM_NULL) then
112    n1=size(xval)
113    my_tag = MOD(tag,xmpi_tag_ub)
114    call MPI_ISEND(xval,n1,MPI_DOUBLE_PRECISION,dest,my_tag,comm,request,ier)
115    xmpi_count_requests = xmpi_count_requests + 1
116    ierr=ier
117  end if
118 #endif
119 
120 end subroutine xmpi_isend_dp1d

ABINIT/xmpi_isend_dp2d [ Functions ]

[ Top ] [ Functions ]

NAME

  xmpi_isend_dp2d

FUNCTION

  Sends data from one proc to another.
  Target: double precision two-dimensional arrays.

INPUTS

  dest :: rank of destination process
  tag :: integer message tag
  comm :: MPI communicator

OUTPUT

  ierr= exit status, a non-zero value meaning there is an error

SIDE EFFECTS

  xval= buffer array

SOURCE

144 subroutine xmpi_isend_dp2d(xval,dest,tag,comm,request,ierr)
145 
146 !Arguments-------------------------
147  real(dp) ABI_ASYNC, intent(inout) :: xval(:,:)
148  integer, intent(in) :: dest,tag,comm
149  integer, intent(out)   :: ierr
150  integer, intent(out) :: request
151 
152 !Local variables-------------------
153 #if defined HAVE_MPI
154  integer :: ier,my_dt,my_op,my_tag,n1,n2
155  integer(kind=int64) :: ntot
156 #endif
157 
158 ! *************************************************************************
159 
160  ierr=0
161 #if defined HAVE_MPI
162  if (comm /= MPI_COMM_SELF .and. comm /= MPI_COMM_NULL) then
163    n1=size(xval,dim=1)
164    n2=size(xval,dim=2)
165    my_tag = MOD(tag,xmpi_tag_ub)
166 
167    !This product of dimensions can be greater than a 32bit integer
168    !We use a INT64 to store it. If it is too large, we switch to an
169    !alternate routine because MPI<4 doesnt handle 64 bit counts.
170    ntot=int(n1*n2,kind=int64)
171 
172    if (ntot<=xmpi_maxint32_64) then
173      call MPI_ISEND(xval,n1*n2,MPI_DOUBLE_PRECISION,dest,my_tag,comm,request,ier)
174    else
175      call xmpi_largetype_create(ntot,MPI_DOUBLE_PRECISION,my_dt,my_op,MPI_OP_NULL)
176      call MPI_ISEND(xval,1,my_dt,dest,my_tag,comm,request,ier)
177      call xmpi_largetype_free(my_dt,my_op)
178    end if
179 
180    xmpi_count_requests = xmpi_count_requests + 1
181    ierr=ier
182  end if
183 #endif
184 
185 end subroutine xmpi_isend_dp2d

ABINIT/xmpi_isend_int1d [ Functions ]

[ Top ] [ Functions ]

NAME

  xmpi_isend_int1d

FUNCTION

  Sends data from one processor to another.
  Target: integer one-dimensional arrays.

INPUTS

  dest :: rank of destination process
  tag :: integer message tag
  comm :: MPI communicator

OUTPUT

  ierr= exit status, a non-zero value meaning there is an error

SIDE EFFECTS

  xval= buffer array

SOURCE

44 subroutine xmpi_isend_int1d(xval,dest,tag,comm,request,ierr)
45 
46 !Arguments-------------------------
47  integer ABI_ASYNC, intent(inout) :: xval(:)
48  integer, intent(in) :: dest,tag,comm
49  integer, intent(out)   :: ierr
50  integer, intent(out) :: request
51 
52 !Local variables-------------------
53 #if defined HAVE_MPI
54  integer :: ier,my_tag,n1
55 #endif
56 
57 ! *************************************************************************
58 
59  ierr=0
60 #if defined HAVE_MPI
61  if (comm /= MPI_COMM_SELF .and. comm /= MPI_COMM_NULL) then
62    n1=size(xval,dim=1)
63    my_tag = MOD(tag,xmpi_tag_ub)
64    call MPI_ISEND(xval,n1,MPI_INTEGER,dest,my_tag,comm,request,ier)
65    xmpi_count_requests = xmpi_count_requests + 1
66    ierr=ier
67  end if
68 #endif
69 
70  end subroutine xmpi_isend_int1d