diff --git a/plugins/mrcepa0/dress_types.f90 b/plugins/mrcepa0/dress_types.f90 new file mode 100644 index 00000000..7b1a3c70 --- /dev/null +++ b/plugins/mrcepa0/dress_types.f90 @@ -0,0 +1,10 @@ +module dress_types + type dress_buffer + double precision, pointer :: buf(:,:,:), buf0(:,:), coef(:) + double precision :: N + integer, pointer :: det_to_buf(:), buf_to_det(:) + integer :: free_under, pos, N_slot + logical :: full + endtype +end module + diff --git a/plugins/mrcepa0/mrcc_stoch_routines.irp.f b/plugins/mrcepa0/mrcc_stoch_routines.irp.f index 1ad9b8da..78940d5e 100644 --- a/plugins/mrcepa0/mrcc_stoch_routines.irp.f +++ b/plugins/mrcepa0/mrcc_stoch_routines.irp.f @@ -4,6 +4,14 @@ BEGIN_PROVIDER [ integer, fragment_first ] END_PROVIDER +BEGIN_PROVIDER [ integer, mrcc_stoch_istate ] + implicit none + BEGIN_DOC + ! State considered + END_DOC + mrcc_stoch_istate = 1 +END_PROVIDER + subroutine ZMQ_mrcc(E, mrcc, delta, delta_s2, relative_error) use dress_types use f77_zmq @@ -14,7 +22,7 @@ subroutine ZMQ_mrcc(E, mrcc, delta, delta_s2, relative_error) integer(ZMQ_PTR) :: zmq_to_qp_run_socket, zmq_socket_pull integer, external :: omp_get_thread_num - double precision, intent(in) :: relative_error, E + double precision, intent(in) :: relative_error, E(N_states) double precision, intent(out) :: mrcc(N_states) double precision, intent(out) :: delta(N_states, N_det_non_ref) double precision, intent(out) :: delta_s2(N_states, N_det_non_ref) @@ -67,6 +75,7 @@ subroutine ZMQ_mrcc(E, mrcc, delta, delta_s2, relative_error) ! end do integer(ZMQ_PTR), external :: new_zmq_to_qp_run_socket + integer, external :: add_task_to_taskserver, zmq_set_running integer :: ipos ipos=1 do i=1,N_mrcc_jobs @@ -152,7 +161,6 @@ subroutine mrcc_collector(zmq_socket_pull, E, relative_error, delta, delta_s2, m integer(ZMQ_PTR) :: zmq_to_qp_run_socket integer(ZMQ_PTR), external :: new_zmq_pull_socket - integer(ZMQ_PTR) :: zmq_socket_pull integer :: more integer :: i, j, k, i_state, N, ntask @@ -191,7 +199,6 @@ subroutine mrcc_collector(zmq_socket_pull, E, relative_error, delta, delta_s2, m actually_computed = .false. zmq_to_qp_run_socket = new_zmq_to_qp_run_socket() - zmq_socket_pull = new_zmq_pull_socket() allocate(task_id(N_det_generators), ind(1)) more = 1 if (time0 < 0.d0) then @@ -340,7 +347,6 @@ subroutine mrcc_collector(zmq_socket_pull, E, relative_error, delta, delta_s2, m call end_zmq_to_qp_run_socket(zmq_to_qp_run_socket) - call end_zmq_pull_socket(zmq_socket_pull) end subroutine diff --git a/src/Determinants/determinants.irp.f b/src/Determinants/determinants.irp.f index 876eb124..40c4524a 100644 --- a/src/Determinants/determinants.irp.f +++ b/src/Determinants/determinants.irp.f @@ -195,27 +195,27 @@ BEGIN_PROVIDER [ double precision, psi_coef, (psi_det_size,N_states) ] exists = (label == mo_label) endif endif - endif - if (exists) then - - double precision, allocatable :: psi_coef_read(:,:) - allocate (psi_coef_read(N_det,N_states)) - call ezfio_get_determinants_psi_coef(psi_coef_read) - do k=1,N_states - do i=1,N_det - psi_coef(i,k) = psi_coef_read(i,k) + if (exists) then + + double precision, allocatable :: psi_coef_read(:,:) + allocate (psi_coef_read(N_det,N_states)) + print *, 'Read psi_coef', N_det, N_states + call ezfio_get_determinants_psi_coef(psi_coef_read) + do k=1,N_states + do i=1,N_det + psi_coef(i,k) = psi_coef_read(i,k) + enddo enddo - enddo - deallocate(psi_coef_read) - print *, 'Read psi_coef' - + deallocate(psi_coef_read) + + endif endif endif IRP_IF MPI include 'mpif.h' integer :: ierr - call MPI_BCAST( psi_coef, N_states*psi_det_size, MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr) + call MPI_BCAST( psi_coef, size(psi_coef), MPI_DOUBLE_PRECISION, 0, MPI_COMM_WORLD, ierr) if (ierr /= MPI_SUCCESS) then stop 'Unable to read psi_coef with MPI' endif