Skip to content

EAGLE_25 Bug with runner_dopair1_density_vec

The output of EAGLE_25 when the code is vectorised does not agree with the un-vectorised code after 815 steps. The timesteps change, but the code continues to completion anyway.

I noticed that when I find the first pi and last pj particle I was using their own smoothing lengths to calculate the limits:

  int active_id = ci->count - 1; 
  for (int k = ci->count - 1; k >= 0; k--) {
    p = &parts_i[sort_i[k].i];
    h = p->h;
    d = sort_i[k].d + h * kernel_gamma + dx_max - rshift;

    max_di[k] = d; 

    /* If the particle is out of range set the index to
     * the last active particle within range. */
    if (d < dj_min) {
      //first_pi = active_id;
      first_pi = k; 
      break;
    } else {
      if (part_is_active(p, e)) active_id = k; 
    }    
  }

instead of hi_max and hj_max:

  int active_id = ci->count - 1; 
  for (int k = ci->count - 1; k >= 0; k--) {
    p = &parts_i[sort_i[k].i];
    d = sort_i[k].d + hi_max + dx_max;

    max_di[k] = d; 

    /* If the particle is out of range set the index to
     * the last active particle within range. */
    if (d < dj_min) {
      //first_pi = active_id;
      first_pi = k; 
      break;
    } else {
      if (part_is_active(p, e)) active_id = k; 
    }    
  }
To upload designs, you'll need to enable LFS and have an admin enable hashed storage. More information