sekelle / cornerstone-octree

Local and distributed octrees based on Morton codes with halo discovery and exchange with a 3D collision detection algorithm
Other
27 stars 4 forks source link

about `MPI_Allreduce` in updateOctreeGlobalGpu #27

Open UnlimitedR opened 1 month ago

UnlimitedR commented 1 month ago

in this line MPI_Allreduce(counts.data(), counts_reduced.data(), counts.size(), MPI_UNSIGNED, MPI_SUM, MPI_COMM_WORLD); in /include/cstone/tree/update_mpi_gpu.cuh, is counts.size() different among different ranks? it looks so to me.

sekelle commented 3 weeks ago

Hi, counts.size() is identical on all ranks. The function you mention here is for building globally replicated octrees, i.e. the resulting tree is identical on all ranks (and the MPI_Allreduce wouldn't work otherwise).