anchor.diff:    
     comb_step = 1d0/dfloat(comb_teeth)
     do i=1,N_det_generators
  -    if(weight(i)/norm_left < comb_step/2d0) then
  +    if(weight(i)/norm_left < comb_step/1d1) then
         first_det_of_comb = i
         exit
       end if
  
positive.code:   integer :: tbc(0:N_det_generators)
    integer :: i, Ncomb, generator_per_task, i_generator_end
    integer, external :: pt2_find
    provide nproc
  
    call new_parallel_job(zmq_to_qp_run_socket,"pt2")
    call zmq_put_psi(zmq_to_qp_run_socket,1,ci_electronic_energy,size(ci_electronic_energy))
    call zmq_set_running(zmq_to_qp_run_socket)
    call create_selection_buffer(1, 1*2, b)
     
  
    call random_seed()
  
    computed = .false.
    tbc(0) = first_det_of_comb - 1
    do i=1, tbc(0)
      tbc(i) = i
      computed(i) = .true.
    end do
    print *, "detererminist initial ", tbc(0)+1
    !LOOP?
    call get_carlo_workbatch(1d-3, computed, comb, Ncomb, tbc)
    generator_per_task = tbc(0)/1000 + 1
    print *, "TASK", tbc(0), tbc(1:tbc(0))
    do i=1,tbc(0),generator_per_task
      i_generator_end = min(i+generator_per_task-1, tbc(0))
      !print *, "TASK", (i_generator_end-i+1), tbc(i:i_generator_end)
      write(task,*) (i_generator_end-i+1), tbc(i:i_generator_end)
      call add_task_to_taskserver(zmq_to_qp_run_socket,task)
    end do
    pt2_detail = 0d0
    
    !$OMP PARALLEL DEFAULT(shared)  SHARED(b, pt2)  PRIVATE(i) NUM_THREADS(nproc+1)
      i = omp_get_thread_num()
  
negative.code: 
  BEGIN_PROVIDER [ integer, comb_teeth ]
    implicit none
    comb_teeth = 20
  END_PROVIDER
  
  
  