Skip to content

Conversation

@lmiq
Copy link

@lmiq lmiq commented Oct 4, 2021

I originally tried to run the Julia benchmark, but the using LinearAlgebra: norm was missing. Then I sort of "julianized" a little bit further the code. What I did is:

  1. Make the functions generic for the dimensions of the particles.
  2. Fused some loops into vectorized operations (just to shorten the code).
  3. Moved the system build-up to the global scope and pass the initial positions, velocities and masses to main(). That way the code is generic and, in principle, dynamic (one can run another simulation with different properties). The code is more flexible in the sense that you don't need to set the dimension and type of points to const anywhere (because these are parameters of main() input variables now).
  4. I have also removed some @inbounds flags and added --check-bounds=no as a flag to the optimized run. (I don't think you have to discount compile time here, it is not relevant for the running time of your test).

Performance-wise there is not significant different relative to the original code, although in Julia 1.6.3 here I get 2 min 10s for the rust implementation vs. 2 min 24s for the Julia one (thus not the big difference reported in the main readme).

Anyway, I was just playing with it, nice repository (do whatever you want with the pull request). If you are interest, I discuss some interesting properties of a Julia particle simulation code here: https://m3g.github.io/2021_FortranCon/

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant