fixed errors found by regression tests:

the H5Fed file data structure can't be created by >1 MPI task, so it is disabled in parallel mode (for now)
the H5Block3dSetHalo function was inverting the halo radii
the h5b_test wasn't writing the correct data in the halo case
This commit is contained in:
Marc Howison
2010-07-28 21:55:00 +00:00
parent 377af10fb0
commit 6568099f62
11 changed files with 116 additions and 118 deletions
+8 -7
View File
@@ -56,6 +56,7 @@ test_read_field_attribs(
static void
test_read_data64(h5_file_t *file, int step)
{
extern h5_size_t grid[3];
extern h5_size_t layout[6];
int i,t;
@@ -114,9 +115,9 @@ test_read_data64(h5_file_t *file, int step)
IVALUE(type[0], type[1], "field type");
IVALUE(field_rank[0], 3, "field rank");
IVALUE(field_dims[0], NBLOCKX, "field dims x");
IVALUE(field_dims[1], NBLOCKY, "field dims y");
IVALUE(field_dims[2], NBLOCKZ, "field dims z");
IVALUE(field_dims[0], grid[0]*NBLOCKX, "field dims x");
IVALUE(field_dims[1], grid[1]*NBLOCKY, "field dims y");
IVALUE(field_dims[2], grid[2]*NBLOCKZ, "field dims z");
if (i==1) {
CVALUE(name[0], 'e', "field name");
IVALUE(elem_rank[0], 1, "elem rank");
@@ -231,10 +232,10 @@ test_read_data32(h5_file_t *file, int step)
int i;
for (i=0; i<nelems; i++)
{
FVALUE(e[i] , 0.0 + (float)(i+nelems*t), " e data");
FVALUE(ex[i], 0.1 + (float)(i+nelems*t), " ex data");
FVALUE(ey[i], 0.2 + (float)(i+nelems*t), " ey data");
FVALUE(ez[i], 0.3 + (float)(i+nelems*t), " ez data");
FVALUE(e[i] , 0.0f + (float)(i+nelems*t), " e data");
FVALUE(ex[i], 0.1f + (float)(i+nelems*t), " ex data");
FVALUE(ey[i], 0.2f + (float)(i+nelems*t), " ey data");
FVALUE(ez[i], 0.3f + (float)(i+nelems*t), " ez data");
IVALUE(id[i], (i+nelems*t), " id data");
}
}
+1
View File
@@ -8,6 +8,7 @@
/* global */
h5_size_t grid[3];
h5_size_t layout[6];
h5_size_t fields_dims[3];
/* from write.c */
void h5b_test_write1(void);
+14 -8
View File
@@ -116,14 +116,14 @@ test_write_data32(h5_file_t *file, int step)
{
extern h5_size_t grid[3];
int i,t;
int i,j,k,t;
h5_int64_t status, val;
float *e;
float *ex,*ey,*ez;
int *id;
const size_t nelems = NBLOCKX * (NBLOCKY+2) * (NBLOCKZ+4);
size_t nelems = NBLOCKX * (NBLOCKY+2) * (NBLOCKZ+4);
e=(float*)malloc(nelems*sizeof(double));
ex=(float*)malloc(nelems*sizeof(double));
@@ -131,17 +131,23 @@ test_write_data32(h5_file_t *file, int step)
ez=(float*)malloc(nelems*sizeof(double));
id=(int*)malloc(nelems*sizeof(int));
nelems = NBLOCKX * NBLOCKY * NBLOCKZ;
TEST("Writing 32-bit data");
for (t=step; t<step+NTIMESTEPS; t++)
{
for (i=0; i<nelems; i++)
for (k=0; k<NBLOCKZ+4; k++)
for (j=0; j<NBLOCKY+2; j++)
for (i=0; i<NBLOCKX; i++)
{
e[i] = 0.0 + (float)(i+nelems*t);
ex[i] = 0.1 + (float)(i+nelems*t);
ey[i] = 0.2 + (float)(i+nelems*t);
ez[i] = 0.3 + (float)(i+nelems*t);
id[i] = i + nelems*t;
int idx = i + j*NBLOCKX + k*NBLOCKX*(NBLOCKY+2);
int n = i + (j-1)*NBLOCKX + (k-2)*NBLOCKX*NBLOCKY;
e[idx] = 0.0f + (float)(n+nelems*t);
ex[idx] = 0.1f + (float)(n+nelems*t);
ey[idx] = 0.2f + (float)(n+nelems*t);
ez[idx] = 0.3f + (float)(n+nelems*t);
id[idx] = n + nelems*t;
}
val = H5HasStep(file, t);