TABLE OF CONTENTS


ABINIT/xmpi_recv [ Functions ]

[ Top ] [ Functions ]

NAME

  xmpi_recv

FUNCTION

  This module contains functions that call MPI routine MPI_RECV,
  to receive data on one processor sent by another,
  if we compile the code using the MPI CPP flags.
  xmpi_recv 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_recv_char [ Functions ]

[ Top ] [ Functions ]

NAME

  xmpi_recv_char

FUNCTION

  Receives data from one proc sent by another.
  Target: character.

INPUTS

  source :: rank of source process
  tag :: integer message tag
  comm :: MPI communicator

OUTPUT

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

SIDE EFFECTS

  xval= buffer array

NOTES

  status of MPI_RECV is explicitly ignored

SOURCE

47 subroutine xmpi_recv_char(xval,source,tag,comm,ier)
48 
49 !Arguments-------------------------
50  character(len=*), intent(inout) :: xval
51  integer ,intent(in) :: source,tag,comm
52  integer ,intent(out) :: ier
53 
54 !Local variables-------------------
55 #if defined HAVE_MPI
56  integer :: my_tag
57 #endif
58 
59 ! *************************************************************************
60 
61  ier=0
62 #if defined HAVE_MPI
63  if (comm /= MPI_COMM_SELF .and. comm /= MPI_COMM_NULL) then
64    my_tag = MOD(tag,xmpi_tag_ub)
65    call MPI_RECV(xval,len(xval),MPI_CHARACTER,source,my_tag,comm,MPI_STATUS_IGNORE,ier)
66  end if
67 #endif
68 
69 end subroutine xmpi_recv_char

ABINIT/xmpi_recv_dp [ Functions ]

[ Top ] [ Functions ]

NAME

  xmpi_recv_dp

FUNCTION

  Receives data from one proc sent by another.
  Target: double precision value.

INPUTS

  source :: rank of source process
  tag :: integer message tag
  comm :: MPI communicator

OUTPUT

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

SIDE EFFECTS

  xval= buffer array

NOTES

  status of MPI_RECV is explicitly ignored

SOURCE

350 subroutine xmpi_recv_dp(xval,source,tag,comm,ier)
351 
352 !Arguments-------------------------
353  real(dp), DEV_CONTARRD intent(inout) :: xval
354  integer ,intent(in) :: source,tag,comm
355  integer ,intent(out) :: ier
356 
357 !Local variables-------------------
358 #if defined HAVE_MPI
359  integer :: my_tag
360 #endif
361 
362 ! *************************************************************************
363 
364  ier=0
365 #if defined HAVE_MPI
366  if (comm /= MPI_COMM_SELF .and. comm /= MPI_COMM_NULL) then
367    my_tag = MOD(tag,xmpi_tag_ub)
368    call MPI_RECV(xval,1,MPI_DOUBLE_PRECISION,source,my_tag,comm,MPI_STATUS_IGNORE,ier)
369  end if
370 #endif
371 
372 end subroutine xmpi_recv_dp

ABINIT/xmpi_recv_dp1d [ Functions ]

[ Top ] [ Functions ]

NAME

  xmpi_recv_dp1d

FUNCTION

  Receives data from one proc sent by another.
  Target: double precision one-dimensional arrays.

INPUTS

  source :: rank of source process
  tag :: integer message tag
  comm :: MPI communicator

OUTPUT

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

SIDE EFFECTS

  xval= buffer array

NOTES

  status of MPI_RECV is explicitly ignored

SOURCE

399 subroutine xmpi_recv_dp1d(xval,source,tag,comm,ier)
400 
401 !Arguments-------------------------
402  real(dp), DEV_CONTARRD intent(inout) :: xval(:)
403  integer ,intent(in) :: source,tag,comm
404  integer ,intent(out) :: ier
405 
406 !Local variables-------------------
407 #if defined HAVE_MPI
408  integer :: n1,my_tag
409 #endif
410 
411 ! *************************************************************************
412 
413  ier=0
414 #if defined HAVE_MPI
415  if (comm /= MPI_COMM_SELF .and. comm /= MPI_COMM_NULL) then
416    n1=size(xval,dim=1)
417    my_tag = MOD(tag,xmpi_tag_ub)
418    call MPI_RECV(xval,n1,MPI_DOUBLE_PRECISION,source,my_tag,comm,MPI_STATUS_IGNORE,ier)
419  end if
420 #endif
421 
422 end subroutine xmpi_recv_dp1d

ABINIT/xmpi_recv_dp2d [ Functions ]

[ Top ] [ Functions ]

NAME

  xmpi_recv_dp2d

FUNCTION

  Receives data from one proc sent by another.
  Target: double precision two-dimensional arrays.

INPUTS

  source :: rank of source process
  tag :: integer message tag
  comm :: MPI communicator

OUTPUT

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

SIDE EFFECTS

  xval= buffer array

NOTES

  status of MPI_RECV is explicitly ignored

SOURCE

449 subroutine xmpi_recv_dp2d(xval,source,tag,comm,ier)
450 
451 !Arguments-------------------------
452  real(dp), DEV_CONTARRD intent(inout) :: xval(:,:)
453  integer ,intent(in) :: source,tag,comm
454  integer ,intent(out) :: ier
455 
456 !Local variables-------------------
457 #if defined HAVE_MPI
458  integer :: my_dt,my_op,n1,n2,my_tag
459  integer(kind=int64) :: ntot
460 #endif
461 
462 ! *************************************************************************
463 
464  ier=0
465 #if defined HAVE_MPI
466  if (comm /= MPI_COMM_SELF .and. comm /= MPI_COMM_NULL) then
467    n1=size(xval,dim=1)
468    n2=size(xval,dim=2)
469    my_tag=MOD(tag,xmpi_tag_ub)
470 
471 
472    !This product of dimensions can be greater than a 32bit integer
473    !We use a INT64 to store it. If it is too large, we switch to an
474    !alternate routine because MPI<4 doesnt handle 64 bit counts.
475    ntot=int(n1*n2,kind=int64)
476 
477    if (ntot<=xmpi_maxint32_64) then
478      call MPI_RECV(xval,n1*n2,MPI_DOUBLE_PRECISION,source,my_tag,comm,MPI_STATUS_IGNORE,ier)
479    else
480      call xmpi_largetype_create(ntot,MPI_DOUBLE_PRECISION,my_dt,my_op,MPI_OP_NULL)
481      call MPI_RECV(xval,1,my_dt,source,my_tag,comm,MPI_STATUS_IGNORE,ier)
482      call xmpi_largetype_free(my_dt,my_op)
483    end if
484 
485  end if
486 #endif
487 
488 end subroutine xmpi_recv_dp2d

ABINIT/xmpi_recv_dp3d [ Functions ]

[ Top ] [ Functions ]

NAME

  xmpi_recv_dp3d

FUNCTION

  Receives data from one proc sent by another.
  Target: double precision three-dimensional arrays.

INPUTS

  source :: rank of source process
  tag :: integer message tag
  comm :: MPI communicator

OUTPUT

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

SIDE EFFECTS

  xval= buffer array

NOTES

  status of MPI_RECV is explicitly ignored

SOURCE

515 subroutine xmpi_recv_dp3d(xval,source,tag,comm,ier)
516 
517 !Arguments-------------------------
518  real(dp), DEV_CONTARRD intent(inout) :: xval(:,:,:)
519  integer ,intent(in) :: source,tag,comm
520  integer ,intent(out)   :: ier
521 
522 !Local variables-------------------
523 #if defined HAVE_MPI
524  integer :: my_dt,my_op,n1,n2,n3,my_tag
525  integer(kind=int64) :: ntot
526 #endif
527 
528 ! *************************************************************************
529 
530  ier=0
531 #if defined HAVE_MPI
532  if (comm /= MPI_COMM_SELF .and. comm /= MPI_COMM_NULL) then
533    n1=size(xval,dim=1)
534    n2=size(xval,dim=2)
535    n3=size(xval,dim=3)
536    my_tag=MOD(tag,xmpi_tag_ub)
537 
538 
539    !This product of dimensions can be greater than a 32bit integer
540    !We use a INT64 to store it. If it is too large, we switch to an
541    !alternate routine because MPI<4 doesnt handle 64 bit counts.
542    ntot=int(n1*n2*n3,kind=int64)
543 
544    if (ntot<=xmpi_maxint32_64) then
545      call MPI_RECV(xval,n1*n2*n3,MPI_DOUBLE_PRECISION,source,my_tag,comm,MPI_STATUS_IGNORE,ier)
546    else
547      call xmpi_largetype_create(ntot,MPI_DOUBLE_PRECISION,my_dt,my_op,MPI_OP_NULL)
548      call MPI_RECV(xval,1,my_dt,source,my_tag,comm,MPI_STATUS_IGNORE,ier)
549      call xmpi_largetype_free(my_dt,my_op)
550    end if
551 
552  end if
553 #endif
554 
555 end subroutine xmpi_recv_dp3d

ABINIT/xmpi_recv_dp4d [ Functions ]

[ Top ] [ Functions ]

NAME

  xmpi_recv_dp4d

FUNCTION

  Receives data from one proc sent by another.
  Target: double precision fourd-dimensional arrays.

INPUTS

  source :: rank of source process
  tag :: integer message tag
  comm :: MPI communicator

OUTPUT

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

SIDE EFFECTS

  xval= buffer array

NOTES

  status of MPI_RECV is explicitly ignored

SOURCE

582 subroutine xmpi_recv_dp4d(xval,source,tag,comm,ier)
583 
584 !Arguments-------------------------
585  real(dp), DEV_CONTARRD intent(inout) :: xval(:,:,:,:)
586  integer ,intent(in) :: source,tag,comm
587  integer ,intent(out)   :: ier
588 
589 !Local variables-------------------
590 #if defined HAVE_MPI
591  integer :: my_dt,my_op,n1,n2,n3,n4,my_tag
592  integer(kind=int64) :: ntot
593 #endif
594 
595 ! *************************************************************************
596 
597  ier=0
598 #if defined HAVE_MPI
599  if (comm /= MPI_COMM_SELF .and. comm /= MPI_COMM_NULL) then
600    n1=size(xval,dim=1)
601    n2=size(xval,dim=2)
602    n3=size(xval,dim=3)
603    n4=size(xval,dim=4)
604    my_tag=MOD(tag,xmpi_tag_ub)
605 
606 
607    !This product of dimensions can be greater than a 32bit integer
608    !We use a INT64 to store it. If it is too large, we switch to an
609    !alternate routine because MPI<4 doesnt handle 64 bit counts.
610    ntot=int(n1*n2*n3*n4,kind=int64)
611 
612    if (ntot<=xmpi_maxint32_64) then
613      call MPI_RECV(xval,n1*n2*n3*n4,MPI_DOUBLE_PRECISION,source,my_tag,comm,MPI_STATUS_IGNORE,ier)
614    else
615      call xmpi_largetype_create(ntot,MPI_DOUBLE_PRECISION,my_dt,my_op,MPI_OP_NULL)
616      call MPI_RECV(xval,1,my_dt,source,my_tag,comm,MPI_STATUS_IGNORE,ier)
617      call xmpi_largetype_free(my_dt,my_op)
618    end if
619 
620  end if
621 #endif
622 
623 end subroutine xmpi_recv_dp4d

ABINIT/xmpi_recv_int1d [ Functions ]

[ Top ] [ Functions ]

NAME

  xmpi_recv_int1d

FUNCTION

  Receives data from one proc sent by another.
  Target: integer one-dimensional arrays.

INPUTS

  source :: rank of source process
  tag :: integer message tag
  comm :: MPI communicator

OUTPUT

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

SIDE EFFECTS

  xval= buffer array

NOTES

  status of MPI_RECV is explicitly ignored

INPUTS

  source :: rank of source process
  tag :: integer message tag
  comm :: MPI communicator

OUTPUT

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

SIDE EFFECTS

  xval= buffer array

NOTES

  status of MPI_RECV is explicitly ignored

SOURCE

160 subroutine xmpi_recv_int1d(xval,source,tag,comm,ier)
161 
162 !Arguments-------------------------
163  integer, DEV_CONTARRD intent(inout) :: xval(:)
164  integer,intent(in) :: source,tag,comm
165  integer,intent(out) :: ier
166 
167 !Local variables-------------------
168 #if defined HAVE_MPI
169  integer :: my_tag, n1
170 #endif
171 
172 ! *************************************************************************
173 
174  ier=0
175 #if defined HAVE_MPI
176  if (comm /= MPI_COMM_SELF .and. comm /= MPI_COMM_NULL) then
177    n1=size(xval,dim=1)
178    my_tag = MOD(tag,xmpi_tag_ub)
179    call MPI_RECV(xval,n1,MPI_INTEGER,source,my_tag,comm,MPI_STATUS_IGNORE,ier)
180  end if
181 #endif
182 
183  end subroutine xmpi_recv_int1d

ABINIT/xmpi_recv_int2d [ Functions ]

[ Top ] [ Functions ]

NAME

  xmpi_recv_int2d

FUNCTION

  Receives data from one proc sent by another.
  Target: integer two-dimensional arrays.

INPUTS

  source :: rank of source process
  tag :: integer message tag
  comm :: MPI communicator

OUTPUT

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

SIDE EFFECTS

  xval= buffer array

NOTES

  status of MPI_RECV is explicitly ignored

PARENTS

CHILDREN

      mpi_recv

SOURCE

214 subroutine xmpi_recv_int2d(xval,source,tag,comm,ier)
215 
216 !Arguments-------------------------
217  integer,intent(inout) :: xval(:,:)
218  integer ,intent(in) :: source,tag,comm
219  integer ,intent(out)   :: ier
220 
221 !Local variables-------------------
222 #if defined HAVE_MPI
223  integer :: my_dt,my_op,n1,n2,my_tag
224  integer(kind=int64) :: ntot
225 #endif
226 
227 ! *************************************************************************
228 
229  ier=0
230 #if defined HAVE_MPI
231  if (comm /= MPI_COMM_SELF .and. comm /= MPI_COMM_NULL) then
232    n1=size(xval,dim=1)
233    n2=size(xval,dim=2)
234    my_tag=MOD(tag,xmpi_tag_ub)
235 
236 
237    !This product of dimensions can be greater than a 32bit integer
238    !We use a INT64 to store it. If it is too large, we switch to an
239    !alternate routine because MPI<4 doesnt handle 64 bit counts.
240    ntot=int(n1*n2,kind=int64)
241 
242    if (ntot<=xmpi_maxint32_64) then
243      call MPI_RECV(xval,n1*n2,MPI_INTEGER,source,my_tag,comm,MPI_STATUS_IGNORE,ier)
244    else
245      call xmpi_largetype_create(ntot,MPI_INTEGER,my_dt,my_op,MPI_OP_NULL)
246      call MPI_RECV(xval,1,my_dt,source,my_tag,comm,MPI_STATUS_IGNORE,ier)
247      call xmpi_largetype_free(my_dt,my_op)
248    end if
249 
250  end if
251 #endif
252 
253 end subroutine xmpi_recv_int2d

ABINIT/xmpi_recv_int3d [ Functions ]

[ Top ] [ Functions ]

NAME

  xmpi_recv_int3d

FUNCTION

  Receives data from one proc sent by another.
  Target: integer three-dimensional arrays.

INPUTS

  source :: rank of source process
  tag :: integer message tag
  comm :: MPI communicator

OUTPUT

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

SIDE EFFECTS

  xval= buffer array

NOTES

  status of MPI_RECV is explicitly ignored

PARENTS

CHILDREN

      mpi_recv

SOURCE

284 subroutine xmpi_recv_int3d(xval,source,tag,comm,ier)
285 
286 !Arguments-------------------------
287  integer,intent(inout) :: xval(:,:,:)
288  integer ,intent(in) :: source,tag,comm
289  integer ,intent(out)   :: ier
290 
291 !Local variables-------------------
292 #if defined HAVE_MPI
293  integer :: my_dt,my_op,n1,n2,n3,my_tag
294  integer(kind=int64) :: ntot
295 #endif
296 
297 ! *************************************************************************
298 
299  ier=0
300 #if defined HAVE_MPI
301  if (comm /= MPI_COMM_SELF .and. comm /= MPI_COMM_NULL) then
302    n1=size(xval,dim=1)
303    n2=size(xval,dim=2)
304    n3=size(xval,dim=3)
305    my_tag=MOD(tag,xmpi_tag_ub)
306 
307    !This product of dimensions can be greater than a 32bit integer
308    !We use a INT64 to store it. If it is too large, we switch to an
309    !alternate routine because MPI<4 doesnt handle 64 bit counts.
310    ntot=int(n1*n2*n3,kind=int64)
311 
312    if (ntot<=xmpi_maxint32_64) then
313      call MPI_RECV(xval,n1*n2*n3,MPI_INTEGER,source,my_tag,comm,MPI_STATUS_IGNORE,ier)
314    else
315      call xmpi_largetype_create(ntot,MPI_INTEGER,my_dt,my_op,MPI_OP_NULL)
316      call MPI_RECV(xval,1,my_dt,source,my_tag,comm,MPI_STATUS_IGNORE,ier)
317      call xmpi_largetype_free(my_dt,my_op)
318    end if
319 
320  end if
321 #endif
322 
323 end subroutine xmpi_recv_int3d

ABINIT/xmpi_recv_intv [ Functions ]

[ Top ] [ Functions ]

NAME

  xmpi_recv_intv

FUNCTION

  Receives data from one processor sent by another.
  Target: single integer.

INPUTS

  source :: rank of source process
  tag :: integer message tag
  comm :: MPI communicator

OUTPUT

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

SIDE EFFECTS

  xval= buffer array

NOTES

  status of MPI_RECV is explicitly ignored

SOURCE

 96 subroutine xmpi_recv_intv(xval,source,tag,comm,ier)
 97 
 98 !Arguments-------------------------
 99  integer,intent(inout) :: xval
100  integer,intent(in) :: source,tag,comm
101  integer,intent(out)   :: ier
102 
103 !Local variables-------------------
104 #if defined HAVE_MPI
105   integer :: my_tag
106 #endif
107 
108 ! *************************************************************************
109 
110  ier=0
111 #if defined HAVE_MPI
112  if (comm /= MPI_COMM_SELF .and. comm /= MPI_COMM_NULL) then
113    my_tag=MOD(tag,xmpi_tag_ub)
114    call MPI_RECV(xval,1,MPI_INTEGER,source,my_tag,comm,MPI_STATUS_IGNORE,ier)
115  end if
116 #endif
117 
118  end subroutine xmpi_recv_intv