diff --git a/plugins/Full_CI_ZMQ/run_selection_slave.irp.f b/plugins/Full_CI_ZMQ/run_selection_slave.irp.f index cbc62ee4..3a9f7a96 100644 --- a/plugins/Full_CI_ZMQ/run_selection_slave.irp.f +++ b/plugins/Full_CI_ZMQ/run_selection_slave.irp.f @@ -59,8 +59,8 @@ subroutine run_selection_slave(thread,iproc,energy) end do if(ctask > 0) then call sort_selection_buffer(buf) - call push_selection_results(zmq_socket_push, pt2, buf, task_id(1), ctask) call merge_selection_buffers(buf,buf2) + call push_selection_results(zmq_socket_push, pt2, buf, task_id(1), ctask) buf%mini = buf2%mini pt2 = 0d0 buf%cur = 0 diff --git a/plugins/Full_CI_ZMQ/selection_buffer.irp.f b/plugins/Full_CI_ZMQ/selection_buffer.irp.f index 33deb7ac..4dd0f90a 100644 --- a/plugins/Full_CI_ZMQ/selection_buffer.irp.f +++ b/plugins/Full_CI_ZMQ/selection_buffer.irp.f @@ -64,6 +64,10 @@ subroutine merge_selection_buffers(b1, b2) i2=1 do while (b1%val(b1%cur) > b2%mini) b1%cur = b1%cur-1 + if (b1%cur == 0) then + b1%cur = 1 + return + endif enddo do i=1,nmwen if ( (i1 > b1%cur).and.(i2 > b2%cur) ) then