Open VictorForouhar opened 2 months ago
I think it's clearly better to just use the local information that's already there to decide the FoF host. But we also need to know which MPI rank the host is on. Can we determine that locally too?
I agree about the local-based estimate. About the rank hosting the FOF, we would unfortunately not know that, so we might still require some communication.
We could assign hosts locally, and retrieve the rank from one of the tracer particles that belongs to the assigned host, e.g. do https://github.com/SWIFTSIM/HBTplus/blob/20da14b1684d23ce116d770f9a94b7bc23a08863/src/subhalo_tracking.cpp#L338 but only with one particle.
As mentioned in #12, we now update the
HostId
value of particles already belonging to a subhalo. This opens up the possibility of doing host FOF decisions locally, rather than doing MPI communication across all tasks to use the particle hashmap to retrieve the updated value. This would simply involve iterating over the Particle vector and doing the same weighted average as we currently do.An alternative approach is to use John's new method of particle property retrieval to not have to do as many communications (at the moment, the information is requested from all ranks).