mirror of
https://github.com/LCPQ/quantum_package
synced 2024-12-23 04:43:50 +01:00
Fixed bug in mmap
This commit is contained in:
parent
bbb2c925b8
commit
7842351f85
@ -53,17 +53,17 @@ subroutine map_save_to_disk(filename,map)
|
|||||||
map % consolidated = .True.
|
map % consolidated = .True.
|
||||||
|
|
||||||
|
|
||||||
! call munmap( (/ map % map_size + 2_8 /), 8, fd(1), c_pointer(1))
|
call munmap( (/ map % map_size + 2_8 /), 8, fd(1), c_pointer(1))
|
||||||
! call mmap(trim(filename)//'_consolidated_idx', (/ map % map_size + 2_8 /), 8, fd(1), .True., c_pointer(1))
|
call mmap(trim(filename)//'_consolidated_idx', (/ map % map_size + 2_8 /), 8, fd(1), .True., c_pointer(1))
|
||||||
! call c_f_pointer(c_pointer(1),map % consolidated_idx, (/ map % map_size +2_8/))
|
call c_f_pointer(c_pointer(1),map % consolidated_idx, (/ map % map_size +2_8/))
|
||||||
!
|
|
||||||
! call munmap( (/ map % n_elements /), cache_key_kind, fd(2), c_pointer(2))
|
call munmap( (/ map % n_elements /), cache_key_kind, fd(2), c_pointer(2))
|
||||||
! call mmap(trim(filename)//'_consolidated_key', (/ map % n_elements /), cache_key_kind, fd(2), .True., c_pointer(2))
|
call mmap(trim(filename)//'_consolidated_key', (/ map % n_elements /), cache_key_kind, fd(2), .True., c_pointer(2))
|
||||||
! call c_f_pointer(c_pointer(2),map % consolidated_key, (/ map % n_elements /))
|
call c_f_pointer(c_pointer(2),map % consolidated_key, (/ map % n_elements /))
|
||||||
!
|
|
||||||
! call munmap( (/ map % n_elements /), integral_kind, fd(3), c_pointer(3))
|
call munmap( (/ map % n_elements /), integral_kind, fd(3), c_pointer(3))
|
||||||
! call mmap(trim(filename)//'_consolidated_value', (/ map % n_elements /), integral_kind, fd(3), .True., c_pointer(3))
|
call mmap(trim(filename)//'_consolidated_value', (/ map % n_elements /), integral_kind, fd(3), .True., c_pointer(3))
|
||||||
! call c_f_pointer(c_pointer(3),map % consolidated_value, (/ map % n_elements /))
|
call c_f_pointer(c_pointer(3),map % consolidated_value, (/ map % n_elements /))
|
||||||
|
|
||||||
end
|
end
|
||||||
|
|
||||||
|
@ -36,7 +36,7 @@ module mmap_module
|
|||||||
integer, intent(out) :: fd ! File descriptor
|
integer, intent(out) :: fd ! File descriptor
|
||||||
type(c_ptr), intent(out) :: map ! C Pointer
|
type(c_ptr), intent(out) :: map ! C Pointer
|
||||||
|
|
||||||
integer(c_long) :: length
|
integer(c_size_t) :: length
|
||||||
integer(c_int) :: fd_
|
integer(c_int) :: fd_
|
||||||
|
|
||||||
length = PRODUCT( shape(:) ) * bytes
|
length = PRODUCT( shape(:) ) * bytes
|
||||||
@ -56,7 +56,7 @@ module mmap_module
|
|||||||
integer, intent(in) :: fd ! File descriptor
|
integer, intent(in) :: fd ! File descriptor
|
||||||
type(c_ptr), intent(in) :: map ! C pointer
|
type(c_ptr), intent(in) :: map ! C pointer
|
||||||
|
|
||||||
integer(c_long) :: length
|
integer(c_size_t) :: length
|
||||||
integer(c_int) :: fd_
|
integer(c_int) :: fd_
|
||||||
|
|
||||||
length = PRODUCT( shape(:) ) * bytes
|
length = PRODUCT( shape(:) ) * bytes
|
||||||
|
Loading…
Reference in New Issue
Block a user