Skip to content
Snippets Groups Projects

Doself2 vectorisation

Merged James Willis requested to merge doself2-vectorisation into master

Implements:

  • runner_doself2_force_vec a vectorised version of the DOSELF2 for force interactions.
  • Updates particle cache with properties needed for force interactions.
  • Vectorised interaction functions for the force using 1 and 2 vectors, which are tested in testInteractions.c

Merge request reports

Loading
Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
438 438
439 439 /**
440 440 * @brief Computes the kernel function and its derivative for two particles
441 * using vectors.
442 *
443 * Return 0 if $u > \\gamma = H/h$
441 * using vectors. Does not return zero if $u > \\gamma = H/h$, should only
442 * be called if particles are known to interact.
444 443 *
  • Not a very clear comment. Particles can interact if dx > h the kernel should then return 0.

    I think what you mean is that the result will be garbage if the function is called with dx > h.

  • Yep haha. Tested for accuracy with EAGLE_12 and EAGLE_25.

  • 438 438
    439 439 /**
    440 440 * @brief Computes the kernel function and its derivative for two particles
    441 * using vectors.
    442 *
    443 * Return 0 if $u > \\gamma = H/h$
    441 * using vectors. Does not return zero if $u > \\gamma = H/h$, should only
    442 * be called if particles are known to interact.
    444 443 *
    • How about:

      /**
      * @brief Computes the kernel function and its derivative for two particles
      * using vectors. The return value is undefined if $u > \\gamma = H/h$, should only
      * be called if particles are known to interact.
  • I have just tried computing the interaction on the fly without the interaction cache and it goes 2.1x faster than the serial. So can we wait before merging it with the master?

  • 438 438
    439 439 /**
    440 440 * @brief Computes the kernel function and its derivative for two particles
    441 * using vectors.
    442 *
    443 * Return 0 if $u > \\gamma = H/h$
    441 * using vectors. Does not return zero if $u > \\gamma = H/h$, should only
    442 * be called if particles are known to interact.
    444 443 *
  • James Willis Added 2 commits:

    Added 2 commits:

    • 3b1777d3 - Pass hj_inv as a vector instead of a pointer.
    • d58babff - Created new version of doself2_vec that computes force interaction on the fly, 2…
  • James Willis Added 2 commits:

    Added 2 commits:

    • a766a9a2 - Removed alternate version of doself2_vec that was slower than current version. R…
    • 1bfcfaf6 - Updated comments.
  • Unable to load the diff
  • James Willis Added 1 commit:

    Added 1 commit:

    • 614928e3 - Removed unneeded force properties in interaction cache.
  • How do you feel about values that cause floating point exceptions but are masked out in the interaction?

  • Does it lead to a crash if you run with -e ?

  • But it produces correct results with EAGLE_12.

  • Ok, but that's not great. Means we can't debug anything with -e anymore since your vectorized code will trigger false positives all the time.

  • Yeah, true. I'll add something to stop it from happening.

  • How about:

    v_r2.v = vec_add(v_r2.v, vec_set1(FLT_MIN));
  • James Willis Added 3 commits:

    Added 3 commits:

  • Won't that make the particles interact ?

  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Loading
  • Please register or sign in to reply
    Loading