This is my attempt at fixing #72. The variable bufferFlag indicates whether communications need to be split and the code executes one of two possible branches depending on the value. In some cases the value varies between MPI ranks, which causes a hang because the communication calls don't match between ranks.
This PR just sets bufferFlag to the maximum value it has across all ranks using an allreduce call. A 150Mpc 2256^3 dmonly box which previously hung on the third snapshot has now produced 25 snapshots without hanging.
This is my attempt at fixing #72. The variable bufferFlag indicates whether communications need to be split and the code executes one of two possible branches depending on the value. In some cases the value varies between MPI ranks, which causes a hang because the communication calls don't match between ranks.
This PR just sets bufferFlag to the maximum value it has across all ranks using an allreduce call. A 150Mpc 2256^3 dmonly box which previously hung on the third snapshot has now produced 25 snapshots without hanging.