TABLE OF CONTENTS


ABINIT/m_libpaw_mpi [ Modules ]

[ Top ] [ Modules ]

NAME

  m_libpaw_mpi

FUNCTION

  libPAW wrappers for MPI library.
  Provides MPI named constants or tools as well as
  a set of generic interfaces wrapping MPI primitives.

COPYRIGHT

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

NOTES

  This file comes directly from m_xmpi.F90 module delivered with ABINIT.

  FOR DEVELOPPERS: in order to preserve the portability of libPAW library,
  please consult ~abinit/src/??_libpaw/libpaw-coding-rules.txt

SOURCE

25 #include "libpaw.h"
26 
27 module m_libpaw_mpi
28     
29  USE_DEFS
30 
31 #ifdef HAVE_MPI2
32  use mpi
33 #endif
34 
35  implicit none
36 
37  private

ABINIT/xpaw_mpi_allgather_dp1d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_allgather_dp1d

FUNCTION

  MPI_ALLGATHER for 1D double precision arrays

INPUTS

  xval= buffer array
  nelem= number of elements
  spaceComm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  recvbuf= received elements

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

664 subroutine xpaw_mpi_allgather_dp1d(xval,nelem,recvbuf,spaceComm,ier)
665 
666 
667 !This section has been created automatically by the script Abilint (TD).
668 !Do not modify the following lines by hand.
669 #undef ABI_FUNC
670 #define ABI_FUNC 'xpaw_mpi_allgather_dp1d'
671 !End of the abilint section
672 
673  implicit none
674 
675 !Arguments-------------------------
676  real(dp), intent(in) :: xval(:)
677  real(dp), intent(inout) :: recvbuf(:)
678  integer, intent(in) :: nelem,spaceComm
679  integer, intent(out) :: ier
680 
681 ! *************************************************************************
682  ier=0
683 #if defined HAVE_MPI
684  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
685    call MPI_ALLGATHER(xval,nelem,MPI_DOUBLE_PRECISION,recvbuf,nelem,MPI_DOUBLE_PRECISION,spaceComm,ier)
686  else if (spaceComm == xpaw_mpi_comm_self) then
687    recvbuf(1:nelem)=xval(1:nelem)
688  end if
689 #else
690  recvbuf(1:nelem)=xval(1:nelem)
691 #endif
692 end subroutine xpaw_mpi_allgather_dp1d

ABINIT/xpaw_mpi_allgather_dp2d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_allgather_dp2d

FUNCTION

  MPI_ALLGATHER for 2D double precision arrays

INPUTS

  xval= buffer array
  nelem= number of elements
  spaceComm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  recvbuf= received elements

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

720 subroutine xpaw_mpi_allgather_dp2d(xval,nelem,recvbuf,spaceComm,ier)
721 
722 
723 !This section has been created automatically by the script Abilint (TD).
724 !Do not modify the following lines by hand.
725 #undef ABI_FUNC
726 #define ABI_FUNC 'xpaw_mpi_allgather_dp2d'
727 !End of the abilint section
728 
729  implicit none
730 
731 !Arguments-------------------------
732  real(dp), intent(in) :: xval(:,:)
733  real(dp), intent(inout) :: recvbuf(:,:)
734  integer, intent(in) :: nelem,spaceComm
735  integer, intent(out) :: ier
736 
737 ! *************************************************************************
738  ier=0
739 #if defined HAVE_MPI
740  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
741    call MPI_ALLGATHER(xval,nelem,MPI_DOUBLE_PRECISION,recvbuf,nelem,MPI_DOUBLE_PRECISION,spaceComm,ier)
742  else if (spaceComm == xpaw_mpi_comm_self) then
743    recvbuf(:,:)=xval(:,:)
744  end if
745 #else
746  recvbuf(:,:)=xval(:,:)
747 #endif
748 end subroutine xpaw_mpi_allgather_dp2d

ABINIT/xpaw_mpi_allgather_dp3d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_allgather_dp3d

FUNCTION

  MPI_ALLGATHER for 3D double precision arrays

INPUTS

  xval= buffer array
  nelem= number of elements
  spaceComm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  recvbuf= received elements

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

776 subroutine xpaw_mpi_allgather_dp3d(xval,nelem,recvbuf,spaceComm,ier)
777 
778 
779 !This section has been created automatically by the script Abilint (TD).
780 !Do not modify the following lines by hand.
781 #undef ABI_FUNC
782 #define ABI_FUNC 'xpaw_mpi_allgather_dp3d'
783 !End of the abilint section
784 
785  implicit none
786 
787 !Arguments-------------------------
788  real(dp), intent(in) :: xval(:,:,:)
789  real(dp), intent(inout) :: recvbuf(:,:,:)
790  integer, intent(in) :: nelem,spaceComm
791  integer, intent(out) :: ier
792 
793 ! *************************************************************************
794  ier=0
795 #if defined HAVE_MPI
796  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
797    call MPI_ALLGATHER(xval,nelem,MPI_DOUBLE_PRECISION,recvbuf,nelem,MPI_DOUBLE_PRECISION,spaceComm,ier)
798  else if (spaceComm == xpaw_mpi_comm_self) then
799    recvbuf(:,:,:)=xval(:,:,:)
800  end if
801 #else
802  recvbuf(:,:,:)=xval(:,:,:)
803 #endif
804 end subroutine xpaw_mpi_allgather_dp3d

ABINIT/xpaw_mpi_allgather_int1d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_allgather_int1d

FUNCTION

  MPI_ALLGATHER for 1D integer arrays

INPUTS

  xval= buffer array
  nelem= number of elements
  spaceComm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  recvbuf= received elements

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

608 subroutine xpaw_mpi_allgather_int1d(xval,nelem,recvbuf,spaceComm,ier)
609 
610 
611 !This section has been created automatically by the script Abilint (TD).
612 !Do not modify the following lines by hand.
613 #undef ABI_FUNC
614 #define ABI_FUNC 'xpaw_mpi_allgather_int1d'
615 !End of the abilint section
616 
617  implicit none
618 
619 !Arguments-------------------------
620  integer, intent(in) :: xval(:)
621  integer, intent(inout) :: recvbuf(:)
622  integer, intent(in) :: nelem,spaceComm
623  integer, intent(out) :: ier
624 
625 ! *************************************************************************
626  ier=0
627 #if defined HAVE_MPI
628  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
629    call MPI_ALLGATHER(xval,nelem,MPI_INTEGER,recvbuf,nelem,MPI_INTEGER,spaceComm,ier)
630  else if (spaceComm == xpaw_mpi_comm_self) then
631    recvbuf(1:nelem)=xval(1:nelem)
632  end if
633 #else
634  recvbuf(1:nelem)=xval(1:nelem)
635 #endif
636 end subroutine xpaw_mpi_allgather_int1d

ABINIT/xpaw_mpi_allgatherv_dp1d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_allgatherv_dp1d

FUNCTION

  MPI_ALLGATHERV for 1D double precision arrays

INPUTS

  xval= buffer array
  recvcounts= number of received elements
  displs= relative offsets for incoming data
  nelem= number of elements
  spaceComm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  recvbuf= received buffer

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

901 subroutine xpaw_mpi_allgatherv_dp1d(xval,nelem,recvbuf,recvcounts,displs,spaceComm,ier)
902 
903 
904 !This section has been created automatically by the script Abilint (TD).
905 !Do not modify the following lines by hand.
906 #undef ABI_FUNC
907 #define ABI_FUNC 'xpaw_mpi_allgatherv_dp1d'
908 !End of the abilint section
909 
910  implicit none
911 
912 !Arguments-------------------------
913  real(dp), intent(in) :: xval(:)
914  real(dp), intent(inout) :: recvbuf(:)
915  integer, intent(in) :: recvcounts(:),displs(:)
916  integer, intent(in) :: nelem,spaceComm
917  integer, intent(out) :: ier
918 
919 !Local variables--------------
920  integer :: cc,dd
921 
922 ! *************************************************************************
923  ier=0
924 #if defined HAVE_MPI
925  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
926    call MPI_ALLGATHERV(xval,nelem,MPI_DOUBLE_PRECISION,recvbuf,recvcounts,displs,&
927 &   MPI_DOUBLE_PRECISION,spaceComm,ier)
928  else if (spaceComm == xpaw_mpi_comm_self) then
929 #endif
930    dd=0;if (size(displs)>0) dd=displs(1)
931    cc=size(xval);if (size(recvcounts)>0) cc=recvcounts(1)
932    recvbuf(dd+1:dd+cc)=xval(1:cc)
933 #if defined HAVE_MPI
934  end if
935 #endif
936 end subroutine xpaw_mpi_allgatherv_dp1d

ABINIT/xpaw_mpi_allgatherv_dp2d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_allgatherv_dp2d

FUNCTION

  MPI_ALLGATHERV for 2D double precision arrays

INPUTS

  xval= buffer array
  recvcounts= number of received elements
  displs= relative offsets for incoming data
  nelem= number of elements
  spaceComm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  recvbuf= received buffer

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

 966 subroutine xpaw_mpi_allgatherv_dp2d(xval,nelem,recvbuf,recvcounts,displs,spaceComm,ier)
 967 
 968 
 969 !This section has been created automatically by the script Abilint (TD).
 970 !Do not modify the following lines by hand.
 971 #undef ABI_FUNC
 972 #define ABI_FUNC 'xpaw_mpi_allgatherv_dp2d'
 973 !End of the abilint section
 974 
 975  implicit none
 976 
 977 !Arguments-------------------------
 978  real(dp), intent(in) :: xval(:,:)
 979  real(dp), intent(inout) :: recvbuf(:,:)
 980  integer, intent(in) :: recvcounts(:),displs(:)
 981  integer, intent(in) :: nelem,spaceComm
 982  integer, intent(out) :: ier
 983 
 984 !Local variables--------------
 985  integer :: cc,dd,sz1
 986  
 987 ! *************************************************************************
 988  ier=0
 989 #if defined HAVE_MPI
 990  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
 991    call MPI_ALLGATHERV(xval,nelem,MPI_DOUBLE_PRECISION,recvbuf,recvcounts,displs,&
 992 &   MPI_DOUBLE_PRECISION,spaceComm,ier)
 993  else if (spaceComm == xpaw_mpi_comm_self) then
 994 #endif
 995    sz1=size(xval,1)
 996    dd=0;if (size(displs)>0) dd=displs(1)/sz1
 997    cc=size(xval,2);if (size(recvcounts)>0) cc=recvcounts(1)/sz1
 998    recvbuf(:,dd+1:dd+cc)=xval(:,1:cc)
 999 #if defined HAVE_MPI
1000  end if
1001 #endif
1002 end subroutine xpaw_mpi_allgatherv_dp2d

ABINIT/xpaw_mpi_allgatherv_int1d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_allgatherv_int1d

FUNCTION

  MPI_ALLGATHERV for 1D integer arrays

INPUTS

  xval= buffer array
  recvcounts= number of received elements
  displs= relative offsets for incoming data
  nelem= number of elements
  spaceComm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  recvbuf= received buffer

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

836 subroutine xpaw_mpi_allgatherv_int1d(xval,nelem,recvbuf,recvcounts,displs,spaceComm,ier)
837 
838 
839 !This section has been created automatically by the script Abilint (TD).
840 !Do not modify the following lines by hand.
841 #undef ABI_FUNC
842 #define ABI_FUNC 'xpaw_mpi_allgatherv_int1d'
843 !End of the abilint section
844 
845  implicit none
846 
847 !Arguments-------------------------
848  integer, intent(in) :: xval(:)
849  integer, intent(inout) :: recvbuf(:)
850  integer, intent(in) :: recvcounts(:),displs(:)
851  integer, intent(in) :: nelem,spaceComm
852  integer, intent(out) :: ier
853 
854 !Local variables-------------------
855  integer :: cc,dd
856 
857 ! *************************************************************************
858  ier=0
859 #if defined HAVE_MPI
860  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
861    call MPI_ALLGATHERV(xval,nelem,MPI_INTEGER,recvbuf,recvcounts,displs,&
862 &   MPI_INTEGER,spaceComm,ier)
863  else if (spaceComm == xpaw_mpi_comm_self) then
864 #endif
865    dd=0;if (size(displs)>0) dd=displs(1)
866    cc=size(xval);if (size(recvcounts)>0) cc=recvcounts(1)
867    recvbuf(dd+1:dd+cc)=xval(1:cc)
868 #if defined HAVE_MPI
869  end if
870 #endif
871 end subroutine xpaw_mpi_allgatherv_int1d

ABINIT/xpaw_mpi_alltoall_dp1d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_alltoall_dp1d

FUNCTION

  MPI_ALLTOALL for 1D double precision arrays

INPUTS

  xval= buffer array
  sendsize= size of sent buffer
  recvsize= size of received buffer
  spaceComm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  recvbuf= received buffer

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

1292 subroutine xpaw_mpi_alltoall_dp1d(xval,sendsize,recvbuf,recvsize,spaceComm,ier)
1293 
1294 
1295 !This section has been created automatically by the script Abilint (TD).
1296 !Do not modify the following lines by hand.
1297 #undef ABI_FUNC
1298 #define ABI_FUNC 'xpaw_mpi_alltoall_dp1d'
1299 !End of the abilint section
1300 
1301  implicit none
1302 
1303 !Arguments-------------------------
1304  real(dp), intent(in)    :: xval(:)
1305  real(dp), intent(inout) :: recvbuf(:)
1306  integer, intent(in) :: sendsize, recvsize
1307  integer, intent(in) :: spaceComm
1308  integer, intent(out) :: ier
1309 
1310 ! *************************************************************************
1311  ier=0
1312 #if defined HAVE_MPI
1313  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
1314    call MPI_ALLTOALL(xval, sendsize, MPI_DOUBLE_PRECISION, recvbuf, &
1315 &   recvsize, MPI_DOUBLE_PRECISION, spaceComm, ier)
1316  else if (spaceComm == xpaw_mpi_comm_self) then
1317    recvbuf=xval
1318  end if
1319 #else
1320  recvbuf=xval
1321 #endif
1322 end subroutine xpaw_mpi_alltoall_dp1d

ABINIT/xpaw_mpi_alltoall_dp2d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_alltoall_dp2d

FUNCTION

  MPI_ALLTOALL for 2D double precision arrays

INPUTS

  xval= buffer array
  sendsize= size of sent buffer
  recvsize= size of received buffer
  spaceComm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  recvbuf= received buffer

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

1351 subroutine xpaw_mpi_alltoall_dp2d(xval,sendsize,recvbuf,recvsize,spaceComm,ier)
1352 
1353 
1354 !This section has been created automatically by the script Abilint (TD).
1355 !Do not modify the following lines by hand.
1356 #undef ABI_FUNC
1357 #define ABI_FUNC 'xpaw_mpi_alltoall_dp2d'
1358 !End of the abilint section
1359 
1360  implicit none
1361 
1362 !Arguments-------------------------
1363  real(dp), intent(in)    :: xval(:,:)
1364  real(dp), intent(inout) :: recvbuf(:,:)
1365  integer, intent(in) :: sendsize, recvsize
1366  integer, intent(in) :: spaceComm
1367  integer, intent(out) :: ier
1368 
1369 ! *************************************************************************
1370  ier=0
1371 #if defined HAVE_MPI
1372  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
1373    call MPI_ALLTOALL(xval, sendsize, MPI_DOUBLE_PRECISION, recvbuf, &
1374 &   recvsize, MPI_DOUBLE_PRECISION, spaceComm, ier)
1375  else if (spaceComm == xpaw_mpi_comm_self) then
1376    recvbuf=xval
1377  end if
1378 #else
1379  recvbuf=xval
1380 #endif
1381 end subroutine xpaw_mpi_alltoall_dp2d

ABINIT/xpaw_mpi_alltoall_int1d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_alltoall_int1d

FUNCTION

  MPI_ALLTOALL for 1D integer arrays

INPUTS

  xval= buffer array
  sendsize= size of sent buffer
  recvsize= size of received buffer
  spaceComm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  recvbuf= received buffer

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

1231 subroutine xpaw_mpi_alltoall_int1d(xval,sendsize,recvbuf,recvsize,spaceComm,ier)
1232 
1233 
1234 !This section has been created automatically by the script Abilint (TD).
1235 !Do not modify the following lines by hand.
1236 #undef ABI_FUNC
1237 #define ABI_FUNC 'xpaw_mpi_alltoall_int1d'
1238 !End of the abilint section
1239 
1240  implicit none
1241 
1242 !Arguments-------------------------
1243  integer, intent(in) :: xval(:)
1244  integer, intent(inout) :: recvbuf(:)
1245  integer, intent(in) :: sendsize, recvsize
1246  integer, intent(in) :: spaceComm
1247  integer, intent(out) :: ier
1248 
1249 !Local variables-------------------
1250 
1251 ! *************************************************************************
1252  ier=0
1253 #if defined HAVE_MPI
1254  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
1255    call MPI_ALLTOALL(xval, sendsize, MPI_INTEGER, recvbuf, &
1256 &   recvsize, MPI_INTEGER, spaceComm, ier)
1257  else if (spaceComm == xpaw_mpi_comm_self) then
1258    recvbuf=xval
1259  end if
1260 #else
1261  recvbuf=xval
1262 #endif
1263 end subroutine xpaw_mpi_alltoall_int1d

ABINIT/xpaw_mpi_alltoallv_dp1d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_alltoallv_dp1d

FUNCTION

  MPI_ALLTOALLV for 1D double precision arrays

INPUTS

  xval= buffer array
  sendcnts= number of elements to send to each processor
  sdispls= displacements from which to take the outgoing data
  recvcnts= number of elements that can be received from each processor 
  rdispls= displacement at which to place the incoming data from each processor
  comm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  recvbuf= received buffer

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

1484 subroutine xpaw_mpi_alltoallv_dp1d(xval,sendcnts,sdispls,recvbuf,recvcnts,rdispls,comm,ier)
1485 
1486 
1487 !This section has been created automatically by the script Abilint (TD).
1488 !Do not modify the following lines by hand.
1489 #undef ABI_FUNC
1490 #define ABI_FUNC 'xpaw_mpi_alltoallv_dp1d'
1491 !End of the abilint section
1492 
1493  implicit none
1494 
1495 !Arguments-------------------------
1496  real(dp), intent(in) :: xval(:)
1497  real(dp), intent(inout) :: recvbuf(:)
1498  integer, intent(in) :: sendcnts(:),sdispls(:),recvcnts(:),rdispls(:)
1499  integer, intent(in) :: comm
1500  integer, intent(out) :: ier
1501 
1502 !Local variables-------------------
1503  integer :: sc,sds,sdr
1504 
1505 ! *********************************************************************
1506  ier=0
1507 #if defined HAVE_MPI
1508  if (comm /= xpaw_mpi_comm_self .and. comm /= xpaw_mpi_comm_null) then
1509    call MPI_ALLTOALLV(xval,sendcnts,sdispls,MPI_DOUBLE_PRECISION,recvbuf,&
1510 &   recvcnts,rdispls,MPI_DOUBLE_PRECISION,comm,ier)
1511  else if (comm == MPI_COMM_SELF) then
1512 #endif
1513    sds=0;if (size(sdispls)>0) sds=sdispls(1)
1514    sdr=0;if (size(rdispls)>0) sdr=rdispls(1)
1515    sc=size(xval);if (size(sendcnts)>0) sc=sendcnts(1)
1516    recvbuf(sdr+1:sdr+sc)=xval(sds+1:sds+sc)
1517 #if defined HAVE_MPI
1518  end if
1519 #endif
1520 end subroutine xpaw_mpi_alltoallv_dp1d

ABINIT/xpaw_mpi_alltoallv_dp2d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_alltoallv_dp2d

FUNCTION

  MPI_ALLTOALLV for 2D double precision arrays

INPUTS

  xval= buffer array
  sendcnts= number of elements to send to each processor
  sdispls= displacements from which to take the outgoing data
  recvcnts= number of elements that can be received from each processor 
  rdispls= displacement at which to place the incoming data from each processor
  comm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  recvbuf= received buffer

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

1551 subroutine xpaw_mpi_alltoallv_dp2d(xval,sendcnts,sdispls,recvbuf,recvcnts,rdispls,comm,ier)
1552 
1553 
1554 !This section has been created automatically by the script Abilint (TD).
1555 !Do not modify the following lines by hand.
1556 #undef ABI_FUNC
1557 #define ABI_FUNC 'xpaw_mpi_alltoallv_dp2d'
1558 !End of the abilint section
1559 
1560  implicit none
1561 
1562 !Arguments-------------------------
1563  real(dp), intent(in) :: xval(:,:)
1564  real(dp), intent(inout) :: recvbuf(:,:)
1565  integer, intent(in) :: sendcnts(:),sdispls(:),rdispls(:),recvcnts(:)
1566  integer,intent(in) :: comm
1567  integer,intent(out) :: ier
1568 
1569 !Local variables-------------------
1570  integer :: sc,sds,sdr,sz1
1571  
1572 ! *********************************************************************
1573  ier=0
1574 #if defined HAVE_MPI
1575  if (comm /= xpaw_mpi_comm_self .and. comm /= xpaw_mpi_comm_null) then
1576    call MPI_ALLTOALLV(xval,sendcnts,sdispls,MPI_DOUBLE_PRECISION,recvbuf,&
1577 &   recvcnts,rdispls,MPI_DOUBLE_PRECISION,comm,ier)
1578  else if (comm == xpaw_mpi_comm_self) then
1579 #endif
1580    sz1=size(xval,1)
1581    sds=0;if (size(sdispls)>0) sds=sdispls(1)/sz1
1582    sdr=0;if (size(rdispls)>0) sdr=rdispls(1)/sz1
1583    sc=size(xval,2);if (size(sendcnts)>0) sc=sendcnts(1)/sz1
1584    recvbuf(:,sdr+1:sdr+sc)=xval(:,sds+1:sds+sc)
1585 #if defined HAVE_MPI
1586  end if
1587 #endif
1588 end subroutine xpaw_mpi_alltoallv_dp2d

ABINIT/xpaw_mpi_alltoallv_int1d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_alltoallv_int1d

FUNCTION

  MPI_ALLTOALLV for 1D integer arrays

INPUTS

  xval= buffer array
  sendcnts= number of elements to send to each processor
  sdispls= displacements from which to take the outgoing data
  recvcnts= number of elements that can be received from each processor 
  rdispls= displacement at which to place the incoming data from each processor
  comm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  recvbuf= received buffer

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

1414 subroutine xpaw_mpi_alltoallv_int1d(xval,sendcnts,sdispls,recvbuf,recvcnts,rdispls,comm,ier)
1415 
1416 
1417 !This section has been created automatically by the script Abilint (TD).
1418 !Do not modify the following lines by hand.
1419 #undef ABI_FUNC
1420 #define ABI_FUNC 'xpaw_mpi_alltoallv_int1d'
1421 !End of the abilint section
1422 
1423  implicit none
1424 
1425 !Arguments-------------------------
1426  integer, intent(in) :: xval(:)
1427  integer, intent(inout) :: recvbuf(:)
1428  integer, intent(in) :: sendcnts(:),sdispls(:),recvcnts(:)
1429  integer, intent(in) :: comm, rdispls
1430  integer, intent(out) :: ier
1431 
1432 !Local variables-------------------
1433  integer :: sc,sds,sdr
1434 #if defined HAVE_MPI
1435  integer :: rdispls_on(size(sendcnts))
1436 #endif
1437 
1438 ! *********************************************************************
1439  ier=0
1440 #if defined HAVE_MPI
1441  if (comm /= xpaw_mpi_comm_self .and. comm /= xpaw_mpi_comm_null) then
1442    rdispls_on = 0
1443    call MPI_ALLTOALLV(xval,sendcnts,sdispls,MPI_INTEGER,recvbuf,&
1444 &   recvcnts,rdispls_on,MPI_INTEGER,comm,ier)
1445  else if (comm == xpaw_mpi_comm_self) then
1446 #endif
1447    sdr=rdispls;sds=0;if (size(sdispls)>0) sds=sdispls(1)
1448    sc=size(xval);if (size(sendcnts)>0) sc=sendcnts(1)
1449    recvbuf(1:sc)=xval(sds+1:sds+sc)
1450 #if defined HAVE_MPI
1451  end if
1452 #endif
1453 end subroutine xpaw_mpi_alltoallv_int1d

ABINIT/xpaw_mpi_bcast_dp1d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_bcast_dp1d

FUNCTION

  MPI_BCAST for 1D double precision arrays

INPUTS

  spaceComm= MPI communicator
  master= master MPI node

OUTPUT

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

SIDE EFFECTS

  xval= buffer array

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

1722 subroutine xpaw_mpi_bcast_dp1d(xval,master,spaceComm,ier)
1723 
1724 
1725 !This section has been created automatically by the script Abilint (TD).
1726 !Do not modify the following lines by hand.
1727 #undef ABI_FUNC
1728 #define ABI_FUNC 'xpaw_mpi_bcast_dp1d'
1729 !End of the abilint section
1730 
1731  implicit none
1732 
1733 !Arguments-------------------------
1734  real(dp), intent(inout) :: xval(:)
1735  integer, intent(in) :: spaceComm,master
1736  integer, intent(out) :: ier
1737 
1738 !Local variables-------------------
1739 #if defined HAVE_MPI
1740  integer :: n
1741 #endif
1742 
1743 ! *************************************************************************
1744  ier=0
1745 #if defined HAVE_MPI
1746  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
1747    n=size(xval,dim=1)
1748    call MPI_BCAST(xval,n,MPI_DOUBLE_PRECISION,master,spaceComm,ier)
1749  end if
1750 #endif
1751 end subroutine xpaw_mpi_bcast_dp1d

ABINIT/xpaw_mpi_bcast_dp2d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_bcast_dp2d

FUNCTION

  MPI_BCAST for 2D double precision arrays

INPUTS

  spaceComm= MPI communicator
  master= master MPI node

OUTPUT

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

SIDE EFFECTS

  xval= buffer array

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

1778 subroutine xpaw_mpi_bcast_dp2d(xval,master,spaceComm,ier)
1779 
1780 
1781 !This section has been created automatically by the script Abilint (TD).
1782 !Do not modify the following lines by hand.
1783 #undef ABI_FUNC
1784 #define ABI_FUNC 'xpaw_mpi_bcast_dp2d'
1785 !End of the abilint section
1786 
1787  implicit none
1788 
1789 !Arguments-------------------------
1790  real(dp), intent(inout) :: xval(:,:)
1791  integer, intent(in) :: spaceComm,master
1792  integer, intent(out) :: ier
1793 
1794 !Local variables-------------------
1795 #if defined HAVE_MPI
1796  integer :: n1,n2
1797 #endif
1798 
1799 ! *************************************************************************
1800  ier=0
1801 #if defined HAVE_MPI
1802  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
1803    n1=size(xval,dim=1) ; n2=size(xval,dim=2)
1804    call MPI_BCAST(xval,n1*n2,MPI_DOUBLE_PRECISION,master,spaceComm,ier)
1805  end if
1806 #endif
1807 end subroutine xpaw_mpi_bcast_dp2d

ABINIT/xpaw_mpi_bcast_dp3d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_bcast_dp3d

FUNCTION

  MPI_BCAST for 3D double precision arrays

INPUTS

  spaceComm= MPI communicator
  master= master MPI node

OUTPUT

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

SIDE EFFECTS

  xval= buffer array

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

1834 subroutine xpaw_mpi_bcast_dp3d(xval,master,spaceComm,ier)
1835 
1836 
1837 !This section has been created automatically by the script Abilint (TD).
1838 !Do not modify the following lines by hand.
1839 #undef ABI_FUNC
1840 #define ABI_FUNC 'xpaw_mpi_bcast_dp3d'
1841 !End of the abilint section
1842 
1843  implicit none
1844 
1845 !Arguments-------------------------
1846  real(dp), intent(inout) :: xval(:,:,:)
1847  integer, intent(in) :: spaceComm,master
1848  integer, intent(out) :: ier
1849 
1850 !Local variables-------------------
1851 #if defined HAVE_MPI
1852  integer :: n1,n2,n3
1853 #endif
1854 
1855 ! *************************************************************************
1856  ier=0
1857 #if defined HAVE_MPI
1858  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
1859    n1=size(xval,dim=1) ; n2=size(xval,dim=2) ; n3=size(xval,dim=3)
1860    call MPI_BCAST(xval,n1*n2*n3,MPI_DOUBLE_PRECISION,master,spaceComm,ier)
1861  end if
1862 #endif
1863 end subroutine xpaw_mpi_bcast_dp3d

ABINIT/xpaw_mpi_bcast_int [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_bcast_int

FUNCTION

  MPI_BCAST for integers

INPUTS

  spaceComm= MPI communicator
  master= master MPI node

OUTPUT

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

SIDE EFFECTS

  xval= buffer

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

1617 subroutine xpaw_mpi_bcast_int(xval,master,spaceComm,ier)
1618 
1619 
1620 !This section has been created automatically by the script Abilint (TD).
1621 !Do not modify the following lines by hand.
1622 #undef ABI_FUNC
1623 #define ABI_FUNC 'xpaw_mpi_bcast_int'
1624 !End of the abilint section
1625 
1626  implicit none
1627 
1628 !Arguments ------------------------------------
1629  integer, intent(inout) :: xval
1630  integer, intent(in) :: spaceComm,master
1631  integer, intent(out) :: ier
1632 
1633 !Local variables-------------------------------
1634 
1635 ! *************************************************************************
1636  ier=0
1637 #if defined HAVE_MPI
1638  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
1639    call MPI_BCAST(xval,1,MPI_INTEGER,master,spaceComm,ier)
1640  end if
1641 #endif
1642 end subroutine xpaw_mpi_bcast_int

ABINIT/xpaw_mpi_bcast_int1d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_bcast_int1d

FUNCTION

  MPI_BCAST for 1D integer arrays

INPUTS

  spaceComm= MPI communicator
  master= master MPI node

OUTPUT

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

SIDE EFFECTS

  xval= buffer array

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

1669 subroutine xpaw_mpi_bcast_int1d(xval,master,spaceComm,ier)
1670 
1671 
1672 !This section has been created automatically by the script Abilint (TD).
1673 !Do not modify the following lines by hand.
1674 #undef ABI_FUNC
1675 #define ABI_FUNC 'xpaw_mpi_bcast_int1d'
1676 !End of the abilint section
1677 
1678  implicit none
1679 
1680 !Arguments ------------------------------------
1681  integer, intent(inout) :: xval(:)
1682  integer, intent(in) :: spaceComm,master
1683  integer, intent(out) :: ier
1684 
1685 !Local variables-------------------------------
1686  integer :: n
1687 
1688 ! *************************************************************************
1689  ier=0
1690 #if defined HAVE_MPI
1691  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
1692    n=size(xval)
1693    call MPI_BCAST(xval,n,MPI_INTEGER,master,spaceComm,ier)
1694  end if
1695 #endif
1696 end subroutine xpaw_mpi_bcast_int1d

ABINIT/xpaw_mpi_exch_dp1d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_exch_dp1d

FUNCTION

  MPI_SEND/MPI_RECV for 1D double precision arrays

INPUTS

  n1= first dimension of the array
  vsend= send buffer
  sender= node sending the data
  recever= node receiving the data
  spaceComm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  vrecv= receive buffer

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

3190 subroutine xpaw_mpi_exch_dp1d(vsend,n1,sender,vrecv,recever,spaceComm,ier)
3191 
3192 
3193 !This section has been created automatically by the script Abilint (TD).
3194 !Do not modify the following lines by hand.
3195 #undef ABI_FUNC
3196 #define ABI_FUNC 'xpaw_mpi_exch_dp1d'
3197 !End of the abilint section
3198 
3199  implicit none
3200 
3201 !Arguments----------------
3202  integer,intent(in) :: n1
3203  real(dp), intent(in) :: vsend(:)
3204  real(dp), intent(inout) :: vrecv(:)
3205  integer, intent(in) :: sender,recever,spaceComm
3206  integer, intent(out) :: ier
3207 
3208 !Local variables--------------
3209 #if defined HAVE_MPI
3210  integer :: status(MPI_STATUS_SIZE)
3211  integer :: tag,me
3212 #endif
3213 
3214 ! *************************************************************************
3215  ier=0
3216 #if defined HAVE_MPI
3217  if (sender==recever.or.spaceComm==xpaw_mpi_comm_null.or.(n1==0)) return
3218  call MPI_COMM_RANK(spaceComm,me,ier)
3219  tag = MOD(n1,xpaw_mpi_get_tag_ub(spaceComm))
3220  if (recever==me) then
3221    call MPI_RECV(vrecv,n1,MPI_DOUBLE_PRECISION,sender,tag,spaceComm,status,ier)
3222  end if
3223  if (sender==me) then
3224    call MPI_SEND(vsend,n1,MPI_DOUBLE_PRECISION,recever,tag,spaceComm,ier)
3225  end if
3226 #endif
3227 end subroutine xpaw_mpi_exch_dp1d

ABINIT/xpaw_mpi_exch_dp2d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_exch_dp2d

FUNCTION

  MPI_SEND/MPI_RECV for 2D double precision arrays

INPUTS

  nt= vector length
  vsend= sent buffer
  sender= node sending the data
  recever= node receiving the data
  spaceComm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  vrecv= received buffer

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

3257 subroutine xpaw_mpi_exch_dp2d(vsend,nt,sender,vrecv,recever,spaceComm,ier)
3258 
3259 
3260 !This section has been created automatically by the script Abilint (TD).
3261 !Do not modify the following lines by hand.
3262 #undef ABI_FUNC
3263 #define ABI_FUNC 'xpaw_mpi_exch_dp2d'
3264 !End of the abilint section
3265 
3266  implicit none
3267 
3268 !Arguments----------------
3269  integer,intent(in) :: nt
3270  real(dp), intent(in) :: vsend(:,:)
3271  real(dp), intent(inout) :: vrecv(:,:)
3272  integer, intent(in) :: sender,recever,spaceComm
3273  integer, intent(out) :: ier
3274 
3275 !Local variables--------------
3276 #if defined HAVE_MPI
3277  integer :: status(MPI_STATUS_SIZE)
3278  integer :: tag,me
3279 #endif
3280 
3281 ! *************************************************************************
3282  ier=0
3283 #if defined HAVE_MPI
3284  if (sender==recever.or.spaceComm==xpaw_mpi_comm_null.or.(nt==0)) return
3285  call MPI_COMM_RANK(spaceComm,me,ier)
3286  tag = MOD(nt,xpaw_mpi_get_tag_ub(spaceComm))
3287  if (recever==me) then
3288    call MPI_RECV(vrecv,nt,MPI_DOUBLE_PRECISION,sender,tag,spaceComm,status,ier)
3289  end if
3290  if (sender==me) then
3291    call MPI_SEND(vsend,nt,MPI_DOUBLE_PRECISION,recever,tag,spaceComm,ier)
3292  end if
3293 #endif
3294 end subroutine xpaw_mpi_exch_dp2d

ABINIT/xpaw_mpi_exch_dp3d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_exch_dp3d

FUNCTION

  MPI_SEND/MPI_RECV for 3D double precision arrays

INPUTS

  nt= vector length
  vsend= sent buffer
  sender= node sending the data
  recever= node receiving the data
  spaceComm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  vrecv= received buffer

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

3324 subroutine xpaw_mpi_exch_dp3d(vsend,nt,sender,vrecv,recever,spaceComm,ier)
3325 
3326 
3327 !This section has been created automatically by the script Abilint (TD).
3328 !Do not modify the following lines by hand.
3329 #undef ABI_FUNC
3330 #define ABI_FUNC 'xpaw_mpi_exch_dp3d'
3331 !End of the abilint section
3332 
3333  implicit none
3334 
3335 !Arguments----------------
3336  integer,intent(in) :: nt
3337  real(dp), intent(in) :: vsend(:,:,:)
3338  real(dp), intent(inout) :: vrecv(:,:,:)
3339  integer, intent(in) :: sender,recever,spaceComm
3340  integer, intent(out) :: ier
3341 
3342 !Local variables--------------
3343 #if defined HAVE_MPI
3344  integer :: status(MPI_STATUS_SIZE)
3345  integer :: tag,me
3346 #endif
3347 
3348 ! *************************************************************************
3349  ier=0
3350 #if defined HAVE_MPI
3351  if (sender==recever.or.spaceComm==xpaw_mpi_comm_null.or.(nt==0)) return
3352  call MPI_COMM_RANK(spaceComm,me,ier)
3353  tag = MOD(nt,xpaw_mpi_get_tag_ub(spaceComm))
3354  if (recever==me) then
3355    call MPI_RECV(vrecv,nt,MPI_DOUBLE_PRECISION,sender,tag,spaceComm,status,ier)
3356  end if
3357  if (sender==me) then
3358    call MPI_SEND(vsend,nt,MPI_DOUBLE_PRECISION,recever,tag,spaceComm,ier)
3359  end if
3360 #endif
3361 end subroutine xpaw_mpi_exch_dp3d

ABINIT/xpaw_mpi_exch_int1d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_exch_int1d

FUNCTION

  MPI_SEND/MPI_RECV for 1D integer arrays

INPUTS

  n1= vector length
  vsend= sent buffer
  sender= node sending the data
  recever= node receiving the data
  spaceComm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  vrecv= received buffer

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

3123 subroutine xpaw_mpi_exch_int1d(vsend,n1,sender,vrecv,recever,spaceComm,ier)
3124 
3125 
3126 !This section has been created automatically by the script Abilint (TD).
3127 !Do not modify the following lines by hand.
3128 #undef ABI_FUNC
3129 #define ABI_FUNC 'xpaw_mpi_exch_int1d'
3130 !End of the abilint section
3131 
3132  implicit none
3133 
3134 !Arguments----------------
3135  integer, intent(in) :: n1
3136  integer, intent(in) :: vsend(:)
3137  integer, intent(inout) :: vrecv(:)
3138  integer, intent(in) :: sender,recever,spaceComm
3139  integer, intent(out) :: ier
3140 
3141 !Local variables--------------
3142 #if defined HAVE_MPI
3143  integer :: status(MPI_STATUS_SIZE)
3144  integer :: tag,me
3145 #endif
3146 
3147 ! *************************************************************************
3148  ier=0
3149 #if defined HAVE_MPI
3150  if (sender==recever.or.spaceComm==xpaw_mpi_comm_null.or.(n1==0)) return
3151  call MPI_COMM_RANK(spaceComm,me,ier)
3152  tag = MOD(n1,xpaw_mpi_get_tag_ub(spaceComm))
3153  if (recever==me) then
3154    call MPI_RECV(vrecv,n1,MPI_INTEGER,sender,tag,spaceComm,status,ier)
3155  end if
3156  if (sender==me) then
3157    call MPI_SEND(vsend,n1,MPI_INTEGER,recever,tag,spaceComm,ier)
3158  end if
3159 #endif
3160 end subroutine xpaw_mpi_exch_int1d

ABINIT/xpaw_mpi_gather_dp1d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_gather_dp1d

FUNCTION

  MPI_GATHER for 1D double precision arrays

INPUTS

  xval= buffer array
  sendcont= number of sent elements
  recvcount= number of received elements
  root= rank of receiving process
  spaceComm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  recvbuf= received buffer

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

1954 subroutine xpaw_mpi_gather_dp1d(xval,sendcount,recvbuf,recvcount,root,spaceComm,ier)
1955 
1956 
1957 !This section has been created automatically by the script Abilint (TD).
1958 !Do not modify the following lines by hand.
1959 #undef ABI_FUNC
1960 #define ABI_FUNC 'xpaw_mpi_gather_dp1d'
1961 !End of the abilint section
1962 
1963  implicit none
1964 
1965 !Arguments-------------------------
1966  integer, intent(in) :: sendcount,recvcount
1967  real(dp), intent(in) :: xval(:)
1968  real(dp), intent(inout)   :: recvbuf(:)
1969  integer, intent(in) :: root,spaceComm
1970  integer, intent(out) :: ier
1971 
1972 ! *************************************************************************
1973  ier=0
1974 #if defined HAVE_MPI
1975  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
1976    call MPI_gather(xval,sendcount,MPI_DOUBLE_PRECISION,recvbuf,recvcount,MPI_DOUBLE_PRECISION,&
1977 &   root,spaceComm,ier)
1978  else if (spaceComm == xpaw_mpi_comm_self) then
1979    recvbuf=xval
1980  end if
1981 #else
1982  recvbuf=xval
1983 #endif
1984 end subroutine xpaw_mpi_gather_dp1d

ABINIT/xpaw_mpi_gather_dp2d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_gather_dp2d

FUNCTION

  MPI_GATHER for 2D double precision arrays

INPUTS

  xval= buffer array
  sendcont= number of sent elements
  recvcount= number of received elements
  root= rank of receiving process
  spaceComm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  recvbuf= received buffer

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

2014 subroutine xpaw_mpi_gather_dp2d(xval,sendcount,recvbuf,recvcount,root,spaceComm,ier)
2015 
2016 
2017 !This section has been created automatically by the script Abilint (TD).
2018 !Do not modify the following lines by hand.
2019 #undef ABI_FUNC
2020 #define ABI_FUNC 'xpaw_mpi_gather_dp2d'
2021 !End of the abilint section
2022 
2023  implicit none
2024 
2025 !Arguments-------------------------
2026  integer, intent(in) :: sendcount,recvcount
2027  real(dp), intent(in) :: xval(:,:)
2028  real(dp), intent(inout) :: recvbuf(:,:)
2029  integer, intent(in) :: root,spaceComm
2030  integer, intent(out)   :: ier
2031 
2032 ! *************************************************************************
2033  ier=0
2034 #if defined HAVE_MPI
2035  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
2036    call MPI_gather(xval,sendcount,MPI_DOUBLE_PRECISION,recvbuf,recvcount,MPI_DOUBLE_PRECISION,&
2037 &   root,spaceComm,ier)
2038  else if (spaceComm == xpaw_mpi_comm_self) then
2039    recvbuf=xval
2040  end if
2041 #else
2042  recvbuf=xval
2043 #endif
2044 end subroutine xpaw_mpi_gather_dp2d

ABINIT/xpaw_mpi_gather_int1d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_gather_int1d

FUNCTION

  MPI_GATHER for 1D integer arrays

INPUTS

  xval= buffer array
  sendcont= number of sent elements
  recvcount= number of received elements
  root= rank of receiving process
  spaceComm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  recvbuf= received buffer

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

1895 subroutine xpaw_mpi_gather_int1d(xval,sendcount,recvbuf,recvcount,root,spaceComm,ier)
1896 
1897 
1898 !This section has been created automatically by the script Abilint (TD).
1899 !Do not modify the following lines by hand.
1900 #undef ABI_FUNC
1901 #define ABI_FUNC 'xpaw_mpi_gather_int1d'
1902 !End of the abilint section
1903 
1904  implicit none
1905 
1906 !Arguments-------------------------
1907  integer, intent(in) :: sendcount,recvcount
1908  integer, intent(in) :: xval(:)
1909  integer, intent(inout) :: recvbuf(:)
1910  integer, intent(in) :: root,spaceComm
1911  integer, intent(out) :: ier
1912 
1913 ! *************************************************************************
1914  ier=0
1915 #if defined HAVE_MPI
1916  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
1917    call MPI_gather(xval,sendcount,MPI_INTEGER,recvbuf,recvcount,MPI_INTEGER,root,spaceComm,ier)
1918  else if (spaceComm == xpaw_mpi_comm_self) then
1919    recvbuf=xval
1920  end if
1921 #else
1922  recvbuf=xval
1923 #endif
1924 end subroutine xpaw_mpi_gather_int1d

ABINIT/xpaw_mpi_gatherv_dp1d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_gatherv_dp1d

FUNCTION

  MPI_GATHERV for 1D double precision arrays

INPUTS

  xval= buffer array
  recvcounts= number of received elements
  displs= relative offsets for incoming data
  nelem= number of elements
  root= rank of receiving process
  spaceComm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  recvbuf= received buffer

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

2143 subroutine xpaw_mpi_gatherv_dp1d(xval,nelem,recvbuf,recvcounts,displs,root,spaceComm,ier)
2144 
2145 
2146 !This section has been created automatically by the script Abilint (TD).
2147 !Do not modify the following lines by hand.
2148 #undef ABI_FUNC
2149 #define ABI_FUNC 'xpaw_mpi_gatherv_dp1d'
2150 !End of the abilint section
2151 
2152  implicit none
2153 
2154 !Arguments-------------------------
2155  real(dp), intent(in) :: xval(:)
2156  real(dp), intent(inout) :: recvbuf(:)
2157  integer, intent(in) :: recvcounts(:),displs(:)
2158  integer, intent(in) :: nelem,root,spaceComm
2159  integer, intent(out) :: ier
2160 
2161 !Local variables--------------
2162  integer :: cc,dd
2163 
2164 ! *************************************************************************
2165  ier=0
2166 #if defined HAVE_MPI
2167  if (spaceComm /=xpaw_mpi_comm_self .and. spaceComm /=xpaw_mpi_comm_null) then
2168    call MPI_gatherV(xval,nelem,MPI_DOUBLE_PRECISION,recvbuf,recvcounts,displs,&
2169 &   MPI_DOUBLE_PRECISION,root,spaceComm,ier)
2170  else if (spaceComm ==xpaw_mpi_comm_self) then
2171 #endif
2172    dd=0;if (size(displs)>0) dd=displs(1)
2173    cc=size(xval);if (size(recvcounts)>0) cc=recvcounts(1)
2174    recvbuf(dd+1:dd+cc)=xval(1:cc)
2175 #if defined HAVE_MPI
2176  end if
2177 #endif
2178 end subroutine xpaw_mpi_gatherv_dp1d

ABINIT/xpaw_mpi_gatherv_dp2d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_gatherv_dp2d

FUNCTION

  MPI_GATHERV for 2D double precision arrays

INPUTS

  xval= buffer array
  recvcounts= number of received elements
  displs= relative offsets for incoming data
  nelem= number of elements
  root= rank of receiving process
  spaceComm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  recvbuf= received buffer

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

2209 subroutine xpaw_mpi_gatherv_dp2d(xval,nelem,recvbuf,recvcounts,displs,root,spaceComm,ier)
2210 
2211 
2212 !This section has been created automatically by the script Abilint (TD).
2213 !Do not modify the following lines by hand.
2214 #undef ABI_FUNC
2215 #define ABI_FUNC 'xpaw_mpi_gatherv_dp2d'
2216 !End of the abilint section
2217 
2218  implicit none
2219 
2220 !Arguments-------------------------
2221  real(dp), intent(in) :: xval(:,:)
2222  real(dp), intent(inout) :: recvbuf(:,:)
2223  integer, intent(in) :: recvcounts(:),displs(:)
2224  integer, intent(in) :: nelem,root,spaceComm
2225  integer, intent(out) :: ier
2226 
2227 !Local variables--------------
2228  integer :: cc,dd,sz1
2229 
2230 ! *************************************************************************
2231  ier=0
2232 #if defined HAVE_MPI
2233  if (spaceComm /=xpaw_mpi_comm_self .and. spaceComm /=xpaw_mpi_comm_null) then
2234    call MPI_gatherV(xval,nelem,MPI_DOUBLE_PRECISION,recvbuf,recvcounts,displs,&
2235 &   MPI_DOUBLE_PRECISION,root,spaceComm,ier)
2236  else if (spaceComm ==xpaw_mpi_comm_self) then
2237 #endif
2238    sz1=size(xval,1)
2239    dd=0;if (size(displs)>0) dd=displs(1)/sz1
2240    cc=size(xval,2);if (size(recvcounts)>0) cc=recvcounts(1)/sz1
2241    recvbuf(:,dd+1:dd+cc)=xval(:,1:cc)
2242 #if defined HAVE_MPI
2243  end if
2244 #endif
2245 end subroutine xpaw_mpi_gatherv_dp2d

ABINIT/xpaw_mpi_gatherv_int1d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_gatherv_int1d

FUNCTION

  MPI_GATHERV for 1D integer arrays

INPUTS

  xval= buffer array
  recvcounts= number of received elements
  displs= relative offsets for incoming data
  nelem= number of elements
  root= rank of receiving process
  spaceComm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  recvbuf= received buffer

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

2077 subroutine xpaw_mpi_gatherv_int1d(xval,nelem,recvbuf,recvcounts,displs,root,spaceComm,ier)
2078 
2079 
2080 !This section has been created automatically by the script Abilint (TD).
2081 !Do not modify the following lines by hand.
2082 #undef ABI_FUNC
2083 #define ABI_FUNC 'xpaw_mpi_gatherv_int1d'
2084 !End of the abilint section
2085 
2086  implicit none
2087 
2088 !Arguments-------------------------
2089  integer, intent(in) :: xval(:)
2090  integer, intent(inout) :: recvbuf(:)
2091  integer, intent(in) :: recvcounts(:),displs(:)
2092  integer, intent(in) :: nelem,root,spaceComm
2093  integer, intent(out) :: ier
2094 
2095 !Local variables-------------------
2096  integer :: cc,dd
2097 
2098 ! *************************************************************************
2099  ier=0
2100 #if defined HAVE_MPI
2101  if (spaceComm /=xpaw_mpi_comm_self .and. spaceComm /=xpaw_mpi_comm_null) then
2102    call MPI_gatherV(xval,nelem,MPI_INTEGER,recvbuf,recvcounts,displs,&
2103 &   MPI_INTEGER,root,spaceComm,ier)
2104  else if (spaceComm ==xpaw_mpi_comm_self) then
2105 #endif
2106    dd=0;if (size(displs)>0) dd=displs(1)
2107    cc=size(xval);if (size(recvcounts)>0) cc=recvcounts(1)
2108    recvbuf(dd+1:dd+cc)=xval(1:cc)
2109 #if defined HAVE_MPI
2110  end if
2111 #endif
2112 end subroutine xpaw_mpi_gatherv_int1d

ABINIT/xpaw_mpi_get_tag_ub [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_get_tag_ub

FUNCTION

  Get MPI_TAG_UB attribute

INPUTS

  comm= MPI communicator

OUTPUT

  xpaw_mpi_get_tag_ub=value for the MPI_TAG_UB attribute attached to comm

PARENTS

CHILDREN

      mpi_attr_get

SOURCE

3717 function xpaw_mpi_get_tag_ub(comm)
3718 
3719 
3720 !This section has been created automatically by the script Abilint (TD).
3721 !Do not modify the following lines by hand.
3722 #undef ABI_FUNC
3723 #define ABI_FUNC 'xpaw_mpi_get_tag_ub'
3724 !End of the abilint section
3725 
3726  implicit none
3727 
3728 !Arguments-------------------------
3729  integer, intent(in) :: comm
3730  integer :: xpaw_mpi_get_tag_ub
3731 
3732 !Local variables-------------------
3733 #if defined HAVE_MPI
3734  integer :: attribute_val,ier
3735  logical :: lflag
3736 #endif
3737 
3738 ! *************************************************************************
3739 
3740 #if defined HAVE_MPI
3741  !Deprecated in MPI2 but not all MPI2 implementations provide MPI_Comm_get_attr !
3742  call MPI_ATTR_GET(comm,MPI_TAG_UB,attribute_val,lflag,ier)
3743 !call MPI_Comm_get_attr(comm MPI_TAG_UB,attribute_val,lflag,ier)
3744 
3745  if (lflag) xpaw_mpi_get_tag_ub = attribute_val
3746 
3747 #else
3748  xpaw_mpi_get_tag_ub=32767
3749 #endif
3750 
3751 end function xpaw_mpi_get_tag_ub

ABINIT/xpaw_mpi_irecv_dp1d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_irecv_dp1d

FUNCTION

  MPI_IRECV for 1D double precision arrays

INPUTS

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

OUTPUT

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

SIDE EFFECTS

  xval= buffer array

NOTES

  status of MPI_IRECV is explicitly ignored

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

2585 subroutine xpaw_mpi_irecv_dp1d(xval,source,tag,spaceComm,request,ierr)
2586 
2587 
2588 !This section has been created automatically by the script Abilint (TD).
2589 !Do not modify the following lines by hand.
2590 #undef ABI_FUNC
2591 #define ABI_FUNC 'xpaw_mpi_irecv_dp1d'
2592 !End of the abilint section
2593 
2594  implicit none
2595 
2596 !Arguments-------------------------
2597  real(dp), intent(inout) :: xval(:)
2598  integer, intent(in) :: source,tag,spaceComm
2599  integer, intent(out) :: request, ierr
2600 
2601 !Local variables-------------------
2602 #if defined HAVE_MPI
2603  integer :: ier,my_tag,n1
2604 #endif
2605 
2606 ! *************************************************************************
2607  ierr=0
2608 #if defined HAVE_MPI
2609  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
2610    n1=size(xval,dim=1)
2611    my_tag = MOD(tag,xpaw_mpi_get_tag_ub(spaceComm))
2612    call MPI_IRECV(xval,n1,MPI_DOUBLE_PRECISION,source,my_tag,spaceComm,request,ier)
2613    ierr=ier
2614  end if
2615 #endif
2616 end subroutine xpaw_mpi_irecv_dp1d

ABINIT/xpaw_mpi_irecv_dp2d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_irecv_dp2d

FUNCTION

  MPI_IRECV for 2D double precision arrays

INPUTS

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

OUTPUT

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

SIDE EFFECTS

  xval= buffer array

NOTES

  status of MPI_IRECV is explicitly ignored

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

2647 subroutine xpaw_mpi_irecv_dp2d(xval,source,tag,spaceComm,request,ierr)
2648 
2649 
2650 !This section has been created automatically by the script Abilint (TD).
2651 !Do not modify the following lines by hand.
2652 #undef ABI_FUNC
2653 #define ABI_FUNC 'xpaw_mpi_irecv_dp2d'
2654 !End of the abilint section
2655 
2656  implicit none
2657 
2658 !Arguments-------------------------
2659  real(dp), intent(inout) :: xval(:,:)
2660  integer, intent(in) :: source,tag,spaceComm
2661  integer, intent(out) :: request, ierr
2662 
2663 !Local variables-------------------
2664 #if defined HAVE_MPI
2665  integer :: ier,my_tag,n1,n2
2666 #endif
2667 
2668 ! *************************************************************************
2669  ierr=0
2670 #if defined HAVE_MPI
2671  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
2672    n1=size(xval,dim=1);n2=size(xval,dim=2)
2673    my_tag = MOD(tag,xpaw_mpi_get_tag_ub(spaceComm))
2674    call MPI_IRECV(xval,n1*n2,MPI_DOUBLE_PRECISION,source,my_tag,spaceComm,request,ier)
2675    ierr=ier
2676  end if
2677 #endif
2678 end subroutine xpaw_mpi_irecv_dp2d

ABINIT/xpaw_mpi_irecv_int1d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_irecv_int1d

FUNCTION

  MPI_IRECV for 1D integer arrays

INPUTS

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

OUTPUT

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

 SIDE EFFETS
  xval= buffer array

NOTES

  status of MPI_IRECV is explicitly ignored

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

2524 subroutine xpaw_mpi_irecv_int1d(xval,source,tag,spaceComm,request,ierr)
2525 
2526 
2527 !This section has been created automatically by the script Abilint (TD).
2528 !Do not modify the following lines by hand.
2529 #undef ABI_FUNC
2530 #define ABI_FUNC 'xpaw_mpi_irecv_int1d'
2531 !End of the abilint section
2532 
2533  implicit none
2534 
2535 !Arguments-------------------------
2536  integer, intent(inout) :: xval(:)
2537  integer, intent(in) :: source,tag,spaceComm
2538  integer, intent(out) :: request,ierr
2539 !Local variables-------------------
2540 #if defined HAVE_MPI
2541   integer :: ier,n1,my_tag
2542 #endif
2543 
2544 ! *************************************************************************
2545  ierr=0
2546 #if defined HAVE_MPI
2547  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
2548    n1=size(xval)
2549    my_tag = MOD(tag,xpaw_mpi_get_tag_ub(spaceComm))
2550    call MPI_IRECV(xval,n1,MPI_INTEGER,source,my_tag,spaceComm,request,ier)
2551    ierr=ier
2552  end if
2553 #endif
2554  end subroutine xpaw_mpi_irecv_int1d

ABINIT/xpaw_mpi_isend_dp1d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_isend_dp1d

FUNCTION

  MPI_ISEND for 1D double precision arrays

INPUTS

  dest= rank of destination process
  tag= integer message tag
  spaceComm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  xval= buffer array

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

3001 subroutine xpaw_mpi_isend_dp1d(xval,dest,tag,spaceComm,request,ierr)
3002 
3003 
3004 !This section has been created automatically by the script Abilint (TD).
3005 !Do not modify the following lines by hand.
3006 #undef ABI_FUNC
3007 #define ABI_FUNC 'xpaw_mpi_isend_dp1d'
3008 !End of the abilint section
3009 
3010  implicit none
3011 
3012 !Arguments-------------------------
3013  real(dp), intent(inout) :: xval(:)
3014  integer, intent(in) :: dest,tag,spaceComm
3015  integer, intent(out) :: request,ierr
3016 
3017 !Local variables-------------------
3018 #if defined HAVE_MPI
3019  integer :: ier,my_tag,n1
3020 #endif
3021 
3022 ! *************************************************************************
3023  ierr=0
3024 #if defined HAVE_MPI
3025  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
3026    n1=size(xval,dim=1)
3027    my_tag = MOD(tag,xpaw_mpi_get_tag_ub(spaceComm))
3028    call MPI_ISEND(xval,n1,MPI_DOUBLE_PRECISION,dest,my_tag,spaceComm,request,ier)
3029    ierr=ier
3030  end if
3031 #endif
3032 end subroutine xpaw_mpi_isend_dp1d

ABINIT/xpaw_mpi_isend_dp2d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_isend_dp2d

FUNCTION

  MPI_ISEND for 2D double precision arrays

INPUTS

  dest= rank of destination process
  tag= integer message tag
  spaceComm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  xval= buffer array

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

3060 subroutine xpaw_mpi_isend_dp2d(xval,dest,tag,spaceComm,request,ierr)
3061 
3062 
3063 !This section has been created automatically by the script Abilint (TD).
3064 !Do not modify the following lines by hand.
3065 #undef ABI_FUNC
3066 #define ABI_FUNC 'xpaw_mpi_isend_dp2d'
3067 !End of the abilint section
3068 
3069  implicit none
3070 
3071 !Arguments-------------------------
3072  real(dp), intent(inout) :: xval(:,:)
3073  integer, intent(in) :: dest,tag,spaceComm
3074  integer, intent(out) :: request,ierr
3075 
3076 !Local variables-------------------
3077 #if defined HAVE_MPI
3078  integer :: ier,my_tag,n1,n2
3079 #endif
3080 
3081 ! *************************************************************************
3082  ierr=0
3083 #if defined HAVE_MPI
3084  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
3085    n1=size(xval,dim=1) ; n1=size(xval,dim=2)
3086    my_tag = MOD(tag,xpaw_mpi_get_tag_ub(spaceComm))
3087    call MPI_ISEND(xval,n1*n2,MPI_DOUBLE_PRECISION,dest,my_tag,spaceComm,request,ier)
3088    ierr=ier
3089  end if
3090 #endif
3091 end subroutine xpaw_mpi_isend_dp2d

ABINIT/xpaw_mpi_isend_int1d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_isend_int1d

FUNCTION

  MPI_ISEND for 1D integer arrays

INPUTS

  dest= rank of destination process
  tag= integer message tag
  spaceComm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  xval= buffer array

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

2942 subroutine xpaw_mpi_isend_int1d(xval,dest,tag,spaceComm,request,ierr)
2943 
2944 
2945 !This section has been created automatically by the script Abilint (TD).
2946 !Do not modify the following lines by hand.
2947 #undef ABI_FUNC
2948 #define ABI_FUNC 'xpaw_mpi_isend_int1d'
2949 !End of the abilint section
2950 
2951  implicit none
2952 
2953 !Arguments-------------------------
2954  integer, intent(inout) :: xval(:)
2955  integer, intent(in) :: dest,tag,spaceComm
2956  integer, intent(out) :: request,ierr
2957 
2958 !Local variables-------------------
2959 #if defined HAVE_MPI
2960  integer :: ier,my_tag,n1
2961 #endif
2962 
2963 ! *************************************************************************
2964  ierr=0
2965 #if defined HAVE_MPI
2966  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
2967    n1=size(xval,dim=1)
2968    my_tag = MOD(tag,xpaw_mpi_get_tag_ub(spaceComm))
2969    call MPI_ISEND(xval,n1,MPI_INTEGER,dest,my_tag,spaceComm,request,ier)
2970    ierr=ier
2971  end if
2972 #endif
2973  end subroutine xpaw_mpi_isend_int1d

ABINIT/xpaw_mpi_recv_dp1d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_recv_dp1d

FUNCTION

  MPI_RECV for 1D double precision arrays

INPUTS

  source :: rank of source process
  tag :: integer message tag
  spaceComm :: 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_allreduce,mpi_comm_size

SOURCE

2339 subroutine xpaw_mpi_recv_dp1d(xval,source,tag,spaceComm,ier)
2340 
2341 
2342 !This section has been created automatically by the script Abilint (TD).
2343 !Do not modify the following lines by hand.
2344 #undef ABI_FUNC
2345 #define ABI_FUNC 'xpaw_mpi_recv_dp1d'
2346 !End of the abilint section
2347 
2348  implicit none
2349 
2350 !Arguments-------------------------
2351  real(dp), intent(inout) :: xval(:)
2352  integer, intent(in) :: source,tag,spaceComm
2353  integer, intent(out) :: ier
2354 
2355 !Local variables-------------------
2356 #if defined HAVE_MPI
2357  integer :: n1,my_tag
2358 #endif
2359 
2360 ! *************************************************************************
2361  ier=0
2362 #if defined HAVE_MPI
2363  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
2364    n1=size(xval,dim=1)
2365    my_tag = MOD(tag,xpaw_mpi_get_tag_ub(spaceComm))
2366    call MPI_RECV(xval,n1,MPI_DOUBLE_PRECISION,source,my_tag,spaceComm,MPI_STATUS_IGNORE,ier)
2367  end if
2368 #endif
2369 end subroutine xpaw_mpi_recv_dp1d

ABINIT/xpaw_mpi_recv_dp2d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_recv_dp2d

FUNCTION

  MPI_RECV for 2D double precision arrays

INPUTS

  source :: rank of source process
  tag :: integer message tag
  spaceComm :: 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_allreduce,mpi_comm_size

SOURCE

2400 subroutine xpaw_mpi_recv_dp2d(xval,source,tag,spaceComm,ier)
2401 
2402 
2403 !This section has been created automatically by the script Abilint (TD).
2404 !Do not modify the following lines by hand.
2405 #undef ABI_FUNC
2406 #define ABI_FUNC 'xpaw_mpi_recv_dp2d'
2407 !End of the abilint section
2408 
2409  implicit none
2410 
2411 !Arguments-------------------------
2412  real(dp), intent(inout) :: xval(:,:)
2413  integer, intent(in) :: source,tag,spaceComm
2414  integer, intent(out) :: ier
2415 
2416 !Local variables-------------------
2417 #if defined HAVE_MPI
2418  integer :: n1,n2,my_tag
2419 #endif
2420 
2421 ! *************************************************************************
2422  ier=0
2423 #if defined HAVE_MPI
2424  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
2425    n1=size(xval,dim=1) ; n2=size(xval,dim=2)
2426    my_tag = MOD(tag,xpaw_mpi_get_tag_ub(spaceComm))
2427    call MPI_RECV(xval,n1*n2,MPI_DOUBLE_PRECISION,source,my_tag,spaceComm,MPI_STATUS_IGNORE,ier)
2428  end if
2429 #endif
2430 end subroutine xpaw_mpi_recv_dp2d

ABINIT/xpaw_mpi_recv_dp3d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_recv_dp3d

FUNCTION

  MPI_RECV for 3D double precision arrays

INPUTS

  source :: rank of source process
  tag :: integer message tag
  spaceComm :: 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_allreduce,mpi_comm_size

SOURCE

2461 subroutine xpaw_mpi_recv_dp3d(xval,source,tag,spaceComm,ier)
2462 
2463 
2464 !This section has been created automatically by the script Abilint (TD).
2465 !Do not modify the following lines by hand.
2466 #undef ABI_FUNC
2467 #define ABI_FUNC 'xpaw_mpi_recv_dp3d'
2468 !End of the abilint section
2469 
2470  implicit none
2471 
2472 !Arguments-------------------------
2473  real(dp), intent(inout) :: xval(:,:,:)
2474  integer, intent(in) :: source,tag,spaceComm
2475  integer, intent(out) :: ier
2476 
2477 !Local variables-------------------
2478 #if defined HAVE_MPI
2479  integer :: n1,n2,n3,my_tag
2480 #endif
2481 
2482 ! *************************************************************************
2483  ier=0
2484 #if defined HAVE_MPI
2485  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
2486    n1=size(xval,dim=1) ; n2=size(xval,dim=2) ; n3=size(xval,dim=3)
2487    my_tag = MOD(tag,xpaw_mpi_get_tag_ub(spaceComm))
2488    call MPI_RECV(xval,n1*n2*n3,MPI_DOUBLE_PRECISION,source,my_tag,spaceComm,MPI_STATUS_IGNORE,ier)
2489  end if
2490 #endif
2491 end subroutine xpaw_mpi_recv_dp3d

ABINIT/xpaw_mpi_recv_int1d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_recv_int1d

FUNCTION

  MPI_RECV for 1D integer arrays

INPUTS

  source :: rank of source process
  tag :: integer message tag
  spaceComm :: 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_allreduce,mpi_comm_size

SOURCE

2278 subroutine xpaw_mpi_recv_int1d(xval,source,tag,spaceComm,ier)
2279 
2280 
2281 !This section has been created automatically by the script Abilint (TD).
2282 !Do not modify the following lines by hand.
2283 #undef ABI_FUNC
2284 #define ABI_FUNC 'xpaw_mpi_recv_int1d'
2285 !End of the abilint section
2286 
2287  implicit none
2288 
2289 !Arguments-------------------------
2290  integer, intent(inout) :: xval(:)
2291  integer, intent(in) :: source,tag,spaceComm
2292  integer, intent(out) :: ier
2293 
2294 !Local variables-------------------
2295 #if defined HAVE_MPI
2296  integer :: my_tag, n1
2297 #endif
2298 
2299 ! *************************************************************************
2300  ier=0
2301 #if defined HAVE_MPI
2302  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
2303    n1=size(xval,dim=1)
2304    my_tag = MOD(tag,xpaw_mpi_get_tag_ub(spaceComm))
2305    call MPI_RECV(xval,n1,MPI_INTEGER,source,my_tag,spaceComm,MPI_STATUS_IGNORE,ier)
2306  end if
2307 #endif
2308  end subroutine xpaw_mpi_recv_int1d

ABINIT/xpaw_mpi_scatterv_dp1d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_scatterv_dp1d

FUNCTION

  MPI_SCATTERV for 1D double precision arrays

INPUTS

  xval= buffer array
  recvcount= number of received elements
  displs= relative offsets for incoming data (array)
  sendcounts= number of sent elements (array)
  root= rank of receiving process
  spaceComm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  recvbuf= received buffer

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

1100 subroutine xpaw_mpi_scatterv_dp1d(xval,sendcounts,displs,recvbuf,recvcount,root,spaceComm,ier)
1101 
1102 
1103 !This section has been created automatically by the script Abilint (TD).
1104 !Do not modify the following lines by hand.
1105 #undef ABI_FUNC
1106 #define ABI_FUNC 'xpaw_mpi_scatterv_dp1d'
1107 !End of the abilint section
1108 
1109  implicit none
1110 
1111 !Arguments-------------------------
1112  real(dp), intent(in) :: xval(:)
1113  real(dp), intent(inout)   :: recvbuf(:)
1114  integer, intent(in) :: sendcounts(:),displs(:)
1115  integer, intent(in) :: recvcount,root,spaceComm
1116  integer, intent(out) :: ier
1117 
1118 !Local variables-------------------
1119  integer :: dd
1120 
1121 ! *************************************************************************
1122  ier=0
1123 #if defined HAVE_MPI
1124  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
1125    call MPI_SCATTERV(xval,sendcounts,displs,MPI_DOUBLE_PRECISION,recvbuf,recvcount,&
1126 &   MPI_DOUBLE_PRECISION,root,spaceComm,ier)
1127  else if (spaceComm == xpaw_mpi_comm_self) then
1128 #endif
1129    dd=0;if (size(displs)>0) dd=displs(1)
1130    recvbuf(1:recvcount)=xval(dd+1:dd+recvcount)
1131 #if defined HAVE_MPI
1132  end if
1133 #endif
1134 end subroutine xpaw_mpi_scatterv_dp1d

ABINIT/xpaw_mpi_scatterv_dp2d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_scatterv_dp2d

FUNCTION

  MPI_SCATTERV for 2D double precision arrays

INPUTS

  xval= buffer array
  recvcount= number of received elements
  displs= relative offsets for incoming data (array)
  sendcounts= number of sent elements (array)
  root= rank of receiving process
  spaceComm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  recvbuf= received buffer

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

1165 subroutine xpaw_mpi_scatterv_dp2d(xval,sendcounts,displs,recvbuf,recvcount,root,spaceComm,ier)
1166 
1167 
1168 !This section has been created automatically by the script Abilint (TD).
1169 !Do not modify the following lines by hand.
1170 #undef ABI_FUNC
1171 #define ABI_FUNC 'xpaw_mpi_scatterv_dp2d'
1172 !End of the abilint section
1173 
1174  implicit none
1175 
1176 !Arguments-------------------------
1177  real(dp), intent(in) :: xval(:,:)
1178  real(dp), intent(inout)   :: recvbuf(:,:)
1179  integer, intent(in) :: sendcounts(:),displs(:)
1180  integer, intent(in) :: recvcount,root,spaceComm
1181  integer, intent(out) :: ier
1182 
1183 !Local variables-------------------
1184  integer :: cc,dd,sz1 
1185 
1186 ! *************************************************************************
1187  ier=0
1188 #if defined HAVE_MPI
1189  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
1190    call MPI_SCATTERV(xval,sendcounts,displs,MPI_DOUBLE_PRECISION,recvbuf,recvcount,&
1191 &   MPI_DOUBLE_PRECISION,root,spaceComm,ier)
1192  else if (spaceComm == xpaw_mpi_comm_self) then
1193 #endif
1194    sz1=size(recvbuf,1);cc=recvcount/sz1
1195    dd=0;if (size(displs)>0) dd=displs(1)/sz1
1196    recvbuf(:,1:cc)=xval(:,dd+1:dd+cc)
1197 #if defined HAVE_MPI
1198  end if
1199 #endif
1200 end subroutine xpaw_mpi_scatterv_dp2d

ABINIT/xpaw_mpi_scatterv_int1d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_scatterv_int1d

FUNCTION

  MPI_SCATTERV for 1D integer arrays

INPUTS

  xval= buffer array
  recvcount= number of received elements
  displs= relative offsets for incoming data (array)
  sendcounts= number of sent elements (array)
  root= rank of receiving process
  spaceComm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  recvbuf= received buffer

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

1035 subroutine xpaw_mpi_scatterv_int1d(xval,sendcounts,displs,recvbuf,recvcount,root,spaceComm,ier)
1036 
1037 
1038 !This section has been created automatically by the script Abilint (TD).
1039 !Do not modify the following lines by hand.
1040 #undef ABI_FUNC
1041 #define ABI_FUNC 'xpaw_mpi_scatterv_int1d'
1042 !End of the abilint section
1043 
1044  implicit none
1045 
1046 !Arguments-------------------------
1047  integer, intent(in) :: xval(:)
1048  integer, intent(inout) :: recvbuf(:)
1049  integer, intent(in) :: sendcounts(:),displs(:)
1050  integer, intent(in) :: recvcount,root,spaceComm
1051  integer, intent(out) :: ier
1052 
1053 !Local variables-------------------
1054  integer :: dd
1055 
1056 ! *************************************************************************
1057  ier=0
1058 #if defined HAVE_MPI
1059  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
1060    call MPI_SCATTERV(xval,sendcounts,displs,MPI_INTEGER,recvbuf,recvcount,&
1061 &   MPI_INTEGER,root,spaceComm,ier)
1062  else if (spaceComm == xpaw_mpi_comm_self) then
1063 #endif
1064    dd=0;if (size(displs)>0) dd=displs(1)
1065    recvbuf(1:recvcount)=xval(dd+1:dd+recvcount)
1066 #if defined HAVE_MPI
1067  end if
1068 #endif
1069 end subroutine xpaw_mpi_scatterv_int1d

ABINIT/xpaw_mpi_send_dp1d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_send_dp1d

FUNCTION

  MPI_SEND for 1D double precision arrays

INPUTS

  dest= rank of destination process
  tag= integer message tag
  spaceComm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  xval= buffer array

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

2766 subroutine xpaw_mpi_send_dp1d(xval,dest,tag,spaceComm,ier)
2767 
2768 
2769 !This section has been created automatically by the script Abilint (TD).
2770 !Do not modify the following lines by hand.
2771 #undef ABI_FUNC
2772 #define ABI_FUNC 'xpaw_mpi_send_dp1d'
2773 !End of the abilint section
2774 
2775  implicit none
2776 
2777 !Arguments-------------------------
2778  real(dp), intent(inout) :: xval(:)
2779  integer, intent(in) :: dest,tag,spaceComm
2780  integer, intent(out) :: ier
2781 
2782 !Local variables-------------------
2783 #if defined HAVE_MPI
2784  integer :: n1,my_tag
2785 #endif
2786 
2787 ! *************************************************************************
2788  ier=0
2789 #if defined HAVE_MPI
2790  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
2791    n1=size(xval,dim=1)
2792    my_tag = MOD(tag,xpaw_mpi_get_tag_ub(spaceComm))
2793    call MPI_SEND(xval,n1,MPI_DOUBLE_PRECISION,dest,my_tag,spaceComm,ier)
2794  end if
2795 #endif
2796 end subroutine xpaw_mpi_send_dp1d

ABINIT/xpaw_mpi_send_dp2d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_send_dp2d

FUNCTION

  MPI_SEND for 2D double precision arrays

INPUTS

  dest= rank of destination process
  tag= integer message tag
  spaceComm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  xval= buffer array

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

2824 subroutine xpaw_mpi_send_dp2d(xval,dest,tag,spaceComm,ier)
2825 
2826 
2827 !This section has been created automatically by the script Abilint (TD).
2828 !Do not modify the following lines by hand.
2829 #undef ABI_FUNC
2830 #define ABI_FUNC 'xpaw_mpi_send_dp2d'
2831 !End of the abilint section
2832 
2833  implicit none
2834 
2835 !Arguments-------------------------
2836  real(dp), intent(inout) :: xval(:,:)
2837  integer, intent(in) :: dest,tag,spaceComm
2838  integer, intent(out) :: ier
2839 
2840 !Local variables-------------------
2841 #if defined HAVE_MPI
2842  integer :: n1,n2,my_tag
2843 #endif
2844 
2845 ! *************************************************************************
2846  ier=0
2847 #if defined HAVE_MPI
2848  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
2849    n1=size(xval,dim=1) ; n2=size(xval,dim=2)
2850    my_tag = MOD(tag,xpaw_mpi_get_tag_ub(spaceComm))
2851    call MPI_SEND(xval,n1*n2,MPI_DOUBLE_PRECISION,dest,my_tag,spaceComm,ier)
2852  end if
2853 #endif
2854 end subroutine xpaw_mpi_send_dp2d

ABINIT/xpaw_mpi_send_dp3d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_send_dp3d

FUNCTION

  MPI_SEND for 3D double precision arrays

INPUTS

  dest= rank of destination process
  tag= integer message tag
  spaceComm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  xval= buffer array

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

2882 subroutine xpaw_mpi_send_dp3d(xval,dest,tag,spaceComm,ier)
2883 
2884 
2885 !This section has been created automatically by the script Abilint (TD).
2886 !Do not modify the following lines by hand.
2887 #undef ABI_FUNC
2888 #define ABI_FUNC 'xpaw_mpi_send_dp3d'
2889 !End of the abilint section
2890 
2891  implicit none
2892 
2893 !Arguments-------------------------
2894  real(dp), intent(inout) :: xval(:,:,:)
2895  integer, intent(in) :: dest,tag,spaceComm
2896  integer, intent(out) :: ier
2897 
2898 !Local variables-------------------
2899 #if defined HAVE_MPI
2900  integer :: n1,n2,n3,my_tag
2901 #endif
2902 
2903 ! *************************************************************************
2904  ier=0
2905 #if defined HAVE_MPI
2906  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
2907    n1=size(xval,dim=1) ; n2=size(xval,dim=2) ; n3=size(xval,dim=3)
2908    my_tag = MOD(tag,xpaw_mpi_get_tag_ub(spaceComm))
2909    call MPI_SEND(xval,n1*n2*n3,MPI_DOUBLE_PRECISION,dest,my_tag,spaceComm,ier)
2910  end if
2911 #endif
2912 end subroutine xpaw_mpi_send_dp3d

ABINIT/xpaw_mpi_send_int1d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_send_int1d

FUNCTION

  MPI_ISEND for 1D integer arrays

INPUTS

  dest= rank of destination process
  tag= integer message tag
  spaceComm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  xval= buffer array

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

2708 subroutine xpaw_mpi_send_int1d(xval,dest,tag,spaceComm,ier)
2709 
2710 
2711 !This section has been created automatically by the script Abilint (TD).
2712 !Do not modify the following lines by hand.
2713 #undef ABI_FUNC
2714 #define ABI_FUNC 'xpaw_mpi_send_int1d'
2715 !End of the abilint section
2716 
2717  implicit none
2718 
2719 !Arguments-------------------------
2720  integer, intent(inout) :: xval(:)
2721  integer, intent(in) :: dest,tag,spaceComm
2722  integer, intent(out) :: ier
2723 
2724 !Local variables-------------------
2725 #if defined HAVE_MPI
2726  integer :: my_tag, n1
2727 #endif
2728 
2729 ! *************************************************************************
2730  ier=0
2731 #if defined HAVE_MPI
2732  if (spaceComm /= xpaw_mpi_comm_self .and. spaceComm /= xpaw_mpi_comm_null) then
2733    n1=size(xval,dim=1)
2734    my_tag = MOD(tag,xpaw_mpi_get_tag_ub(spaceComm))
2735    call MPI_SEND(xval,n1,MPI_INTEGER,dest,my_tag,spaceComm,ier)
2736  end if
2737 #endif
2738  end subroutine xpaw_mpi_send_int1d

ABINIT/xpaw_mpi_sum_dp1d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_sum_dp1d

FUNCTION

  MPI_ALLREDUCE(SUM) for 1D double precision arrays

INPUTS

  comm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  xval= buffer array

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

3520 subroutine xpaw_mpi_sum_dp1d(xval,comm,ier)
3521 
3522 
3523 !This section has been created automatically by the script Abilint (TD).
3524 !Do not modify the following lines by hand.
3525 #undef ABI_FUNC
3526 #define ABI_FUNC 'xpaw_mpi_sum_dp1d'
3527 !End of the abilint section
3528 
3529  implicit none
3530 
3531 !Arguments-------------------------
3532  real(dp), intent(inout) :: xval(:)
3533  integer, intent(in) :: comm
3534  integer, intent(out) :: ier
3535 
3536 !Local variables-------------------
3537 #if defined HAVE_MPI
3538  integer :: n1,nproc
3539 #if !defined HAVE_MPI2 || !defined HAVE_MPI2_INPLACE
3540  real(dp) :: xsum(size(xval,dim=1))
3541 #endif
3542 #endif
3543 
3544 ! *************************************************************************
3545  ier=0
3546 #if defined HAVE_MPI
3547  if (comm /= xpaw_mpi_comm_self .and. comm /= xpaw_mpi_comm_null) then
3548    call MPI_COMM_SIZE(comm,nproc,ier)
3549    if (nproc /= 1) then
3550      n1=size(xval,dim=1)
3551 #if defined HAVE_MPI2 && defined HAVE_MPI2_INPLACE
3552      call MPI_ALLREDUCE(MPI_IN_PLACE,xval,n1,MPI_DOUBLE_PRECISION,MPI_SUM,comm,ier)
3553 #else
3554      call MPI_ALLREDUCE(xval,xsum,n1,MPI_DOUBLE_PRECISION,MPI_SUM,comm,ier)
3555      xval(:)=xsum(:)
3556 #endif
3557    end if
3558  end if
3559 #endif
3560 end subroutine xpaw_mpi_sum_dp1d

ABINIT/xpaw_mpi_sum_dp2d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_sum_dp2d

FUNCTION

  MPI_ALLREDUCE(SUM) for 2D double precision arrays

INPUTS

  comm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  xval= buffer array

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

3586 subroutine xpaw_mpi_sum_dp2d(xval,comm,ier)
3587 
3588 
3589 !This section has been created automatically by the script Abilint (TD).
3590 !Do not modify the following lines by hand.
3591 #undef ABI_FUNC
3592 #define ABI_FUNC 'xpaw_mpi_sum_dp2d'
3593 !End of the abilint section
3594 
3595  implicit none
3596 
3597 !Arguments-------------------------
3598  real(dp), intent(inout) :: xval(:,:)
3599  integer, intent(in) :: comm
3600  integer, intent(out) :: ier
3601 
3602 !Local variables-------------------
3603 #if defined HAVE_MPI
3604  integer :: n1,n2,nproc
3605 #if !defined HAVE_MPI2 || !defined HAVE_MPI2_INPLACE
3606  real(dp) :: xsum(size(xval,dim=1),size(xval,dim=2))
3607 #endif
3608 #endif
3609 
3610 ! *************************************************************************
3611  ier=0
3612 #if defined HAVE_MPI
3613  if (comm /= xpaw_mpi_comm_self .and. comm /= xpaw_mpi_comm_null) then
3614    call MPI_COMM_SIZE(comm,nproc,ier)
3615    if (nproc /= 1) then
3616      n1=size(xval,dim=1) ; n2=size(xval,dim=2)
3617 #if defined HAVE_MPI2 && defined HAVE_MPI2_INPLACE
3618      call MPI_ALLREDUCE(MPI_IN_PLACE,xval,n1*n2,MPI_DOUBLE_PRECISION,MPI_SUM,comm,ier)
3619 #else
3620      call MPI_ALLREDUCE(xval,xsum,n1*n2,MPI_DOUBLE_PRECISION,MPI_SUM,comm,ier)
3621      xval(:,:)=xsum(:,:)
3622 #endif
3623    end if
3624  end if
3625 #endif
3626 end subroutine xpaw_mpi_sum_dp2d

ABINIT/xpaw_mpi_sum_dp3d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_sum_dp3d

FUNCTION

  MPI_ALLREDUCE(SUM) for 3D double precision arrays

INPUTS

  comm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  xval= buffer array

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

3652 subroutine xpaw_mpi_sum_dp3d(xval,comm,ier)
3653 
3654 
3655 !This section has been created automatically by the script Abilint (TD).
3656 !Do not modify the following lines by hand.
3657 #undef ABI_FUNC
3658 #define ABI_FUNC 'xpaw_mpi_sum_dp3d'
3659 !End of the abilint section
3660 
3661  implicit none
3662 
3663 !Arguments-------------------------
3664  real(dp), intent(inout) :: xval(:,:,:)
3665  integer, intent(in) :: comm
3666  integer, intent(out) :: ier
3667 
3668 !Local variables-------------------
3669 #if defined HAVE_MPI
3670  integer :: n1,n2,n3,nproc
3671 #if !defined HAVE_MPI2 || !defined HAVE_MPI2_INPLACE
3672  real(dp) :: xsum(size(xval,dim=1),size(xval,dim=2),size(xval,dim=3))
3673 #endif
3674 #endif
3675 
3676 ! *************************************************************************
3677  ier=0
3678 #if defined HAVE_MPI
3679  if (comm /= xpaw_mpi_comm_self .and. comm /= xpaw_mpi_comm_null) then
3680    call MPI_COMM_SIZE(comm,nproc,ier)
3681    if (nproc /= 1) then
3682      n1=size(xval,dim=1) ; n2=size(xval,dim=2) ; n3=size(xval,dim=3)
3683 #if defined HAVE_MPI2 && defined HAVE_MPI2_INPLACE
3684      call MPI_ALLREDUCE(MPI_IN_PLACE,xval,n1*n2*n3,MPI_DOUBLE_PRECISION,MPI_SUM,comm,ier)
3685 #else
3686      call MPI_ALLREDUCE(xval,xsum,n1*n2*n3,MPI_DOUBLE_PRECISION,MPI_SUM,comm,ier)
3687      xval(:,:,:)=xsum(:,:,:)
3688 #endif
3689    end if
3690  end if
3691 #endif
3692 end subroutine xpaw_mpi_sum_dp3d

ABINIT/xpaw_mpi_sum_int [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_sum_int

FUNCTION

  MPI_ALLREDUCE(SUM) for integers

INPUTS

  comm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  xval= buffer

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

3389 subroutine xpaw_mpi_sum_int(xval,comm,ier)
3390 
3391 
3392 !This section has been created automatically by the script Abilint (TD).
3393 !Do not modify the following lines by hand.
3394 #undef ABI_FUNC
3395 #define ABI_FUNC 'xpaw_mpi_sum_int'
3396 !End of the abilint section
3397 
3398  implicit none
3399 
3400 !Arguments-------------------------
3401  integer, intent(inout) :: xval
3402  integer, intent(in) :: comm
3403  integer, intent(out) :: ier
3404 
3405 !Local variables-------------------
3406 #if defined HAVE_MPI
3407  integer :: nproc
3408 #if !defined HAVE_MPI2 || !defined HAVE_MPI2_INPLACE
3409  integer :: xsum
3410 #endif
3411 #endif
3412 
3413 ! *************************************************************************
3414  ier=0
3415 #if defined HAVE_MPI
3416  if (comm /= xpaw_mpi_comm_self .and. comm /= xpaw_mpi_comm_null) then
3417    call MPI_COMM_SIZE(comm,nproc,ier)
3418    if (nproc /= 1) then
3419 #if defined HAVE_MPI2 && defined HAVE_MPI2_INPLACE
3420      call MPI_ALLREDUCE(MPI_IN_PLACE,xval,1,MPI_INTEGER,MPI_SUM,comm,ier)
3421 #else
3422      call MPI_ALLREDUCE(xval,xsum,1,MPI_INTEGER,MPI_SUM,comm,ier)
3423      xval=xsum
3424 #endif
3425    end if
3426  end if
3427 #endif
3428 end subroutine xpaw_mpi_sum_int

ABINIT/xpaw_mpi_sum_int1d [ Functions ]

[ Top ] [ Functions ]

NAME

  xpaw_mpi_sum_int1d

FUNCTION

  MPI_ALLREDUCE(SUM) for 1D integer arrays

INPUTS

  comm= MPI communicator

OUTPUT

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

SIDE EFFECTS

  xval= buffer array

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

3454 subroutine xpaw_mpi_sum_int1d(xval,comm,ier)
3455 
3456 
3457 !This section has been created automatically by the script Abilint (TD).
3458 !Do not modify the following lines by hand.
3459 #undef ABI_FUNC
3460 #define ABI_FUNC 'xpaw_mpi_sum_int1d'
3461 !End of the abilint section
3462 
3463  implicit none
3464 
3465 !Arguments-------------------------
3466  integer, intent(inout) :: xval(:)
3467  integer, intent(in) :: comm
3468  integer, intent(out) :: ier
3469 
3470 !Local variables-------------------
3471 #if defined HAVE_MPI
3472  integer :: n1,nproc
3473 #if !defined HAVE_MPI2 || !defined HAVE_MPI2_INPLACE
3474  integer :: xsum(size(xval,dim=1))
3475 #endif
3476 #endif
3477 
3478 ! *************************************************************************
3479  ier=0
3480 #if defined HAVE_MPI
3481  if (comm /= xpaw_mpi_comm_self .and. comm /= xpaw_mpi_comm_null) then
3482    call MPI_COMM_SIZE(comm,nproc,ier)
3483    if (nproc /= 1) then
3484      n1=size(xval,dim=1)
3485 #if defined HAVE_MPI2 && defined HAVE_MPI2_INPLACE
3486      call MPI_ALLREDUCE(MPI_IN_PLACE,xval,n1,MPI_INTEGER,MPI_SUM,comm,ier)
3487 #else
3488      call MPI_ALLREDUCE(xval,xsum,n1,MPI_INTEGER,MPI_SUM,comm,ier)
3489      xval(:)=xsum(:)
3490 #endif
3491    end if
3492  end if
3493 #endif
3494 end subroutine xpaw_mpi_sum_int1d

m_libpaw_mpi/xpaw_mpi_abort [ Functions ]

[ Top ] [ m_libpaw_mpi ] [ Functions ]

NAME

  xpaw_mpi_abort

FUNCTION

  Wrapper for MPI_ABORT

INPUTS

  [comm]=communicator of tasks to abort.
  [mpierr]=Error code to return to invoking environment.
  [msg]=User message
  [exit_status]=optional, shell return code, default 1

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

207 subroutine xpaw_mpi_abort(comm,mpierr,msg,exit_status)
208 
209 
210 !This section has been created automatically by the script Abilint (TD).
211 !Do not modify the following lines by hand.
212 #undef ABI_FUNC
213 #define ABI_FUNC 'xpaw_mpi_abort'
214 !End of the abilint section
215 
216  implicit none
217 
218 !Arguments-------------------------
219  integer,optional,intent(in) :: comm,mpierr,exit_status
220  character(len=*),optional,intent(in) :: msg
221 
222 !Local variables-------------------
223  integer :: ilen,ierr,ierr2,my_comm,my_errorcode,my_exit_status
224  logical :: testopen
225 #ifdef HAVE_MPI
226  character(len=MPI_MAX_ERROR_STRING) :: mpi_msg_error
227 #endif
228 
229 ! *************************************************************************
230 
231  ierr=0
232  my_comm = xpaw_mpi_world; if (PRESENT(comm)) my_comm = comm
233  my_exit_status = 1; if (PRESENT(exit_status)) my_exit_status=exit_status
234 
235  if (PRESENT(msg)) then
236    write(std_out,'(2a)')"User message: ",TRIM(msg)
237  end if
238 
239  ! Close std_out and ab_out
240  inquire(std_out,opened=testopen)
241  if (testopen) close(std_out)
242  inquire(ab_out,opened=testopen)
243  if (testopen) close(ab_out)
244 
245 #ifdef HAVE_MPI
246  my_errorcode=MPI_ERR_UNKNOWN; if (PRESENT(mpierr)) my_errorcode=mpierr
247  call MPI_ERROR_STRING(my_errorcode, mpi_msg_error, ilen, ierr2)
248  call MPI_ABORT(my_comm,my_errorcode,ierr)
249 #endif
250 
251 #if defined FC_NAG
252  call exit(exit_status)
253 #elif defined HAVE_FC_EXIT
254  call exit(exit_status)
255 #else
256  if (exit_status== 0) stop  "0"
257  if (exit_status== 1) stop  "1"
258  if (exit_status==-1) stop "-1"
259 #endif
260  stop "1"
261 
262 end subroutine xpaw_mpi_abort

m_libpaw_mpi/xpaw_mpi_barrier [ Functions ]

[ Top ] [ m_libpaw_mpi ] [ Functions ]

NAME

  xpaw_mpi_barrier

FUNCTION

  Wrapper for MPI_BARRIER

INPUTS

  comm=MPI communicator

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

383 subroutine xpaw_mpi_barrier(comm)
384 
385 
386 !This section has been created automatically by the script Abilint (TD).
387 !Do not modify the following lines by hand.
388 #undef ABI_FUNC
389 #define ABI_FUNC 'xpaw_mpi_barrier'
390 !End of the abilint section
391 
392  implicit none
393 
394 !Arguments-------------------------
395  integer,intent(in) :: comm
396 
397 !Local variables-------------------
398  integer   :: ier
399 #ifdef HAVE_MPI
400  integer :: nprocs
401 #endif
402 
403 ! *************************************************************************
404 
405  ier = 0
406 #ifdef HAVE_MPI
407  if (comm/=xpaw_mpi_comm_null) then
408    call MPI_COMM_SIZE(comm,nprocs,ier)
409    if(nprocs>1)then
410      call MPI_BARRIER(comm,ier)
411    end if
412  end if
413 #endif
414 
415 end subroutine xpaw_mpi_barrier

m_libpaw_mpi/xpaw_mpi_comm_rank [ Functions ]

[ Top ] [ m_libpaw_mpi ] [ Functions ]

NAME

  xpaw_mpi_comm_rank

FUNCTION

  Wrapper for MPI_COMM_RANK

INPUTS

  comm=MPI communicator.

OUTPUT

  xpaw_mpi_comm_rank=The rank of the node inside comm

SOURCE

283 function xpaw_mpi_comm_rank(comm)
284 
285 
286 !This section has been created automatically by the script Abilint (TD).
287 !Do not modify the following lines by hand.
288 #undef ABI_FUNC
289 #define ABI_FUNC 'xpaw_mpi_comm_rank'
290 !End of the abilint section
291 
292  implicit none
293 
294 !Arguments-------------------------
295  integer,intent(in) :: comm
296  integer :: xpaw_mpi_comm_rank
297 
298 !Local variables-------------------
299  integer :: mpierr
300 
301 ! *************************************************************************
302 
303  mpierr=0
304 #ifdef HAVE_MPI
305  xpaw_mpi_comm_rank=-1  ! Return non-sense value if the proc does not belong to the comm
306  if (comm/=xpaw_mpi_comm_null) then
307    call MPI_COMM_RANK(comm,xpaw_mpi_comm_rank,mpierr)
308  end if
309 #else
310  xpaw_mpi_comm_rank=0
311 #endif
312 
313 end function xpaw_mpi_comm_rank

m_libpaw_mpi/xpaw_mpi_comm_size [ Functions ]

[ Top ] [ m_libpaw_mpi ] [ Functions ]

NAME

  xpaw_mpi_comm_size

FUNCTION

  Wrapper for MPI_COMM_SIZE

INPUTS

  comm=MPI communicator.

OUTPUT

  xpaw_mpi_comm_size=The number of processors inside comm.

SOURCE

333 function xpaw_mpi_comm_size(comm)
334 
335 
336 !This section has been created automatically by the script Abilint (TD).
337 !Do not modify the following lines by hand.
338 #undef ABI_FUNC
339 #define ABI_FUNC 'xpaw_mpi_comm_size'
340 !End of the abilint section
341 
342  implicit none
343 
344 !Arguments-------------------------
345  integer,intent(in) :: comm
346  integer :: xpaw_mpi_comm_size
347 
348 !Local variables-------------------------------
349 !scalars
350  integer :: mpierr
351 
352 ! *************************************************************************
353 
354  mpierr=0; xpaw_mpi_comm_size=1
355 #ifdef HAVE_MPI
356  if (comm/=xpaw_mpi_comm_null) then
357    call MPI_COMM_SIZE(comm,xpaw_mpi_comm_size,mpierr)
358  end if
359 #endif
360 
361 end function xpaw_mpi_comm_size

m_libpaw_mpi/xpaw_mpi_iprobe [ Functions ]

[ Top ] [ m_libpaw_mpi ] [ Functions ]

NAME

  xpaw_mpi_iprobe

FUNCTION

  Wrapper for MPI_IPROBE

INPUTS

  source= source processes
  tag= tag value
  mpicomm= communicator

OUTPUT

  flag= True if a message with the specified source, tag, and communicator is available
  mpierr= status error

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

549 subroutine xpaw_mpi_iprobe(source,tag,mpicomm,flag,mpierr)
550 
551 
552 !This section has been created automatically by the script Abilint (TD).
553 !Do not modify the following lines by hand.
554 #undef ABI_FUNC
555 #define ABI_FUNC 'xpaw_mpi_iprobe'
556 !End of the abilint section
557 
558  implicit none
559 
560 !Arguments-------------------------
561  integer,intent(in) :: mpicomm,source,tag
562  integer,intent(out) :: mpierr
563  logical,intent(out) :: flag
564 
565 !Local variables-------------------
566 #ifdef HAVE_MPI
567  integer :: ier,status(MPI_STATUS_SIZE)
568 #endif
569 
570 ! *************************************************************************
571 
572  mpierr = 0
573 #ifdef HAVE_MPI
574   call MPI_IPROBE(source,tag,mpicomm,flag,status,ier)
575   mpierr=ier
576 #endif
577 
578 end subroutine xpaw_mpi_iprobe

m_libpaw_mpi/xpaw_mpi_wait [ Functions ]

[ Top ] [ m_libpaw_mpi ] [ Functions ]

NAME

  xpaw_mpi_wait

FUNCTION

  Wrapper for MPI_WAIT

INPUTS

  request= MPI request handle to wait for

OUTPUT

  mpierr= status error

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

440 subroutine xpaw_mpi_wait(request,mpierr)
441 
442 
443 !This section has been created automatically by the script Abilint (TD).
444 !Do not modify the following lines by hand.
445 #undef ABI_FUNC
446 #define ABI_FUNC 'xpaw_mpi_wait'
447 !End of the abilint section
448 
449  implicit none
450 
451 !Arguments-------------------------
452  integer,intent(out) :: mpierr
453  integer,intent(inout) :: request
454 
455 !Local variables-------------------
456 #ifdef HAVE_MPI
457  integer :: ier,status(MPI_STATUS_SIZE)
458 #endif
459 
460 ! *************************************************************************
461 
462  mpierr = 0
463 #ifdef HAVE_MPI
464   call MPI_WAIT(request,status,ier)
465   mpierr=ier
466 #endif
467 
468 end subroutine xpaw_mpi_wait

m_libpaw_mpi/xpaw_mpi_waitall [ Functions ]

[ Top ] [ m_libpaw_mpi ] [ Functions ]

NAME

  xpaw_mpi_waitall

FUNCTION

  Wrapper for MPI_WAITALL

INPUTS

  array_of_requests= array of request handles

OUTPUT

  mpierr= status error

PARENTS

CHILDREN

      mpi_allreduce,mpi_comm_size

SOURCE

493 subroutine xpaw_mpi_waitall(array_of_requests,mpierr)
494 
495 
496 !This section has been created automatically by the script Abilint (TD).
497 !Do not modify the following lines by hand.
498 #undef ABI_FUNC
499 #define ABI_FUNC 'xpaw_mpi_waitall'
500 !End of the abilint section
501 
502  implicit none
503 
504 !Arguments-------------------------
505  integer,intent(inout) :: array_of_requests(:)
506  integer,intent(out) :: mpierr
507 
508 !Local variables-------------------
509 #ifdef HAVE_MPI
510  integer :: ier,status(MPI_STATUS_SIZE,size(array_of_requests))
511 #endif
512 
513 ! *************************************************************************
514 
515  mpierr = 0
516 #ifdef HAVE_MPI
517   call MPI_WAITALL(size(array_of_requests),array_of_requests,status,ier)
518   mpierr=ier
519 #endif
520 
521 end subroutine xpaw_mpi_waitall