From 22b2870b9fa78e632a543a9ac4e0ef44a30ed40d Mon Sep 17 00:00:00 2001 From: Yann Garniron Date: Thu, 1 Mar 2018 11:35:00 +0100 Subject: [PATCH] corrected assert(N_states>1) --- plugins/dress_zmq/dress_stoch_routines.irp.f | 30 ++++++++------- plugins/mrcc_sto/mrcc_sto.irp.f | 39 ++++++++++---------- plugins/mrcepa0/mrcc_stoch_routines.irp.f | 9 +++-- 3 files changed, 43 insertions(+), 35 deletions(-) diff --git a/plugins/dress_zmq/dress_stoch_routines.irp.f b/plugins/dress_zmq/dress_stoch_routines.irp.f index 29ca80f7..b5b865ab 100644 --- a/plugins/dress_zmq/dress_stoch_routines.irp.f +++ b/plugins/dress_zmq/dress_stoch_routines.irp.f @@ -247,28 +247,28 @@ subroutine dress_collector(zmq_socket_pull, E, relative_error, delta, delta_s2, time = omp_get_wtime() - - if(time - timeLast > 1d0 .or. (.not. loop)) then + if((time - timeLast > 2d0) .or. (.not. loop)) then timeLast = time cur_cp = N_cp - if(.not. actually_computed(dress_jobs(1))) cycle pullLoop - - do i=2,N_det_generators + + do i=1,N_det_generators if(.not. actually_computed(dress_jobs(i))) then - cur_cp = done_cp_at(i-1) + if(i /= 1) then + cur_cp = done_cp_at(i-1) + else + cur_cp = 0 + end if exit end if end do if(cur_cp == 0) cycle pullLoop - double precision :: su, su2, eqt, avg, E0, val integer, external :: zmq_abort su = 0d0 su2 = 0d0 - if(N_states > 1) stop "dress_stoch : N_states == 1" do i=1, int(cps_N(cur_cp)) call get_comb_val(comb(i), dress_detail, cur_cp, val) su += val @@ -280,11 +280,14 @@ subroutine dress_collector(zmq_socket_pull, E, relative_error, delta, delta_s2, if(cp_first_tooth(cur_cp) <= comb_teeth) then E0 = E0 + dress_detail(1, first_det_of_teeth(cp_first_tooth(cur_cp))) * (1d0-fractage(cp_first_tooth(cur_cp))) end if + + call wall_time(time) if ((dabs(eqt) < relative_error .and. cps_N(cur_cp) >= 30) .or. total_computed == N_det_generators) then ! Termination - !print '(G10.3, 2X, F16.7, 2X, G16.3, 2X, F16.4, A20)', Nabove(tooth), avg+E, eqt, time-time0, '' -! print *, "GREPME", cur_cp, E+E0+avg, eqt, time-time0, total_computed + print "" + print "(A10,I5,F15.7,E12.4,F10.2)", "grepme", cur_cp, E+E0+avg, eqt, time-time0 + print "" if (zmq_abort(zmq_to_qp_run_socket) == -1) then call sleep(1) if (zmq_abort(zmq_to_qp_run_socket) == -1) then @@ -294,8 +297,9 @@ subroutine dress_collector(zmq_socket_pull, E, relative_error, delta, delta_s2, else if (cur_cp > old_cur_cp) then old_cur_cp = cur_cp -! print *, "GREPME", cur_cp, E+E0+avg, eqt, time-time0, total_computed - !print '(G10.3, 2X, F16.7, 2X, G16.3, 2X, F16.4, A20)', Nabove(tooth), avg+E, eqt, time-time0, '' + print "" + print "(A10,I5,F15.7,E12.4,F10.2)", "grepme", cur_cp, E+E0+avg, eqt, time-time0 + print "" endif endif end if @@ -355,7 +359,7 @@ end function &BEGIN_PROVIDER [ integer, N_cps_max ] implicit none comb_teeth = 16 - N_cps_max = 32 + N_cps_max = 64 gen_per_cp = (N_det_generators / N_cps_max) + 1 N_cps_max += 1 END_PROVIDER diff --git a/plugins/mrcc_sto/mrcc_sto.irp.f b/plugins/mrcc_sto/mrcc_sto.irp.f index 0eb6a75e..a9942c02 100644 --- a/plugins/mrcc_sto/mrcc_sto.irp.f +++ b/plugins/mrcc_sto/mrcc_sto.irp.f @@ -61,28 +61,29 @@ subroutine dress_with_alpha_buffer(delta_ij_loc, minilist, det_minilist, n_minil if (perturbative_triples) then PROVIDE one_anhil fock_virt_total fock_core_inactive_total one_creat endif + canbediamond = 0 do l_sd=1,n_minilist - call get_excitation(det_minilist(1,1,l_sd),alpha,exc,degree1,phase,N_int) - call decode_exc(exc,degree1,h1,p1,h2,p2,s1,s2) + call get_excitation(det_minilist(1,1,l_sd),alpha,exc,degree1,phase,N_int) + call decode_exc(exc,degree1,h1,p1,h2,p2,s1,s2) - ok = (mo_class(h1)(1:1) == 'A' .or. mo_class(h1)(1:1) == 'I') .and. & - (mo_class(p1)(1:1) == 'A' .or. mo_class(p1)(1:1) == 'V') - if(ok .and. degree1 == 2) then - ok = (mo_class(h2)(1:1) == 'A' .or. mo_class(h2)(1:1) == 'I') .and. & - (mo_class(p2)(1:1) == 'A' .or. mo_class(p2)(1:1) == 'V') - end if - - if(ok) then - canbediamond += 1 - excs_(:,:,:,l_sd,iproc) = exc(:,:,:) - phases_(l_sd, iproc) = phase - else - phases_(l_sd, iproc) = 0d0 - end if - !call i_h_j(alpha,det_minilist(1,1,l_sd),N_int,hij_cache_(l_sd,iproc)) - !call get_s2(alpha,det_minilist(1,1,l_sd),N_int,sij_cache_(l_sd,iproc)) - call i_h_j_s2(alpha,det_minilist(1,1,l_sd),N_int,hij_cache_(l_sd,iproc), sij_cache_(l_sd,iproc)) + ok = (mo_class(h1)(1:1) == 'A' .or. mo_class(h1)(1:1) == 'I') .and. & + (mo_class(p1)(1:1) == 'A' .or. mo_class(p1)(1:1) == 'V') + if(ok .and. degree1 == 2) then + ok = (mo_class(h2)(1:1) == 'A' .or. mo_class(h2)(1:1) == 'I') .and. & + (mo_class(p2)(1:1) == 'A' .or. mo_class(p2)(1:1) == 'V') + end if + + if(ok) then + canbediamond += 1 + excs_(:,:,:,l_sd,iproc) = exc(:,:,:) + phases_(l_sd, iproc) = phase + else + phases_(l_sd, iproc) = 0d0 + end if + !call i_h_j(alpha,det_minilist(1,1,l_sd),N_int,hij_cache_(l_sd,iproc)) + !call get_s2(alpha,det_minilist(1,1,l_sd),N_int,sij_cache_(l_sd,iproc)) + call i_h_j_s2(alpha,det_minilist(1,1,l_sd),N_int,hij_cache_(l_sd,iproc), sij_cache_(l_sd,iproc)) enddo if(canbediamond <= 1) return diff --git a/plugins/mrcepa0/mrcc_stoch_routines.irp.f b/plugins/mrcepa0/mrcc_stoch_routines.irp.f index d8537a8b..45907679 100644 --- a/plugins/mrcepa0/mrcc_stoch_routines.irp.f +++ b/plugins/mrcepa0/mrcc_stoch_routines.irp.f @@ -365,9 +365,12 @@ subroutine mrcc_collector(zmq_socket_pull, E, relative_error, delta, delta_s2, m if(cp_first_tooth(cur_cp) <= comb_teeth) then E0 = E0 + mrcc_detail(1, first_det_of_teeth(cp_first_tooth(cur_cp))) * (1d0-fractage(cp_first_tooth(cur_cp))) end if - - print "(I5,F15.7,E12.4,F10.2)", cur_cp, E+E0+avg, eqt, time-timeInit - + + if(cur_cp /= old_cur_cp) then + old_cur_cp = cur_cp + print "(A10, I5,F15.7,E12.4,F10.2)", "grepme", cur_cp, E+E0+avg, eqt, time-timeInit + end if + if ((dabs(eqt) < relative_error .and. cps_N(cur_cp) >= 30) .or. total_computed == N_det_generators) then if (zmq_abort(zmq_to_qp_run_socket) == -1) then call sleep(1)