Get the free out of the #ifndef LEAK and your problem will be solved.for (int i = 0; i< 10000000; i++) { MPI_Datatype type; assert( MPI_Type_contiguous( 10 * sizeof(double), MPI_BYTE, &type ) == MPI_SUCCESS );#ifndef LEAK assert(MPI_Type_commit(&type) == MPI_SUCCESS); assert(MPI_Type_free(&type) == MPI_SUCCESS); #endif }
Thanks, so it's a feature. A bit surprising though since usually local variables are deallocated automatically.
Ilja