Integrated H5Part regression test and fixed numerous errors that it discovered.
Finished integrating H5Block and the Fortran interface (untested). Started adding an H5Block regression test with a few simple tests (all pass). Added automatic detection of stripe information on lustre, and config option to compile against lustre API. Moved buffers for H5Block ghost zone disolving out of the file handle and into the h5b_3d_set_view function. Fixed bug with pointers in the H5Fed file data not being initialized to NULL.
This commit is contained in:
+21
-5
@@ -4,18 +4,18 @@
|
||||
|
||||
OBJEXT=o
|
||||
|
||||
HDFLIB = -L@HDF5ROOT@/lib -lhdf5 -lz @SZLIB@
|
||||
H5LIB = -L../src/lib -lH5hutC -lH5core
|
||||
HDFLIB = -L@HDF5ROOT@/lib -lhdf5 -lz @SZLIB@ -lm
|
||||
H5LIB = -L../src/lib -lH5hutC -lH5hut
|
||||
LIBS = $(H5LIB) $(HDFLIB) @MPILIB@
|
||||
|
||||
INCLUDES = -I../src/include -I@HDF5ROOT@/include @MPIINC@
|
||||
|
||||
noinst_PROGRAMS = h5u_test
|
||||
noinst_PROGRAMS = h5u_test h5b_test
|
||||
|
||||
TESTS_ENVIRONMENT = env LD_LIBRARY_PATH=@HDF5ROOT@/lib:$(LD_LIBRARY_PATH)
|
||||
TESTS = h5u_test
|
||||
TESTS = h5u_test h5b_test
|
||||
|
||||
EXTRA_PROGRAMS = h5u_test
|
||||
EXTRA_PROGRAMS = h5u_test h5b_test
|
||||
|
||||
h5u_test_SOURCES = \
|
||||
h5u_test.c \
|
||||
@@ -25,6 +25,22 @@ h5u_test_SOURCES = \
|
||||
testframe.h \
|
||||
params.h
|
||||
|
||||
h5u_test_DEPENDENCIES = \
|
||||
../src/lib/libH5hut.a \
|
||||
../src/lib/libH5hutC.a
|
||||
|
||||
h5b_test_SOURCES = \
|
||||
h5b_test.c \
|
||||
h5b_write.c \
|
||||
h5b_read.c \
|
||||
testframe.c \
|
||||
testframe.h \
|
||||
params.h
|
||||
|
||||
h5b_test_DEPENDENCIES = \
|
||||
../src/lib/libH5hut.a \
|
||||
../src/lib/libH5hutC.a
|
||||
|
||||
clean: clean-am
|
||||
rm -f *.h5
|
||||
|
||||
|
||||
+197
@@ -0,0 +1,197 @@
|
||||
#include <stdlib.h>
|
||||
#include <string.h>
|
||||
#include "testframe.h"
|
||||
#include "params.h"
|
||||
|
||||
static void
|
||||
test_read_field_attribs(
|
||||
h5_file_t *file,
|
||||
const char *field_name,
|
||||
int position)
|
||||
{
|
||||
h5_err_t status;
|
||||
char name[ATTR_NAME_SIZE];
|
||||
char str[ATTR_NAME_SIZE];
|
||||
h5_int32_t i32;
|
||||
h5_int64_t i64;
|
||||
h5_float32_t f32;
|
||||
h5_float64_t f64;
|
||||
|
||||
TEST("Reading field attributes");
|
||||
|
||||
i64 = H5BlockGetNumFieldAttribs(file, field_name);
|
||||
VALUE(i64 % 5, 0, "file attribute count");
|
||||
|
||||
get_attr_name(name, "str", position);
|
||||
status = H5BlockReadFieldAttribString(
|
||||
file, field_name, name, str);
|
||||
RETURN(status, H5_SUCCESS, "H5BlockReadFieldAttribString");
|
||||
SVALUE(str, ATTR_STR_VAL, "string attribute");
|
||||
|
||||
get_attr_name(name, "i32", position);
|
||||
status = H5BlockReadFieldAttribInt32(
|
||||
file, field_name, name, &i32);
|
||||
RETURN(status, H5_SUCCESS, "H5BlockReadFieldAttribInt32");
|
||||
IVALUE(i32, ATTR_INT32_VAL, "int32 attribute");
|
||||
|
||||
get_attr_name(name, "i64", position);
|
||||
status = H5BlockReadFieldAttribInt64(
|
||||
file, field_name, name, &i64);
|
||||
RETURN(status, H5_SUCCESS, "H5BlockReadFieldAttribInt64");
|
||||
IVALUE(i64, ATTR_INT64_VAL, "int64 attribute");
|
||||
|
||||
get_attr_name(name, "f32", position);
|
||||
status = H5BlockReadFieldAttribFloat32(
|
||||
file, field_name, name, &f32);
|
||||
RETURN(status, H5_SUCCESS, "H5BlockReadFieldAttribFloat32");
|
||||
FVALUE(f32, ATTR_FLOAT_VAL, "float32 attribute");
|
||||
|
||||
get_attr_name(name, "f64", position);
|
||||
status = H5BlockReadFieldAttribFloat64(
|
||||
file, field_name, name, &f64);
|
||||
RETURN(status, H5_SUCCESS, "H5BlockReadFieldAttribFloat64");
|
||||
FVALUE(f64, ATTR_FLOAT_VAL, "float64 attribute");
|
||||
}
|
||||
|
||||
static void
|
||||
test_read_data64(h5_file_t *file, int step)
|
||||
{
|
||||
extern h5_size_t layout[6];
|
||||
|
||||
int i,t;
|
||||
int rank, nprocs;
|
||||
h5_err_t status;
|
||||
h5_int64_t val, type[2];
|
||||
char name[4];
|
||||
h5_size_t field_rank[2], field_dims[6], elem_rank[2];
|
||||
|
||||
double *e;
|
||||
double *ex,*ey,*ez;
|
||||
h5_int64_t *id;
|
||||
|
||||
const size_t nelems =
|
||||
(layout[1] - layout[0] + 1) *
|
||||
(layout[3] - layout[2] + 1) *
|
||||
(layout[5] - layout[4] + 1);
|
||||
|
||||
e=(double*)malloc(nelems*sizeof(double));
|
||||
ex=(double*)malloc(nelems*sizeof(double));
|
||||
ey=(double*)malloc(nelems*sizeof(double));
|
||||
ez=(double*)malloc(nelems*sizeof(double));
|
||||
id=(h5_int64_t*)malloc(nelems*sizeof(h5_int64_t));
|
||||
|
||||
TEST("Verifying dataset info");
|
||||
|
||||
#if PARALLEL_IO
|
||||
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
|
||||
MPI_Comm_size(MPI_COMM_WORLD, &nprocs);
|
||||
#else
|
||||
nprocs = 1;
|
||||
rank = 2;
|
||||
#endif
|
||||
|
||||
status = H5SetStep(file, step);
|
||||
RETURN(status, H5_SUCCESS, "H5SetStep");
|
||||
|
||||
val = H5BlockGetNumFields(file);
|
||||
IVALUE(val, 3, "field count");
|
||||
|
||||
for (i=0; i<3; i++) {
|
||||
status = H5BlockGetFieldInfo(
|
||||
file, i, name, 4,
|
||||
field_rank, field_dims, elem_rank, type);
|
||||
RETURN(status, H5_SUCCESS, "H5BlockGetFieldInfo");
|
||||
|
||||
status = H5BlockGetFieldInfoByName(
|
||||
file, name,
|
||||
field_rank+1, field_dims+3, elem_rank+1, type+1);
|
||||
RETURN(status, H5_SUCCESS, "H5BlockGetFieldInfoByName");
|
||||
IVALUE(field_rank[0], field_rank[1], "field rank");
|
||||
IVALUE(field_dims[0], field_dims[3], "field dims x");
|
||||
IVALUE(field_dims[1], field_dims[4], "field dims y");
|
||||
IVALUE(field_dims[2], field_dims[5], "field dims z");
|
||||
IVALUE(elem_rank[0], elem_rank[1], "elem rank");
|
||||
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");
|
||||
if (i==1) {
|
||||
CVALUE(name[0], 'e', "field name");
|
||||
IVALUE(elem_rank[0], 1, "elem rank");
|
||||
IVALUE(type[0], H5_FLOAT64_T, "field type");
|
||||
} else if (i==0) {
|
||||
CVALUE(name[0], 'E', "field name");
|
||||
IVALUE(elem_rank[0], 3, "elem rank");
|
||||
IVALUE(type[1], H5_FLOAT64_T, "field type");
|
||||
} else if (i==2) {
|
||||
CVALUE(name[0], 'i', "field name");
|
||||
IVALUE(elem_rank[0], 1, "elem rank");
|
||||
IVALUE(type[1], H5_INT64_T, "field type");
|
||||
}
|
||||
}
|
||||
|
||||
#if PARALLEL_IO
|
||||
TEST("Setting throttle");
|
||||
status = H5SetThrottle(file, 3);
|
||||
RETURN(status, H5_SUCCESS, "H5SetThrottle");
|
||||
#endif
|
||||
|
||||
TEST("Reading 64-bit data");
|
||||
|
||||
for (t=step; t<step+NTIMESTEPS; t++)
|
||||
{
|
||||
val = H5HasStep(file, t);
|
||||
IVALUE(val, 1, "has step");
|
||||
|
||||
status = H5SetStep(file, t);
|
||||
RETURN(status, H5_SUCCESS, "H5SetStep");
|
||||
|
||||
test_read_field_attribs(file, "e", t);
|
||||
|
||||
status = H5Block3dSetView(file,
|
||||
layout[0], layout[1],
|
||||
layout[2], layout[3],
|
||||
layout[4], layout[5]);
|
||||
RETURN(status, H5_SUCCESS, "H5Block3dSetView");
|
||||
|
||||
status = H5Block3dReadScalarFieldFloat64(file, "e", e);
|
||||
RETURN(status, H5_SUCCESS, "H5Block3dReadScalarFieldFloat64");
|
||||
|
||||
status = H5Block3dReadVector3dFieldFloat64(file,
|
||||
"E", ex, ey, ez);
|
||||
RETURN(status, H5_SUCCESS,
|
||||
"H5Block3dReadVector3dFieldFloat64");
|
||||
|
||||
status = H5Block3dReadScalarFieldInt64(file, "id", id);
|
||||
RETURN(status, H5_SUCCESS, "H5Block3dReadScalarFieldInt64");
|
||||
|
||||
for (i=0; i<nelems; i++)
|
||||
{
|
||||
FVALUE(e[i] , 0.0 + (double)(i+nelems*t), " e data");
|
||||
FVALUE(ex[i], 0.1 + (double)(i+nelems*t), " ex data");
|
||||
FVALUE(ey[i], 0.2 + (double)(i+nelems*t), " ey data");
|
||||
FVALUE(ez[i], 0.3 + (double)(i+nelems*t), " ez data");
|
||||
IVALUE(id[i], (i+nelems*t), " id data");
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void h5b_test_read1(void)
|
||||
{
|
||||
h5_file_t *file1;
|
||||
|
||||
h5_err_t status;
|
||||
|
||||
TEST("Opening file once, read-only");
|
||||
file1 = H5OpenFile(FILENAME, H5_O_RDONLY, MPI_COMM_WORLD);
|
||||
status = H5CheckFile(file1);
|
||||
RETURN(status, H5_SUCCESS, "H5CheckFile");
|
||||
|
||||
test_read_data64(file1, 1);
|
||||
|
||||
status = H5CloseFile(file1);
|
||||
RETURN(status, H5_SUCCESS, "H5CloseFile");
|
||||
}
|
||||
|
||||
+109
@@ -0,0 +1,109 @@
|
||||
#include <math.h>
|
||||
#include <stdlib.h>
|
||||
#include <H5hut.h>
|
||||
|
||||
#include "testframe.h"
|
||||
#include "params.h"
|
||||
|
||||
/* global */
|
||||
h5_size_t layout[6];
|
||||
|
||||
/* from write.c */
|
||||
void h5b_test_write1(void);
|
||||
|
||||
/* from read.c */
|
||||
void h5b_test_read1(void);
|
||||
|
||||
static int
|
||||
_nth_root_int_divisor (const int m, const int n)
|
||||
{
|
||||
int i, root;
|
||||
double p;
|
||||
|
||||
p = 1.0 / (double)n;
|
||||
root = (int) ceil ( pow ( (double)m, p ) );
|
||||
for (i=root; i<=m; i++)
|
||||
{
|
||||
if (m % i == 0) return i;
|
||||
}
|
||||
|
||||
return i;
|
||||
}
|
||||
|
||||
int main(int argc, char **argv)
|
||||
{
|
||||
extern h5_size_t layout[6];
|
||||
#ifdef PARALLEL_IO
|
||||
MPI_Init(&argc, &argv);
|
||||
|
||||
int procs, rank;
|
||||
MPI_Comm_rank(MPI_COMM_WORLD, &rank);
|
||||
MPI_Comm_size(MPI_COMM_WORLD, &procs);
|
||||
|
||||
if (procs > MAX_MPI_TASKS) {
|
||||
fprintf(stderr,
|
||||
"ERROR: please use <= %d MPI tasks for the test.\n",
|
||||
MAX_MPI_TASKS);
|
||||
exit(EXIT_FAILURE);
|
||||
}
|
||||
|
||||
/* make up a 3D layout */
|
||||
h5_size_t decomp[3];
|
||||
decomp[0] = _nth_root_int_divisor (procs, 3);
|
||||
decomp[1] = _nth_root_int_divisor (procs / decomp[0], 2);
|
||||
decomp[2] = procs / decomp[0] / decomp[1];
|
||||
|
||||
h5_size_t i,j,k;
|
||||
k = rank % decomp[2];
|
||||
j = (rank / decomp[2]) % decomp[1];
|
||||
i = rank / (decomp[2] * decomp[1]);
|
||||
|
||||
layout[0] = i*NBLOCKX;
|
||||
layout[1] = (i+1)*NBLOCKX - 1;
|
||||
layout[2] = j*NBLOCKY;
|
||||
layout[3] = (j+1)*NBLOCKY - 1;
|
||||
layout[4] = k*NBLOCKZ;
|
||||
layout[5] = (k+1)*NBLOCKZ - 1;
|
||||
#else // PARALLEL_IO
|
||||
layout[0] = 0;
|
||||
layout[1] = NBLOCKX - 1;
|
||||
layout[2] = 0;
|
||||
layout[3] = NBLOCKY - 1;
|
||||
layout[4] = 0;
|
||||
layout[5] = NBLOCKZ - 1;
|
||||
#endif
|
||||
|
||||
/* Initialize testing framework */
|
||||
TestInit(argv[0], NULL, NULL);
|
||||
|
||||
/* Tests are generally arranged from least to most complexity... */
|
||||
AddTest("write1", h5b_test_write1, NULL, "Write 64-bit data", NULL);
|
||||
AddTest("read1", h5b_test_read1, NULL, "Read 64-bit data", NULL);
|
||||
|
||||
/* Display testing information */
|
||||
TestInfo(argv[0]);
|
||||
|
||||
/* Parse command line arguments */
|
||||
TestParseCmdLine(argc, argv);
|
||||
|
||||
H5SetVerbosityLevel(GetTestVerbosity());
|
||||
|
||||
/* Perform requested testing */
|
||||
PerformTests();
|
||||
|
||||
/* Display test summary, if requested */
|
||||
if (GetTestSummary())
|
||||
TestSummary();
|
||||
|
||||
/* Clean up test files, if allowed */
|
||||
//if (GetTestCleanup() && !getenv("HDF5_NOCLEANUP"))
|
||||
// TestCleanup();
|
||||
|
||||
#ifdef PARALLEL_IO
|
||||
TestPrintf ("reached end\n");
|
||||
fflush(stdout);
|
||||
MPI_Finalize();
|
||||
#endif
|
||||
return GetTestNumErrs();
|
||||
}
|
||||
|
||||
@@ -0,0 +1,131 @@
|
||||
#include <stdlib.h>
|
||||
#include "testframe.h"
|
||||
#include "params.h"
|
||||
|
||||
static void
|
||||
test_write_field_attribs(
|
||||
h5_file_t *file,
|
||||
const char *field_name,
|
||||
int position)
|
||||
{
|
||||
h5_err_t status;
|
||||
char name[ATTR_NAME_SIZE];
|
||||
|
||||
TEST("Writing field attributes");
|
||||
|
||||
get_attr_name(name, "str", position);
|
||||
status = H5BlockWriteFieldAttribString(
|
||||
file, field_name, name, ATTR_STR_VAL);
|
||||
RETURN(status, H5_SUCCESS, "H5BlockWriteFieldAttribString");
|
||||
|
||||
get_attr_name(name, "i32", position);
|
||||
h5_int32_t i32 = ATTR_INT32_VAL;
|
||||
status = H5BlockWriteFieldAttribInt32(
|
||||
file, field_name, name, &i32, 1);
|
||||
RETURN(status, H5_SUCCESS, "H5BlockWriteFieldAttribInt32");
|
||||
|
||||
get_attr_name(name, "i64", position);
|
||||
h5_int64_t i64 = ATTR_INT64_VAL;
|
||||
status = H5BlockWriteFieldAttribInt64(
|
||||
file, field_name, name, &i64, 1);
|
||||
RETURN(status, H5_SUCCESS, "H5BlockWriteFieldAttribInt64");
|
||||
|
||||
get_attr_name(name, "f32", position);
|
||||
h5_float32_t f32 = ATTR_FLOAT_VAL;
|
||||
status = H5BlockWriteFieldAttribFloat32(
|
||||
file, field_name, name, &f32, 1);
|
||||
RETURN(status, H5_SUCCESS, "H5BlockWriteFieldAttribFloat32");
|
||||
|
||||
get_attr_name(name, "f64", position);
|
||||
h5_float64_t f64 = ATTR_FLOAT_VAL;
|
||||
status = H5BlockWriteFieldAttribFloat64(
|
||||
file, field_name, name, &f64, 1);
|
||||
RETURN(status, H5_SUCCESS, "H5BlockWriteFieldAttribFloat64");
|
||||
}
|
||||
|
||||
static void
|
||||
test_write_data64(h5_file_t *file, int step)
|
||||
{
|
||||
extern h5_size_t layout[6];
|
||||
|
||||
int i,t;
|
||||
h5_int64_t status, val;
|
||||
|
||||
double *e;
|
||||
double *ex,*ey,*ez;
|
||||
h5_int64_t *id;
|
||||
|
||||
const size_t nelems =
|
||||
(layout[1] - layout[0] + 1) *
|
||||
(layout[3] - layout[2] + 1) *
|
||||
(layout[5] - layout[4] + 1);
|
||||
|
||||
e=(double*)malloc(nelems*sizeof(double));
|
||||
ex=(double*)malloc(nelems*sizeof(double));
|
||||
ey=(double*)malloc(nelems*sizeof(double));
|
||||
ez=(double*)malloc(nelems*sizeof(double));
|
||||
id=(h5_int64_t*)malloc(nelems*sizeof(h5_int64_t));
|
||||
|
||||
#if PARALLEL_IO
|
||||
TEST("Setting throttle");
|
||||
status = H5SetThrottle(file, 2);
|
||||
RETURN(status, H5_SUCCESS, "H5SetThrottle");
|
||||
#endif
|
||||
|
||||
TEST("Writing 64-bit data");
|
||||
|
||||
for (t=step; t<step+NTIMESTEPS; t++)
|
||||
{
|
||||
for (i=0; i<nelems; i++)
|
||||
{
|
||||
e[i] = 0.0 + (double)(i+nelems*t);
|
||||
ex[i] = 0.1 + (double)(i+nelems*t);
|
||||
ey[i] = 0.2 + (double)(i+nelems*t);
|
||||
ez[i] = 0.3 + (double)(i+nelems*t);
|
||||
id[i] = i + nelems*t;
|
||||
}
|
||||
|
||||
val = H5HasStep(file, t);
|
||||
|
||||
status = H5SetStep(file, t);
|
||||
RETURN(status, H5_SUCCESS, "H5SetStep");
|
||||
|
||||
if (val == 0) test_write_field_attribs(file, "e", t);
|
||||
|
||||
status = H5Block3dSetView(file,
|
||||
layout[0], layout[1],
|
||||
layout[2], layout[3],
|
||||
layout[4], layout[5]);
|
||||
RETURN(status, H5_SUCCESS, "H5Block3dSetView");
|
||||
|
||||
status = H5Block3dWriteScalarFieldFloat64(file, "e", e);
|
||||
RETURN(status, H5_SUCCESS, "H5Block3dWriteScalarFieldFloat64");
|
||||
|
||||
status = H5Block3dWriteVector3dFieldFloat64(file,
|
||||
"E", ex, ey, ez);
|
||||
RETURN(status, H5_SUCCESS,
|
||||
"H5Block3dWriteVector3dFieldFloat64");
|
||||
|
||||
status = H5Block3dWriteScalarFieldInt64(file, "id", id);
|
||||
RETURN(status, H5_SUCCESS, "H5Block3dWriteScalarFieldInt64");
|
||||
}
|
||||
}
|
||||
|
||||
void h5b_test_write1(void)
|
||||
{
|
||||
h5_file_t *file1;
|
||||
|
||||
h5_err_t status;
|
||||
|
||||
TEST("Opening file once, write-truncate");
|
||||
file1 = H5OpenFile(FILENAME, H5_O_WRONLY, MPI_COMM_WORLD);
|
||||
|
||||
status = H5CheckFile(file1);
|
||||
RETURN(status, H5_SUCCESS, "H5CheckFile");
|
||||
|
||||
test_write_data64(file1, 1);
|
||||
|
||||
status = H5CloseFile(file1);
|
||||
RETURN(status, H5_SUCCESS, "H5CloseFile");
|
||||
}
|
||||
|
||||
+25
-6
@@ -92,10 +92,12 @@ test_read_data64(h5_file_t *file, int nparticles, int step)
|
||||
{
|
||||
int i,t;
|
||||
int rank, nprocs;
|
||||
h5_int64_t status, val, start, end, type, size;
|
||||
h5_err_t status;
|
||||
h5_int64_t val, start, end, type;
|
||||
char name1[4];
|
||||
char name2[8];
|
||||
h5_int64_t indices[8];
|
||||
h5_id_t indices[8];
|
||||
h5_size_t size;
|
||||
|
||||
double *x,*y,*z;
|
||||
double *px,*py,*pz;
|
||||
@@ -194,7 +196,7 @@ test_read_data64(h5_file_t *file, int nparticles, int step)
|
||||
indices[2] = rank*2 + 9;
|
||||
indices[3] = rank*2 + 7;
|
||||
|
||||
status = H5PartSetViewIndices(file, indices, -1);
|
||||
status = H5PartSetViewIndices(file, indices, 0);
|
||||
RETURN(status, H5_SUCCESS, "H5PartSetViewIndices");
|
||||
|
||||
status = H5PartReadDataFloat64(file, "x", x);
|
||||
@@ -226,9 +228,26 @@ test_read_data64(h5_file_t *file, int nparticles, int step)
|
||||
status = H5PartSetCanonicalView(file);
|
||||
RETURN(status, H5_SUCCESS, "H5PartSetCanonicalView");
|
||||
|
||||
status = H5PartReadParticleStep (
|
||||
file, t, x, y, z, px, py, pz, id);
|
||||
RETURN(status, H5_SUCCESS, "H5PartReadParticleStep");
|
||||
status = H5PartReadDataFloat64(file, "x", x);
|
||||
RETURN(status, H5_SUCCESS, "H5PartReadDataFloat64");
|
||||
|
||||
status = H5PartReadDataFloat64(file, "y", y);
|
||||
RETURN(status, H5_SUCCESS, "H5PartReadDataFloat64");
|
||||
|
||||
status = H5PartReadDataFloat64(file, "z", z);
|
||||
RETURN(status, H5_SUCCESS, "H5PartReadDataFloat64");
|
||||
|
||||
status = H5PartReadDataFloat64(file, "px", px);
|
||||
RETURN(status, H5_SUCCESS, "H5PartReadDataFloat64");
|
||||
|
||||
status = H5PartReadDataFloat64(file, "py", py);
|
||||
RETURN(status, H5_SUCCESS, "H5PartReadDataFloat64");
|
||||
|
||||
status = H5PartReadDataFloat64(file, "pz", pz);
|
||||
RETURN(status, H5_SUCCESS, "H5PartReadDataFloat64");
|
||||
|
||||
status = H5PartReadDataInt64(file, "id", id);
|
||||
RETURN(status, H5_SUCCESS, "H5PartReadDataInt64");
|
||||
|
||||
for (i=0; i<nparticles; i++)
|
||||
{
|
||||
|
||||
+11
-15
@@ -41,26 +41,30 @@ test_write_step_attribs(h5_file_t *file, int position)
|
||||
h5_err_t status;
|
||||
char name[ATTR_NAME_SIZE];
|
||||
|
||||
TEST("Writing step attributes");
|
||||
TEST("Writing file attributes");
|
||||
|
||||
get_attr_name(name, "str", position);
|
||||
status = H5WriteStepAttribString(file, name, ATTR_STR_VAL);
|
||||
RETURN(status, H5_SUCCESS, "H5WriteStepAttribString");
|
||||
|
||||
get_attr_name(name, "i32", position);
|
||||
status = H5WriteStepAttribInt32(file, name, ATTR_INT32_VAL, 1);
|
||||
h5_int32_t i32 = ATTR_INT32_VAL;
|
||||
status = H5WriteStepAttribInt32(file, name, &i32, 1);
|
||||
RETURN(status, H5_SUCCESS, "H5WriteStepAttribInt32");
|
||||
|
||||
get_attr_name(name, "i64", position);
|
||||
status = H5WriteStepAttribInt64(file, name, ATTR_INT64_VAL, 1);
|
||||
h5_int64_t i64 = ATTR_INT64_VAL;
|
||||
status = H5WriteStepAttribInt64(file, name, &i64, 1);
|
||||
RETURN(status, H5_SUCCESS, "H5WriteStepAttribInt64");
|
||||
|
||||
get_attr_name(name, "f32", position);
|
||||
status = H5WriteStepAttribFloat32(file, name, ATTR_FLOAT_VAL, 1);
|
||||
h5_float32_t f32 = ATTR_FLOAT_VAL;
|
||||
status = H5WriteStepAttribFloat32(file, name, &f32, 1);
|
||||
RETURN(status, H5_SUCCESS, "H5WriteStepAttribFloat32");
|
||||
|
||||
get_attr_name(name, "f64", position);
|
||||
status = H5WriteStepAttribFloat64(file, name, ATTR_FLOAT_VAL, 1);
|
||||
h5_float64_t f64 = ATTR_FLOAT_VAL;
|
||||
status = H5WriteStepAttribFloat64(file, name, &f64, 1);
|
||||
RETURN(status, H5_SUCCESS, "H5WriteStepAttribFloat64");
|
||||
}
|
||||
|
||||
@@ -82,14 +86,6 @@ test_write_data64(h5_file_t *file, int nparticles, int step)
|
||||
pz=(double*)malloc(nparticles*sizeof(double));
|
||||
id=(h5_int64_t*)malloc(nparticles*sizeof(h5_int64_t));
|
||||
|
||||
/* invalid stride will produce a warning */
|
||||
status = H5PartSetNumParticlesStrided(file, nparticles, -1);
|
||||
RETURN(status, H5_SUCCESS, "H5PartSetNumParticlesStrided");
|
||||
|
||||
/* invalid nparticles will produce an error */
|
||||
status = H5PartSetNumParticlesStrided(file, -1, 2);
|
||||
RETURN(status, H5_ERR_INVAL, "H5PartSetNumParticlesStrided");
|
||||
|
||||
#if PARALLEL_IO
|
||||
TEST("Setting throttle");
|
||||
status = H5SetThrottle(file, 2);
|
||||
@@ -458,8 +454,8 @@ void h5u_test_write4(void)
|
||||
status = H5SetStepNameFormat(file2, LONGNAME, 16);
|
||||
RETURN(status, H5_SUCCESS, "H5SetStepNameFormat");
|
||||
|
||||
status = H5PartSetChunkSize(file1, NPARTICLES);
|
||||
RETURN(status, H5_SUCCESS, "H5PartSetChunkSize");
|
||||
status = H5PartSetChunk(file1, NPARTICLES);
|
||||
RETURN(status, H5_SUCCESS, "H5PartSetChunk");
|
||||
|
||||
test_write_data64(file1, NPARTICLES, NTIMESTEPS-2);
|
||||
test_write_file_attribs(file1, 1);
|
||||
|
||||
@@ -9,6 +9,10 @@
|
||||
* made in the read tests! */
|
||||
#define NPARTICLES 99
|
||||
|
||||
#define NBLOCKX 16
|
||||
#define NBLOCKY 12
|
||||
#define NBLOCKZ 18
|
||||
|
||||
/* do not increase this value past 32! */
|
||||
#define MAX_MPI_TASKS 32
|
||||
|
||||
|
||||
Reference in New Issue
Block a user