10
0
mirror of https://github.com/QuantumPackage/qp2.git synced 2024-12-22 12:23:43 +01:00

Disk-based cholesky OK

This commit is contained in:
Anthony Scemama 2024-06-07 14:33:13 +02:00
parent 2241096a64
commit 6ae162b6c9
3 changed files with 15 additions and 9 deletions

View File

@ -66,6 +66,10 @@ END_PROVIDER
integer :: fd(2)
logical :: delta_on_disk
PROVIDE nproc
PROVIDE nucl_coord ao_two_e_integral_schwartz
call set_multiple_levels_omp(.False.)
call wall_time(wall0)
! Will be reallocated at the end
@ -87,7 +91,7 @@ END_PROVIDER
call resident_memory(mem0)
rank_max = min(ndim8,274877906944_8/1_8/ndim8)
rank_max = min(ndim8,(qp_max_mem*1024_8*1024_8*1024_8/8_8)/ndim8)
call mmap(trim(ezfio_work_dir)//'cholesky_ao_tmp', (/ ndim8, rank_max /), 8, fd(1), .False., .True., c_pointer(1))
call c_f_pointer(c_pointer(1), L, (/ ndim8, rank_max /))
! Deleting the file while it is open makes the file invisible on the filesystem,
@ -209,7 +213,7 @@ END_PROVIDER
+ np*memory_of_double(nq)
!print *, 'mem = ', mem
if (mem > 300.d0) then ! 300GB max for Delta
if (mem > qp_max_mem/2) then
s = s*2.d0
else
exit
@ -234,6 +238,9 @@ END_PROVIDER
mem = mem0 &
+ memory_of_int(nq) &! computed(nq)
+ np*memory_of_int(nq) &! computed(nq)
+ memory_of_double(np) &! Delta_col(np)
+ 7*memory_of_double(ndim8) &! D, Lset, Dset, D_sorted, addr[1-3]
+ np*memory_of_double(nq) &! Delta(np,nq)
+ (np+nq)*memory_of_double(block_size) ! Ltmp_p(np,block_size) + Ltmp_q(nq,block_size)
if (mem > qp_max_mem) then

View File

@ -49,10 +49,9 @@ void* mmap_fortran(char* filename, size_t bytes, int* file_descr, int read_only,
}
if (single_node == 1) {
map = mmap(NULL, bytes, PROT_READ | PROT_WRITE,
MAP_PRIVATE | MAP_HUGETLB , fd, 0);
map = mmap(NULL, bytes, PROT_READ | PROT_WRITE, MAP_PRIVATE | MAP_POPULATE | MAP_NONBLOCK, fd, 0);
} else {
map = mmap(NULL, bytes, PROT_READ | PROT_WRITE, MAP_SHARED | MAP_HUGETLB, fd, 0);
map = mmap(NULL, bytes, PROT_READ | PROT_WRITE, MAP_SHARED, fd, 0);
}
}

View File

@ -46,9 +46,9 @@ module mmap_module
type(c_ptr), intent(out) :: map ! C Pointer
integer(c_size_t) :: length
integer(c_int) :: fd_
integer(c_int) :: fd_, read_only_, single_node_
integer :: i, read_only_, single_node_
integer :: i
read_only_ = 0
single_node_ = 0
@ -60,7 +60,7 @@ module mmap_module
length = length * shape(i)
enddo
map = c_mmap_fortran( trim(filename)//char(0), length, fd_, read_only, single_node)
map = c_mmap_fortran( trim(filename)//char(0), length, fd_, read_only_, single_node_)
fd = fd_
end subroutine