10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-22 12:23:48 +01:00
This commit is contained in:
Anthony Scemama 2017-11-27 09:58:48 +01:00
parent 4243595a17
commit fc5f0b9745

View File

@ -1,18 +1,18 @@
BEGIN_PROVIDER [ integer, mpi_bit_kind ] BEGIN_PROVIDER [ integer, mpi_bit_kind ]
use bitmasks use bitmasks
include 'mpif.h'
implicit none implicit none
BEGIN_DOC BEGIN_DOC
! MPI bit kind type ! MPI bit kind type
END_DOC END_DOC
IRP_IF MPI IRP_IF MPI
if (bit_kind == 4) then include 'mpif.h'
mpi_bit_kind = MPI_INTEGER4 if (bit_kind == 4) then
else if (bit_kind == 8) then mpi_bit_kind = MPI_INTEGER4
mpi_bit_kind = MPI_INTEGER8 else if (bit_kind == 8) then
else mpi_bit_kind = MPI_INTEGER8
stop 'Wrong bit kind in mpi_bit_kind' else
endif stop 'Wrong bit kind in mpi_bit_kind'
endif
IRP_ELSE IRP_ELSE
mpi_bit_kind = -1 mpi_bit_kind = -1
IRP_ENDIF IRP_ENDIF
@ -89,20 +89,21 @@ subroutine broadcast_chunks_$double(A, LDA)
integer, intent(in) :: LDA integer, intent(in) :: LDA
$type, intent(inout) :: A(LDA) $type, intent(inout) :: A(LDA)
use bitmasks use bitmasks
include 'mpif.h'
BEGIN_DOC BEGIN_DOC
! Broadcast with chunks of ~2GB ! Broadcast with chunks of ~2GB
END_DOC END_DOC
integer :: i, sze, ierr IRP_IF MPI
do i=1,LDA,200000000/$8 include 'mpif.h'
sze = min(LDA-i+1, 200000000/$8) integer :: i, sze, ierr
call MPI_BCAST (A(i), sze, MPI_$DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr) do i=1,LDA,200000000/$8
if (ierr /= MPI_SUCCESS) then sze = min(LDA-i+1, 200000000/$8)
print *, irp_here//': Unable to broadcast chuks $double ', i call MPI_BCAST (A(i), sze, MPI_$DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr)
stop -1 if (ierr /= MPI_SUCCESS) then
endif print *, irp_here//': Unable to broadcast chuks $double ', i
enddo stop -1
endif
enddo
IRP_ENDIF
end end
SUBST [ double, type, 8, DOUBLE_PRECISION ] SUBST [ double, type, 8, DOUBLE_PRECISION ]