diff --git a/hpc_mpi/src/hpc_mpi.c b/hpc_mpi/src/hpc_mpi.c index 6c89719..7776d2e 100644 --- a/hpc_mpi/src/hpc_mpi.c +++ b/hpc_mpi/src/hpc_mpi.c @@ -1,10 +1,10 @@ /* ============================================================================ Name : hpc_mpi.c - Author : + Author : Version : Copyright : Your copyright notice - Description : Hello MPI World in C + Description : Hello MPI World in C ============================================================================ */ #include @@ -72,7 +72,10 @@ int Binom_Reduce(const void *sendbuf, void *recvbuf, int count, if (r != root) { MPI_Send(reduced, count, datatype, r - i, i, comm); + MPI_Free_mem(reduced); } + MPI_Free_mem(recv); + return 0; }