gandalfcode / gandalf

GANDALF (Graphical Astrophysics code for N-body Dynamics And Lagrangian Fluids)
GNU General Public License v2.0
44 stars 12 forks source link

OpenMP locks vs. C++11 atomic min/max #19

Closed dhubber closed 8 years ago

dhubber commented 10 years ago

Have both C++11 atomic min/max operations for min/max reduction when computing timestep levels and OpenMP locks (for older compilers) in the same code but chosen by compiler flags (which is dependent on the compiler or on selected Makefile options).

dhubber commented 8 years ago

I think we have a working solution which I would prefer to leave (since it's simple to understand and should not affect performance), which is essentially each OpenMP thread computes its own min/max and is then combined in a short critical statement (i.e. doing min/max manually). So I'll close this idea now since I don't think there's any need to follow up on it!