aboutsummaryrefslogtreecommitdiff
path: root/src/Hyperslab.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/Hyperslab.c')
-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)