10
0
mirror of https://github.com/LCPQ/quantum_package synced 2024-12-22 04:14:07 +01:00

Fixed reading MOs

This commit is contained in:
Anthony Scemama 2018-05-07 23:26:33 +02:00
parent de60a016c8
commit 596cb71894
3 changed files with 22 additions and 16 deletions

View File

@ -33,7 +33,7 @@ void* mmap_fortran(char* filename, size_t bytes, int* file_descr, int read_only)
exit(EXIT_FAILURE);
}
result = lseek(fd, bytes, SEEK_SET);
result = lseek(fd, bytes+1, SEEK_SET);
if (result == -1) {
close(fd);
printf("%s:\n", filename);

View File

@ -74,6 +74,8 @@ subroutine map_load_from_disk(filename,map)
integer :: fd(3)
integer*8 :: i,k,l
integer*4 :: j,n_elements
integer(cache_key_kind), pointer :: key_p(:)
real(integral_kind), pointer :: value_p(:)
if (map % consolidated) then
stop 'map already consolidated'
@ -96,21 +98,25 @@ subroutine map_load_from_disk(filename,map)
do i=0_8, map % map_size
deallocate(map % map(i) % value)
deallocate(map % map(i) % key)
map % map(i) % value => map % consolidated_value ( map % consolidated_idx (i+1_8) :)
map % map(i) % key => map % consolidated_key ( map % consolidated_idx (i+1_8) :)
map % map(i) % sorted = .True.
n_elements = int( map % consolidated_idx (i+2_8) - k, 4)
k = map % consolidated_idx (i+2_8)
l = map % consolidated_idx (i+1_8)
n_elements = int(k - l, 4)
key_p => map % consolidated_key (l:l+n_elements)
value_p => map % consolidated_value ( l:l+n_elements )
print *, i, n_elements
map % map(i) % key => key_p
map % map(i) % value => value_p
map % map(i) % sorted = .True.
map % map(i) % map_size = n_elements
map % map(i) % n_elements = n_elements
! Load memory from disk
do j=1,n_elements
x = x + map % map(i) % value(j)
l = iand(l,int(map % map(i) % key(j),8))
if (map % map(i) % value(j) > 1.e30) then
x = x + value_p(j)
l = iand(l,int(key_p(j),8))
if (value_p(j) > 1.e30) then
stop 'Error in integrals file'
endif
if (map % map(i) % key(j) < 0) then
if (key_p(j) < 0) then
stop 'Error in integrals file'
endif
enddo

View File

@ -148,12 +148,12 @@ function new_zmq_to_qp_run_socket()
stop 'Unable to create zmq req socket'
endif
rc = f77_zmq_setsockopt(new_zmq_to_qp_run_socket, ZMQ_SNDTIMEO, 30000, 4)
rc = f77_zmq_setsockopt(new_zmq_to_qp_run_socket, ZMQ_SNDTIMEO, 60000, 4)
if (rc /= 0) then
stop 'Unable to set send timeout in new_zmq_to_qp_run_socket'
endif
rc = f77_zmq_setsockopt(new_zmq_to_qp_run_socket, ZMQ_RCVTIMEO, 30000, 4)
rc = f77_zmq_setsockopt(new_zmq_to_qp_run_socket, ZMQ_RCVTIMEO, 60000, 4)
if (rc /= 0) then
stop 'Unable to set recv timeout in new_zmq_to_qp_run_socket'
endif
@ -250,7 +250,7 @@ IRP_ENDIF
stop 'Unable to create zmq pull socket'
endif
rc = f77_zmq_setsockopt(new_zmq_pull_socket,ZMQ_LINGER,30000,4)
rc = f77_zmq_setsockopt(new_zmq_pull_socket,ZMQ_LINGER,60000,4)
if (rc /= 0) then
stop 'Unable to set ZMQ_LINGER on pull socket'
endif
@ -332,7 +332,7 @@ IRP_ENDIF
stop 'Unable to create zmq push socket'
endif
rc = f77_zmq_setsockopt(new_zmq_push_socket,ZMQ_LINGER,30000,4)
rc = f77_zmq_setsockopt(new_zmq_push_socket,ZMQ_LINGER,60000,4)
if (rc /= 0) then
stop 'Unable to set ZMQ_LINGER on push socket'
endif
@ -352,7 +352,7 @@ IRP_ENDIF
stop 'Unable to set ZMQ_IMMEDIATE on push socket'
endif
rc = f77_zmq_setsockopt(new_zmq_push_socket, ZMQ_SNDTIMEO, 30000, 4)
rc = f77_zmq_setsockopt(new_zmq_push_socket, ZMQ_SNDTIMEO, 60000, 4)
if (rc /= 0) then
stop 'Unable to set send timout in new_zmq_push_socket'
endif
@ -488,7 +488,7 @@ subroutine end_zmq_push_socket(zmq_socket_push,thread)
integer :: rc
character*(8), external :: zmq_port
rc = f77_zmq_setsockopt(zmq_socket_push,ZMQ_LINGER,30000,4)
rc = f77_zmq_setsockopt(zmq_socket_push,ZMQ_LINGER,60000,4)
if (rc /= 0) then
stop 'Unable to set ZMQ_LINGER on push socket'
endif
@ -1014,7 +1014,7 @@ subroutine end_zmq_to_qp_run_socket(zmq_to_qp_run_socket)
character*(8), external :: zmq_port
integer :: rc
rc = f77_zmq_setsockopt(zmq_to_qp_run_socket,ZMQ_LINGER,30000,4)
rc = f77_zmq_setsockopt(zmq_to_qp_run_socket,ZMQ_LINGER,60000,4)
if (rc /= 0) then
stop 'Unable to set ZMQ_LINGER on zmq_to_qp_run_socket'
endif