anchor.diff:               if(n_photons_curr > n_photons_tot) stop "n_photons_curr > n_photons_tot"
   
                ! Find how many photons to request and increment counter
  -             if(n_photons_tot - n_photons_curr <= n_photons_chunk*2_idp) then
  -                n_photons_send(ir) = n_photons_chunk / 10_idp
  +             if(n_photons_tot - n_photons_curr <= n_photons_chunk * nproc) then
  +                n_photons_send(ir) = nint(real(n_photons_chunk, dp) / 10._dp)
                else
                   n_photons_send(ir) = n_photons_chunk
                end if
  +
  +             if(n_photons_curr + n_photons_send(ir) > n_photons_tot) n_photons_send(ir) = n_photons_tot - n_photons_curr
  +
                n_photons_curr = n_photons_curr + n_photons_send(ir)
   
                ! Send number of photons and initialize receive for status check
  
positive.code:        else
  
            ! Set number of photons to a fraction of the normal chunk size
            n_photons = n_photons_chunk / 10_idp
            n_photons_curr = n_photons_curr + n_photons
  
         end if
  
         if(first) first=.false.       
  
         if(mod(n_photons_curr,n_photons_chunk)==0) call perf_numbers(n_photons_curr, time_curr)
  
      case default
  
  
negative.code:   public :: mp_set_random_seed
  
    real(dp) :: time_curr
    integer(idp) :: n_completed, n_photons_chunk
    integer(idp) :: n_steps = 10
    integer(idp) :: n_stats_last
  
  contains
  
  