anchor.diff:  
   BEGIN_PROVIDER [ integer, comb_teeth ]
     implicit none
  -  comb_teeth = 10
  +  comb_teeth = 20
   END_PROVIDER
   
   
  
positive.code:   !$OMP END PARALLEL
    call end_parallel_job(zmq_to_qp_run_socket, 'pt2')
    double precision :: E0, avg, eqt
    double precision :: sumabove(comb_teeth), sum2above(comb_teeth), Nabove(comb_teeth)
    call do_carlo(tbc, Ncomb, comb, pt2_detail, sumabove, sum2above, Nabove)
    tbc(0) = 0
    !END LOOP?
    integer :: tooth
    !-8.091550677158776E-003
    call get_first_tooth(computed, tooth)
    E0 = sum(pt2_detail(1,:first_det_of_teeth(tooth)-1))
    avg = E0 + (sumabove(tooth) / Nabove(tooth))
    eqt = sqrt(1d0 / (Nabove(tooth)-1) * abs(sum2above(tooth) / Nabove(tooth) - (sumabove(tooth)/Nabove(tooth))**2))
    print *, "PT2 ", avg, "+/-", eqt
    pt2 = 0d0
  end subroutine
  
  
negative.code:   integer :: tbc(0:N_det_generators)
    integer :: i, Ncomb, generator_per_task, i_generator_end
    integer, external :: pt2_find
    
    double precision :: sumabove(comb_teeth), sum2above(comb_teeth), Nabove(comb_teeth)
    double precision, external :: omp_get_wtime 
    double precision :: time0, time
  
    
    provide nproc
  
    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
    pt2_detail = 0d0
  
    time0 = omp_get_wtime()
    print *, "grep - time - avg - err - n_combs"
    do while(.true.)
    
    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 get_carlo_workbatch(1d-3, computed, comb, Ncomb, tbc)
    generator_per_task = tbc(0)/1000 + 1
    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
    
    !$OMP PARALLEL DEFAULT(shared)  SHARED(b, pt2)  PRIVATE(i) NUM_THREADS(nproc+1)
      i = omp_get_thread_num()
  