From 99ea7948e0d58023f7ce02386014c8c3d493deb4 Mon Sep 17 00:00:00 2001 From: Yann Garniron Date: Mon, 3 Sep 2018 12:29:12 +0200 Subject: [PATCH] unbalanced fragmentation --- plugins/dress_zmq/alpha_factory.irp.f | 2 +- plugins/dress_zmq/dress_stoch_routines.irp.f | 20 ++++++++++++++------ plugins/dress_zmq/run_dress_slave.irp.f | 15 +++++++++------ 3 files changed, 24 insertions(+), 13 deletions(-) diff --git a/plugins/dress_zmq/alpha_factory.irp.f b/plugins/dress_zmq/alpha_factory.irp.f index f2902afb..bc15d788 100644 --- a/plugins/dress_zmq/alpha_factory.irp.f +++ b/plugins/dress_zmq/alpha_factory.irp.f @@ -70,6 +70,7 @@ subroutine generate_singles_and_doubles(delta_ij_loc, i_generator, bitmask_index allocate(preinteresting_det(N_int,2,N_det)) + maskInd = -1 monoAdo = .true. monoBdo = .true. @@ -192,7 +193,6 @@ subroutine generate_singles_and_doubles(delta_ij_loc, i_generator, bitmask_index allocate(counted(mo_tot_num, mo_tot_num), countedOrb(mo_tot_num, 2)) allocate (indexes(0:mo_tot_num, 0:mo_tot_num)) allocate (indexes_end(0:mo_tot_num, 0:mo_tot_num)) - maskInd = -1 integer :: nb_count do s1=1,2 do i1=N_holes(s1),1,-1 ! Generate low excitations first diff --git a/plugins/dress_zmq/dress_stoch_routines.irp.f b/plugins/dress_zmq/dress_stoch_routines.irp.f index e26defe4..9abe9095 100644 --- a/plugins/dress_zmq/dress_stoch_routines.irp.f +++ b/plugins/dress_zmq/dress_stoch_routines.irp.f @@ -9,14 +9,14 @@ END_PROVIDER &BEGIN_PROVIDER [ integer, pt2_F, (N_det_generators) ] implicit none pt2_F(:) = 1 - pt2_F(:N_det_generators/100+1) = 5 + !pt2_F(:N_det_generators/1000*0+50) = 1 pt2_n_tasks_max = N_det_generators/100 + 1 if(N_det_generators < 256) then pt2_minDetInFirstTeeth = 1 pt2_N_teeth = 1 else - pt2_minDetInFirstTeeth = 5 + pt2_minDetInFirstTeeth = min(5, N_det_generators) pt2_N_teeth = 16 end if END_PROVIDER @@ -24,7 +24,7 @@ END_PROVIDER BEGIN_PROVIDER[ integer, dress_N_cp_max ] - dress_N_cp_max = 100 + dress_N_cp_max = 32 END_PROVIDER BEGIN_PROVIDER[integer, pt2_J, (N_det_generators)] @@ -79,10 +79,19 @@ END_PROVIDER N_c = 0 N_j = pt2_n_0(1) d(:) = .false. - + + U = min(1, N_det_generators/(dress_N_cp_max**2/2)) do i=1,dress_N_cp_max-1 - dress_M_m(i) = N_det_generators * i / (dress_N_cp_max+1) + dress_M_m(i) = U * ((i**2-i)/2)! / (dress_N_cp_max+1) end do + + + + U = N_det_generators/((dress_N_cp_max**2+dress_N_cp_max)/2)+1 + do i=1, dress_N_cp_max + dress_M_m(i) = U * (((i*i)+i)/2) + end do + dress_M_m(1) = 1 dress_M_m(dress_N_cp_max) = N_det_generators+1 @@ -144,7 +153,6 @@ END_PROVIDER end do end do !!!!!!!!!!!!! - END_PROVIDER diff --git a/plugins/dress_zmq/run_dress_slave.irp.f b/plugins/dress_zmq/run_dress_slave.irp.f index b3341093..899cc3cf 100644 --- a/plugins/dress_zmq/run_dress_slave.irp.f +++ b/plugins/dress_zmq/run_dress_slave.irp.f @@ -37,7 +37,9 @@ subroutine run_dress_slave(thread,iproce,energy) double precision :: fac double precision :: ending(1) integer, external :: zmq_get_dvector - +! double precision, external :: omp_get_wtime +double precision :: time, time0 + if(iproce /= 0) stop "RUN DRESS SLAVE is OMP" allocate(delta_det(N_states, N_det, 0:pt2_N_teeth+1, 2)) @@ -71,7 +73,8 @@ subroutine run_dress_slave(thread,iproce,energy) !$OMP PRIVATE(breve_delta_m, task, task_id) & !$OMP PRIVATE(tmp,fac,m,l,t,sum_f,n_tasks) & !$OMP PRIVATE(i,p,will_send, i_generator, subset, iproc) & - !$OMP PRIVATE(zmq_to_qp_run_socket, zmq_socket_push, worker_id) + !$OMP PRIVATE(zmq_to_qp_run_socket, zmq_socket_push, worker_id) & + !$OMP PRIVATE(time, time0) zmq_to_qp_run_socket = new_zmq_to_qp_run_socket() zmq_socket_push = new_zmq_push_socket(thread) call connect_to_taskserver(zmq_to_qp_run_socket,worker_id,thread) @@ -80,7 +83,6 @@ subroutine run_dress_slave(thread,iproce,energy) call end_zmq_push_socket(zmq_socket_push,thread) stop "WORKER -1" end if - iproc = omp_get_thread_num()+1 allocate(breve_delta_m(N_states,N_det,2)) @@ -132,9 +134,10 @@ subroutine run_dress_slave(thread,iproce,energy) breve_delta_m(:,:,:) = 0d0 call generator_start(i_generator, iproc) - - call alpha_callback(breve_delta_m, i_generator, subset, pt2_F(i_generator)*0 + 1, iproc) - + time0 = omp_get_wtime() + call alpha_callback(breve_delta_m, i_generator, subset, pt2_F(i_generator), iproc) + time = omp_get_wtime() + !print '(I0.11, I4, A12, F12.3)', i_generator, subset, "GREPMETIME", time-time0 t = dress_T(i_generator) call omp_set_lock(lck_det(t))