WIP: Concurrent hydro interactions via particle-carried spin locks
Here is a first-draft implementation of the atomic tasks for the hydro scheme.
To simplify things, each particle carries a lock and we try to acquire it in the tasks when we identify that a given particle will be updated. This reduces the amount of unnecessary locking of an entire array of particles when for instance writing back from a cache.
Thoughts welcome on this! It does yield the correct answer and is a bit faster. Only a bit as the hydro was already pretty good. @pdraper any thoughts from you as well on this?
Note for self: Need to deal with MPI. Probably by re-initialising the lock upon receiving the data.
Edited by Matthieu Schaller