diff options
Diffstat (limited to 'src/Hyperslab.c')
-rw-r--r-- | src/Hyperslab.c | 23 |
1 files changed, 12 insertions, 11 deletions
diff --git a/src/Hyperslab.c b/src/Hyperslab.c index 5812c1a..040c9ab 100644 --- a/src/Hyperslab.c +++ b/src/Hyperslab.c @@ -702,7 +702,7 @@ int Hyperslab_GetLocalHyperslab (const cGH *GH, @endvar @@*/ int Hyperslab_GetHyperslab (const cGH *GH, - int target_proc, + int dst_proc, int vindex, int vtimelvl, int hdim, @@ -739,14 +739,14 @@ int Hyperslab_GetHyperslab (const cGH *GH, /* get processor information */ myproc = CCTK_MyProc (GH); nprocs = CCTK_nProcs (GH); - if (target_proc >= nprocs) + if (dst_proc >= nprocs) { - CCTK_WARN (1, "Invalid target processor ID"); + CCTK_WARN (1, "Invalid destination processor ID"); return (-1); } - /* target processors must pass pointers to where to store the results */ - if (target_proc < 0 || target_proc == myproc) + /* destination processors must pass pointers to where to store the results */ + if (dst_proc < 0 || dst_proc == myproc) { if (! hdata || ! hsize) { @@ -795,7 +795,7 @@ int Hyperslab_GetHyperslab (const cGH *GH, mapping = Hyperslab_DefineGlobalMappingByIndex (GH, vindex, 1,my_directions, my_global_origin,my_extents, my_downsample_, -1, - target_proc, NULL,my_hsize); + NULL, my_hsize); /* convert result back into int */ hsize[0] = my_hsize[0]; @@ -807,7 +807,8 @@ int Hyperslab_GetHyperslab (const cGH *GH, if (hsize[0] > 0) { *hdata = malloc (hsize[0] * CCTK_VarTypeSize (vinfo.vartype)); - retval = Hyperslab_Get (GH, mapping, vindex, 0, vinfo.vartype, *hdata); + retval = Hyperslab_Get (GH, mapping, dst_proc, vindex, 0, + vinfo.vartype, *hdata); } else { @@ -897,7 +898,7 @@ int Hyperslab_GetHyperslab (const cGH *GH, } vtypesize = CCTK_VarTypeSize (vinfo.vartype); - if (target_proc < 0 || target_proc == myproc) + if (dst_proc < 0 || dst_proc == myproc) { /* copy dimensions for the returned hyperslab */ memcpy (hsize, hsize_global, hdim * sizeof (int)); @@ -940,7 +941,7 @@ int Hyperslab_GetHyperslab (const cGH *GH, mpi_vtype = PUGH_MPIDataType (PUGH_pGH (GH), vinfo.vartype); /* collect the hyperslab chunks from all processors */ - if (target_proc < 0) + if (dst_proc < 0) { CACTUS_MPI_ERROR (MPI_Allgatherv (hdata_local, totals_local, mpi_vtype, chunked_hdata, recvcnts, displs, mpi_vtype, comm)); @@ -949,7 +950,7 @@ int Hyperslab_GetHyperslab (const cGH *GH, { CACTUS_MPI_ERROR (MPI_Gatherv (hdata_local, totals_local, mpi_vtype, chunked_hdata, recvcnts, displs, mpi_vtype, - target_proc, comm)); + dst_proc, comm)); } /* free the processor-local chunk */ @@ -960,7 +961,7 @@ int Hyperslab_GetHyperslab (const cGH *GH, /* 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) + if (dst_proc < 0 || dst_proc == myproc) { SortIntoUnchunked (hdim, hsize, totals_global, sizes_global, hdata, chunked_hdata, vtypesize, nprocs); |