10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-06-22 05:02:15 +02:00

Merge branch 'master' of github.com:LCPQ/quantum_package

This commit is contained in:
Manu 2014-07-12 12:21:12 +02:00
commit c9929fb92d
5 changed files with 94 additions and 0 deletions

View File

@ -253,6 +253,11 @@ BEGIN_PROVIDER [ logical, ao_bielec_integrals_in_map ]
!$OMP DO SCHEDULE(dynamic)
do kk=1,lmax
IRP_IF COARRAY
if (mod(kk-this_image(),num_images()) /= 0) then
cycle
endif
IRP_ENDIF
if (abort_here) then
cycle
endif
@ -316,6 +321,10 @@ BEGIN_PROVIDER [ logical, ao_bielec_integrals_in_map ]
if (abort_here) then
stop 'Aborting in AO integrals calculation'
endif
IRP_IF COARRAY
write(output_BiInts,*) 'Communicating the map'
call communicate_ao_integrals()
IRP_ENDIF COARRAY
write(output_BiInts,*) 'Sorting the map'
call map_sort(ao_integrals_map)
call cpu_time(cpu_2)

View File

@ -321,6 +321,63 @@ subroutine dump_$ao_integrals(filename)
end
IRP_IF COARRAY
subroutine communicate_$ao_integrals()
use map_module
implicit none
BEGIN_DOC
! Communicate the $ao integrals with co-array
END_DOC
integer(cache_key_kind), pointer :: key(:)
real(integral_kind), pointer :: val(:)
integer*8 :: i,j, k, nmax
integer*8, save :: n[*]
integer :: copy_n
real(integral_kind), allocatable :: buffer_val(:)[:]
integer(cache_key_kind), allocatable :: buffer_key(:)[:]
real(integral_kind), allocatable :: copy_val(:)
integer*8, allocatable :: copy_key(:)
n = 0_8
do i=0_8,$ao_integrals_map%map_size
n = max(n,$ao_integrals_map%map(i)%n_elements)
enddo
sync all
nmax = 0_8
do j=1,num_images()
nmax = max(nmax,n[j])
enddo
allocate( buffer_key(nmax)[*], buffer_val(nmax)[*])
allocate( copy_key(nmax), copy_val(nmax))
do i=0_8,$ao_integrals_map%map_size
key => $ao_integrals_map%map(i)%key
val => $ao_integrals_map%map(i)%value
n = $ao_integrals_map%map(i)%n_elements
do j=1,n
buffer_key(j) = key(j)
buffer_val(j) = val(j)
enddo
sync all
do j=1,num_images()
if (j /= this_image()) then
copy_n = n[j]
do k=1,copy_n
copy_val(k) = buffer_val(k)[j]
copy_key(k) = buffer_key(k)[j]
copy_key(k) = copy_key(k)+ishft(i,-map_shift)
enddo
! call map_update($ao_integrals_map, copy_key, copy_val, copy_n, 0.d0)
call map_append($ao_integrals_map, copy_key, copy_val, copy_n )
endif
enddo
sync all
enddo
deallocate( buffer_key, buffer_val, copy_val, copy_key)
end
IRP_ENDIF
integer function load_$ao_integrals(filename)
implicit none

View File

@ -111,6 +111,11 @@ subroutine add_integrals_to_map(mask_ijkl)
!$ thread_num = omp_get_thread_num()
!$OMP DO SCHEDULE(guided)
do l1 = 1,ao_num
IRP_IF COARRAY
if (mod(l1-this_image(),num_images()) /= 0 ) then
cycle
endif
IRP_ENDIF
if (abort_here) then
cycle
endif
@ -275,6 +280,10 @@ subroutine add_integrals_to_map(mask_ijkl)
if (abort_here) then
stop 'Aborting in MO integrals calculation'
endif
IRP_IF COARRAY
write(output_BiInts,*) 'Communicating the map'
call communicate_mo_integrals()
IRP_ENDIF
call map_unique(mo_integrals_map)
call wall_time(wall_2)

View File

@ -22,7 +22,15 @@ BEGIN_SHELL [ /bin/bash ]
PROVIDE output_wall_time_0 output_cpu_time_0
integer :: getUnitAndOpen
call ezfio_set_output_empty(.False.)
IRP_IF COARRAY
if (this_image() == 1) then
output_$NAME = getUnitAndOpen(trim(ezfio_filename)//'/output/'//'$NAME.rst','a')
else
output_$NAME = getUnitAndOpen('/dev/null','w')
endif
IRP_ELSE
output_$NAME = getUnitAndOpen(trim(ezfio_filename)//'/output/'//'$NAME.rst','a')
IRP_ENDIF
write(output_$NAME,'(A)') &
'--------------------------------------------------------------------------------'
END_PROVIDER

View File

@ -48,3 +48,14 @@ BEGIN_PROVIDER [ double precision, select_max, (1) ]
END_DOC
select_max(1) = huge(1.d0)
END_PROVIDER
BEGIN_PROVIDER [ integer, size_select_max ]
implicit none
BEGIN_DOC
! Size of select_max
END_DOC
size_select_max = 1
END_PROVIDER