aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortradke <tradke@10716dce-81a3-4424-a2c8-48026a0d3035>2000-09-25 13:59:37 +0000
committertradke <tradke@10716dce-81a3-4424-a2c8-48026a0d3035>2000-09-25 13:59:37 +0000
commit5920d3da1b899c54dd6e30eb8dfab22c7823eac3 (patch)
tree50e005cfad22ef863f6b839711d5093a507207ef
parent97bf19361e4c738bd094d9bfc750e21153569ea0 (diff)
Fixing memory leak for multiprocesor case.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGH/PUGHSlab/trunk@36 10716dce-81a3-4424-a2c8-48026a0d3035
-rw-r--r--src/Hyperslab.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/Hyperslab.c b/src/Hyperslab.c
index 79930ec..b540131 100644
--- a/src/Hyperslab.c
+++ b/src/Hyperslab.c
@@ -795,16 +795,22 @@ int Hyperslab_GetHyperslab (cGH *GH, int target_proc, int vindex, int vtimelvl,
/* collect the hyperslab chunks from all processors */
if (target_proc < 0)
{
- CACTUS_MPI_ERROR (MPI_Allgatherv (*hdata_ptr, totals_local, mpi_vtype,
+ CACTUS_MPI_ERROR (MPI_Allgatherv (hdata_local, totals_local, mpi_vtype,
chunked_hdata, recvcnts, displs, mpi_vtype, comm));
}
else
{
- CACTUS_MPI_ERROR (MPI_Gatherv (*hdata_ptr, totals_local, mpi_vtype,
+ CACTUS_MPI_ERROR (MPI_Gatherv (hdata_local, totals_local, mpi_vtype,
chunked_hdata, recvcnts, displs, mpi_vtype,
target_proc, comm));
}
+ /* free the processor-local chunk */
+ if (hdata_local)
+ {
+ free (hdata_local);
+ }
+
/* Now we got the global hyperslab data in a chunked array.
The user wants it unchunked, so let's sort it... */
if (target_proc < 0 || target_proc == myproc)