aboutsummaryrefslogtreecommitdiff
path: root/src/DumpUtils.c
diff options
context:
space:
mode:
authortradke <tradke@7842ec3a-9562-4be5-9c5b-06ba18f2b668>2002-04-25 16:32:38 +0000
committertradke <tradke@7842ec3a-9562-4be5-9c5b-06ba18f2b668>2002-04-25 16:32:38 +0000
commitb907c48d24adbe52c9bf42c19910ac7dea216141 (patch)
treec07b3a62409105de5fef05dce6006a98dd750079 /src/DumpUtils.c
parent86efd4ed7ecad93bc76677f49ba5c3cf1bced5c7 (diff)
Switch to the new hyperslabbing API.
git-svn-id: http://svn.cactuscode.org/arrangements/CactusPUGHIO/IOHDF5Util/trunk@60 7842ec3a-9562-4be5-9c5b-06ba18f2b668
Diffstat (limited to 'src/DumpUtils.c')
-rw-r--r--src/DumpUtils.c30
1 files changed, 16 insertions, 14 deletions
diff --git a/src/DumpUtils.c b/src/DumpUtils.c
index 4ab5688..2045d1a 100644
--- a/src/DumpUtils.c
+++ b/src/DumpUtils.c
@@ -56,6 +56,7 @@ CCTK_FILEVERSION(BetaThorns_IOHDF5Util_DumpUtils_c)
int IOHDF5Util_DumpGH (const cGH *GH, const int *timers, hid_t file)
{
int first_vindex, gindex, timelevels, retval;
+ int *extent_int;
cGroup gdata;
ioSlab slab;
DECLARE_CCTK_PARAMETERS
@@ -65,21 +66,17 @@ int IOHDF5Util_DumpGH (const cGH *GH, const int *timers, hid_t file)
/* set up a hyperslab description for full hyperslabs */
slab.vdim = CCTK_MaxDim ();
- slab.vectors = (CCTK_INT *) calloc (slab.vdim + 6,
- slab.vdim * sizeof(CCTK_INT));
+ slab.vectors = (CCTK_INT *) calloc ((slab.vdim + 6)*slab.vdim + 1,
+ sizeof(CCTK_INT));
slab.hoffset = slab.vectors + 0*slab.vdim;
slab.hsize = slab.vectors + 1*slab.vdim;
slab.hsize_chunk = slab.vectors + 2*slab.vdim;
- slab.origin = slab.vectors + 3*slab.vdim;
- slab.extent = slab.vectors + 4*slab.vdim;
- slab.downsample = slab.vectors + 5*slab.vdim;
- slab.direction = slab.vectors + 6*slab.vdim;
+ slab.origin = slab.vectors + 3*slab.vdim + 1;
+ slab.extent = slab.vectors + 4*slab.vdim + 1;
+ slab.downsample = slab.vectors + 5*slab.vdim + 1;
+ slab.direction = slab.vectors + 6*slab.vdim + 1;
- for (slab.hdim = 0; slab.hdim < slab.vdim; slab.hdim++)
- {
- slab.extent[slab.hdim] = -1;
- slab.downsample[slab.hdim] = 1;
- }
+ extent_int = (int *) malloc (slab.vdim * sizeof (int));
/* start CP_PARAMETERS_TIMER timer */
if (timers)
@@ -121,20 +118,24 @@ int IOHDF5Util_DumpGH (const cGH *GH, const int *timers, hid_t file)
/* dump all timelevels except the oldest (for multi-level groups) */
CCTK_GroupData (gindex, &gdata);
+ CCTK_GroupgshGI (GH, gdata.dim, extent_int, gindex);
timelevels = gdata.numtimelevels;
if (timelevels > 1)
{
timelevels--;
}
- slab.hdim = slab.vdim = gdata.dim;
+ slab.vdim = gdata.dim;
slab.check_exist = 0;
slab.hdatatype = gdata.vartype;
- /* set the hyperslab directions (orthogonal to all axes) */
- memset (slab.direction, 0, slab.hdim * slab.vdim * sizeof (int));
+ /* set the hyperslab extents, the directions (orthogonal to all axes),
+ and disable downsampling */
+ memset (slab.direction, 0, slab.vdim * slab.vdim * sizeof (int));
for (slab.hdim = 0; slab.hdim < slab.vdim; slab.hdim++)
{
+ slab.extent[slab.hdim] = extent_int[slab.hdim];
slab.direction[slab.hdim * (slab.vdim + 1)] = 1;
+ slab.downsample[slab.hdim] = 1;
}
/* loop over all variables in this group */
@@ -165,6 +166,7 @@ int IOHDF5Util_DumpGH (const cGH *GH, const int *timers, hid_t file)
/* free temporary resources */
free (slab.vectors);
+ free (extent_int);
return (retval);
}