In the MPI code, we use memory addresses (via MPI_Get_address) to calculate the displacements of each block in the MPI struct. I don't think we should be doing this. Memory addresses are completely different from the byte displacement of each block in an MPI struct (an example of how MPI_Type_create_struct should be used can be found here: https://rookiehpc.org/mpi/docs/mpi_type_create_struct/index.html). I would not be surprised if the struct ends up being an unreasonable size and its contents being discontiguous in memory.
Originally posted by @SeanBryan51 in #591 (comment)