Closed jchelly closed 4 years ago
Hi John, I'll merge this pull request despite there still being a lingering bug somewhere unless you advise otherwise. I'll wait till tomorrow night before merging.
Thanks, that's fine by me if you think these changes look ok. I'd be more confident about them if I could get correct output. I'm not sure if the remaining problem(s) are here or in swift or if one of my 'fixes' is wrong.
When running Velociraptor on the fly in Swift the group index of each particle is written to a dataset in the snapshot file. This output is wrong in the current master versions of swift and velociraptor. Only a small fraction of particles in one corner of the box get assigned group indexes.
So far I believe I've found one bug in swift (see https://gitlab.cosma.dur.ac.uk/swift/swiftsim/merge_requests/1116) and two in velociraptor (this pull request) which contribute to this problem. With the changes in these two pull requests the output looks a bit more plausible but it's still wrong.
The velociraptor bugs I've spotted are:
In swiftinterface.cxx just before the call to MPISwiftExchange the particles are sorted. It looks as though particles to be exported should be put at the end of the particle array but the code puts them at the start.
I also added a check to make sure particles have been returned to the right MPI task. This check now passes, but there's still something wrong somewhere.