From 45ac36d4273f48b6a18e1766e64e247eaebe1c1a Mon Sep 17 00:00:00 2001
From: 13518104 Kevin Austin Stefano <13518104@std.stei.itb.ac.id>
Date: Sat, 6 Mar 2021 10:42:58 +0700
Subject: [PATCH] add in openmpi

---
 src/MST_OpenMPI.c | 6 +++---
 1 file changed, 3 insertions(+), 3 deletions(-)

diff --git a/src/MST_OpenMPI.c b/src/MST_OpenMPI.c
index 72ce1f9..1fe81b8 100644
--- a/src/MST_OpenMPI.c
+++ b/src/MST_OpenMPI.c
@@ -317,11 +317,11 @@ void PreQuickSort (Edge result[], int size, int rank) {
         source = MPI_Get_count(&status, mpi_edge_type, &arr);
         int src = status.MPI_SOURCE;
 
-        temp = (Edge *) malloc (sizeof(Edge) *arr);
+        Edge * temp = (Edge *) malloc (sizeof(Edge) *arr);
         source = MPI_Recv(temp, arr, mpi_edge_type, src, 1, MPI_COMM_WORLD, MPI_STATUS_IGNORE);
         //Impementasiquicksort disini
-        source = MPI_Send(temp, arr, mpi_adge_type, src, 1, MPI_COMM_WORLD);
-        free(arr);
+        source = MPI_Send(temp, arr, mpi_edge_type, src, 1, MPI_COMM_WORLD);
+        free(temp);
     }
 
 }
-- 
GitLab