Don’t call MPI_Type_free after MPI_Finalize
Vector2
, Vector3
and Matrix3
define their own MPITrait::type
functions that return an MPI_Datatype
for them. It is created the first time the function is called and put into a static variable. It is therefore destroyed after the main()
function exits, which is usually after MPI_Finalize
has been called. Freeing the MPI_Datatype
is therefore not possible and mpi::Datatype
cannot be used.
Reported by @stewart.