tests moved to subdirectories

This commit is contained in:
2008-02-13 15:15:11 +00:00
parent b1f4233cb7
commit bc10ebd64e
4 changed files with 1 additions and 473 deletions
-2
View File
@@ -64,9 +64,7 @@ src/h5/t_openclose.c -text
src/h5/t_readwrite.c -text
src/h5/u_readwrite.c -text
src/h5/u_readwrite.h -text
test/BlockTestSpecs.txt -text
test/H5PartAndreasTest.cc -text
test/H5PartTestParallel.cc -text
test/H5testFpar.f90 -text
test/Makefile.am -text
test/h5b/BlockTestSpecs.txt -text
-189
View File
@@ -1,189 +0,0 @@
Since we have no different version for serial and parallel system,
all tests are compiled for "parallel" systems (which may have only
one processor).
Only one time-step!
* H5BlockWriteScalarField1Proc
- 1 processor
- Write field data "TestField" with dimension sizes
(64, 64, 512) and scalar values:
data[i,j,k] = k + 1000*j + 100000*i
- Set field attribute "TestString" to "42"
- Set field attribute "TestInt64" to 42
- Set field attribute "TestFloat64" to 42.0
- filename: blockfile1.h5
* H5BlockReadScalarField1Proc
- 1 processor
- read file "blockfile1.h5"
- check values of field data
- check values of attributes
* H5BlockWriteScalarField8Procs
- 8 processors
- Write field data "TestField" with dimension sizes
(64, 64, 512) and scalar values:
data[i,j,k] = k + 1000*j + 100000*i + 10000000*proc
- layout:
proc 0: ( 0:63, 0:63, 0: 63)
proc 1: ( 0:63, 0:63, 64:127)
proc 2: ( 0:63, 0:63, 128:191)
proc 3: ( 0:63, 0:63, 192,255)
proc 4: ( 0:63, 0:63, 256:319)
proc 5: ( 0:63, 0:63, 320:383)
proc 6: ( 0:63, 0:63, 384:447)
proc 7: ( 0:63, 0:63, 448:511)
- filename = blockfile2.h5
* H5BlockReadScalarField8Procs
- 8 processors
- read file "blockfile2.h5"
- check values of field data
- layout as above
* H5BlockWriteScalarField8ProcsWithGosts
- 8 processors
- Write field data "TestField" with dimension sizes
(64, 64, 512) and scalar values:
data[i,j,k] = k + 1000*j + 100000*i + 10000000*proc
- layout:
proc 0: ( 0:63, 0:63, 0: 64)
proc 1: ( 0:63, 0:63, 63:128)
proc 2: ( 0:63, 0:63, 127:192)
proc 3: ( 0:63, 0:63, 191,256)
proc 4: ( 0:63, 0:63, 255:320)
proc 5: ( 0:63, 0:63, 319:384)
proc 6: ( 0:63, 0:63, 383:448)
proc 7: ( 0:63, 0:63, 447:511)
- filename: blockfile3.h5
* H5BlockReadScalarField8ProcsWithGostZones
- 8 processors
- read file "blockfile3.h5"
- check values of field data
- layout as above
* H5BlockWriteScalarField16ProcsWithGostZones
- 16 processors
- Write field data "TestField" with dimension sizes
(64, 64, 512) and scalar values:
data[i,j,k] = k + 1000*j + 100000*i + 10000000*proc
- layout:
proc 0: ( 0:63, 0:32, 0: 64)
proc 1: ( 0:63, 31:63, 0: 64)
proc 2: ( 0:63, 0:32, 63:128)
proc 3: ( 0:63, 31:63, 63:128)
proc 4: ( 0:63, 0:32, 127:192)
proc 5: ( 0:63, 31:63, 127:192)
proc 6: ( 0:63, 0:32, 191,256)
proc 7: ( 0:63, 31:63, 191,256)
proc 8: ( 0:63, 0:32, 255:320)
proc 9: ( 0:63, 31:63, 255:320)
proc 10: ( 0:63, 0:32, 319:384)
proc 11: ( 0:63, 31:63, 319:384)
proc 12: ( 0:63, 0:32, 383:448)
proc 13: ( 0:63, 31:63, 383:448)
proc 14: ( 0:63, 0:32, 447:511)
proc 15: ( 0:63, 31:63, 447:511)
- filename: blockfile4.h5
* H5BlockReadScalarField16ProcsWithGosts
- 16 processors
- read file "blockfile4.h5"
- check values of field data
- layout as above
* H5BlockWriteScalarField32Procs
- 32 processors
- Write field data "TestField" with dimension sizes
(64, 64, 512) and scalar values:
data[i,j,k] = k + 1000*j + 100000*i + 10000000*proc
- layout:
proc 0: ( 0:31, 0:31, 0: 63)
proc 1: ( 0:31, 32:63, 0: 63)
proc 2: ( 32:63, 0:31, 0: 63)
proc 3: ( 32:63, 32:63, 0: 63)
proc 4: ( 0:31, 0:31, 64:127)
proc 5: ( 0:31, 32:63, 64:127)
proc 6: ( 32:63, 0:31, 64:127)
proc 7: ( 32:63, 32:63, 64:127)
proc 8: ( 0:31, 0:31, 128:191)
proc 9: ( 0:31, 32:63, 128:191)
proc 10: ( 32:63, 0:31, 128:191)
proc 11: ( 32:63, 32:63, 128:191)
proc 12: ( 0:31, 0:31, 192:255)
proc 13: ( 0:31, 32:63, 192:255)
proc 14: ( 32:63, 0:31, 192:255)
proc 15: ( 32:63, 32:63, 192:255)
proc 16: ( 0:31, 0:31, 256:319)
proc 17: ( 0:31, 32:63, 256:319)
proc 18: ( 32:63, 0:31, 256:319)
proc 19: ( 32:63, 32:63, 256:319)
proc 20: ( 0:31, 0:31, 320:383)
proc 21: ( 0:31, 32:63, 320:383)
proc 22: ( 32:63, 0:31, 320:383)
proc 23: ( 32:63, 32:63, 320:383)
proc 24: ( 0:31, 0:31, 384:447)
proc 25: ( 0:31, 32:63, 384:447)
proc 26: ( 32:63, 0:31, 384:447)
proc 27: ( 32:63, 32:63, 384:447)
proc 28: ( 0:31, 0:31, 448:511)
proc 29: ( 0:31, 32:63, 448:511)
proc 30: ( 32:63, 0:31, 448:511)
proc 31: ( 32:63, 32:63, 448:511)
- filename: blockfile5.h5
* H5BlockReadScalarField32Procs
- 32 processors
- read file "blockfile4.h5"
- check values of field data
- layout as above
* H5BlockWriteScalarField32ProcsWithGosts
- 32 processors
- Write field data "TestField" with dimension sizes
(64, 64, 512) and scalar values:
data[i,j,k] = k + 1000*j + 100000*i + 10000000*proc
- layout:
proc 0: ( 0:32, 0:32, 0: 64)
proc 1: ( 0:32, 31:63, 0: 64)
proc 2: ( 31:63, 0:32, 0: 64)
proc 3: ( 31:63, 31:63, 0: 64)
proc 4: ( 0:32, 0:32, 63:128)
proc 5: ( 0:32, 31:63, 63:128)
proc 6: ( 31:63, 0:32, 63:128)
proc 7: ( 31:63, 31:63, 63:128)
proc 8: ( 0:32, 0:32, 127:192)
proc 9: ( 0:32, 31:63, 127:192)
proc 10: ( 31:63, 0:32, 127:192)
proc 11: ( 31:63, 31:63, 127:192)
proc 12: ( 0:32, 0:32, 191:256)
proc 13: ( 0:32, 31:63, 191:256)
proc 14: ( 31:63, 0:32, 191:256)
proc 15: ( 31:63, 31:63, 191:256)
proc 16: ( 0:32, 0:32, 255:320)
proc 17: ( 0:32, 31:63, 255:320)
proc 18: ( 31:63, 0:32, 255:320)
proc 19: ( 31:63, 31:63, 255:320)
proc 20: ( 0:32, 0:32, 319:384)
proc 21: ( 0:32, 31:63, 319:384)
proc 22: ( 31:63, 0:32, 319:384)
proc 23: ( 31:63, 31:63, 319:384)
proc 24: ( 0:31, 0:31, 383:448)
proc 25: ( 0:31, 31:63, 383:448)
proc 26: ( 31:63, 0:31, 383:448)
proc 27: ( 31:63, 31:63, 383:448)
proc 28: ( 0:32, 0:32, 447:511)
proc 29: ( 0:32, 31:63, 447:511)
proc 30: ( 31:63, 0:32, 447:511)
proc 31: ( 31:63, 31:63, 447:511)
filename: blockfile6.h5
* H5BlockReadScalarField32ProcsWithGhosts
- 32 processors
- read file "blockfile6.h5"
- check values of field data
- layout as above
-120
View File
@@ -1,120 +0,0 @@
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#include <hdf5.h>
#include "H5Part.h"
#ifdef PARALLEL_IO
/*
This regression test is used to ensure parallel I/O is
working correctly and that Views are working for
parallel reads.
*/
int main(int argc,char *argv[]){
const int sz=5000;
double *x,*y,*z;
h5part_int64_t *id;
char name[64];
H5PartFile *file;
int i,t,nt,nds;
int nprocs,myproc;
hid_t gid;
MPI_Comm comm=MPI_COMM_WORLD;
MPI_Init(&argc,&argv);
MPI_Comm_size(comm,&nprocs);
MPI_Comm_rank(comm,&myproc);
x=(double*)malloc(sz*nprocs*sizeof(double));
y=(double*)malloc(sz*nprocs*sizeof(double));
z=(double*)malloc(sz*nprocs*sizeof(double));
id=(h5part_int64_t*)malloc(sz*nprocs*sizeof(h5part_int64_t));
/* parallel file creation */
file=H5PartOpenFileParallel("parttest.h5",H5PART_WRITE,comm);
if(!file) {
perror("File open failed: exiting!");
exit(0);
}
for(t=0;t<5;t++){
MPI_Barrier(comm);
for(i=0;i<sz;i++) {
x[i]=(double)(i+t)+10.0*(double)myproc;
y[i]=0.1 + (double)(i+t);
z[i]=0.2 + (double)(i+t*10);
id[i]=i+sz*myproc;
}
printf("Proc[%u] Writing timestep %u\n",myproc,t);
if(t==0){
printf("Proc[%u]: data values x[first,last]=%f:%f y[%u:%u]=%f:%f z[:]=%f:%f id[:]=%f:%f\n",
myproc,x[0],x[sz-1],0,sz-1,y[0],y[sz-1],z[0],z[sz-1],(int)id[0],(int)id[sz-1]);
}
H5PartSetStep(file,t); /* must set the current timestep in file */
H5PartSetNumParticles(file,sz); /* then set number of particles to store */
/* now write different tuples of data into this timestep of the file */
H5PartWriteDataFloat64(file,"x",x);
H5PartWriteDataFloat64(file,"y",y);
H5PartWriteDataFloat64(file,"z",z);
H5PartWriteDataFloat64(file,"px",x);
H5PartWriteDataFloat64(file,"py",y);
H5PartWriteDataFloat64(file,"pz",z);
H5PartWriteDataInt64(file,"id",id);
}
printf("AllDone p[%u]\n",myproc);
H5PartCloseFile(file);
MPI_Barrier(comm);
printf("p[%u:%u] : OK, close file and reopen for reading\n",myproc,nprocs);
file=H5PartOpenFileParallel("parttest.h5",H5PART_READ,comm);
H5PartSetStep(file,0);
unsigned int np,total_np = (int)H5PartGetNumParticles(file);
nt=H5PartGetNumSteps(file); /* get number of steps in file */
nds = H5PartGetNumDatasets(file);
if(myproc==0){
fprintf(stdout,"steps= %u\tdatasets=%u\tparticles= %u\n",
nt,nds,total_np);
}
MPI_Barrier(comm);
/* now lets compute the appropriate idStart and idEnd
for this particular processor */
h5part_int64_t idStart = sz*myproc;
h5part_int64_t idEnd = (sz-1)+sz*myproc;
H5PartSetView(file,idStart,idEnd);
np=H5PartGetNumParticles(file);
printf("Proc[%u]: View=%u:%u : particles= %u\n",
myproc,(int)idStart,(int)idEnd,H5PartGetNumParticles(file));
/* now lets read them and print some out */
H5PartReadDataFloat64(file,"x",x);
H5PartReadDataFloat64(file,"y",y);
H5PartReadDataFloat64(file,"z",z);
H5PartReadDataInt64(file,"id",id);
printf("Proc[%u]: data values x[first,last]=%f:%f y[%u:%u]=%f:%f z[:]=%f:%f id[:]=%f:%f\n",
myproc,x[0],x[sz-1],(int)idStart,(int)idEnd,y[0],y[sz-1],z[0],z[sz-1],(int)id[0],(int)id[sz-1]);
/* H5PartCloseFile(file); MPI_Finalize(); exit(0); */
if(x)
free(x);
if(y)
free(y);
if(z)
free(z);
if(id)
free(id);
H5PartCloseFile(file);
MPI_Barrier(comm);
fprintf(stderr,"proc[%u]: done\n",myproc);
return MPI_Finalize();
}
#else
#error This file only works when PARALLEL_IO is enabled.
#endif
+1 -162
View File
@@ -1,164 +1,3 @@
# test level Makefile.am
# PATH SETTING
HDF5ROOT = @HDF5ROOT@
# COMPILER SETTING
CXX = @CXX@
FC = @FC@
MPIFC = @MPIFC@
MPICXX = @MPICXX@
MPICC = @MPICC@
# COMPILER FLAG SETTING
CFLAGS = @CFLAGS@
FFLAGS = @FFLAGS@ @MPIINC@
# LIBRARIES
SZLIB = @SZLIB@
HDFLIB = -L$(HDF5ROOT)/lib -lhdf5 -lz $(SZLIB) @LDFLAGS@
MPILIB = @MPILIB@
H5LIB = -L@H5P_LIB_LOC@ -L@H5P_LIB_LOC@/h5 -lH5Part -lH5
LIBS = ${H5LIB} $(HDFLIB) $(MPILIB) -lm @STDCXX@
# H5Part compiled library location
# H5PLIB = -L@prefix@/lib
# INCLUDES
HDFINC = -I$(HDF5ROOT)/include
MPIINC = @MPIINC@
H5INC = -I@H5P_LIB_LOC@
INC = $(HDFINC) $(MPIINC) $(H5INC)
# What to build... make install will place these files in the $(prefix)/bin directory.
bin_PROGRAMS = @TTARGET@
# Some useful scripts that I wish to place in the $(prefix)/bin directory.
bin_SCRIPTS =
#bin_SCRIPTS = JAC_H5PartTestP_script.scr JAC_H5testFpar_script.scr JAC_RUN_ALL_script.scr
# Listing of all programs that maybe built. (Has to know statically...)
EXTRA_PROGRAMS =
# Extra files that I wish to include in the dist tar ball.
EXTRA_DIST = Bench.c \
H5ParallelTest.cc \
H5PartTest.cc H5PartTestParallel.cc \
H5PartAndreasTest.cc \
H5test.cc H5testF.f \
H5testFpar.f90 \
H5BlockParTestScalarField.c H5BlockParTestScalarFieldF.f90 \
H5BlockTestAttributes.c H5BlockTestAttributesF.f90 \
$(bin_SCRIPTS)
# Specific building instruction (What compilers to use...)
# ------------ Build Tests ------------
Bench: Bench.c
$(CC) $(CFLAGS) $(INC) -o $@ $< $(H5PLIB) $(LIBS)
###############################################################################
H5PartTest: H5PartTest.o
$(CXX) -o $@ $< $(H5PLIB) $(LIBS)
H5PartTest.o: H5PartTest.cc
$(CXX) $(CFLAGS) $(INC) -DREGRESSIONTEST -g -c $<
###############################################################################
H5PartTestP: H5PartTestP.o
$(CXX) $(INC) -o $@ $< $(H5LIB) $(LIBS)
H5PartTestP.o: H5PartTest.cc
$(CXX) $(CFLAGS) $(INC) -DREGRESSIONTEST -c $< -o $@
###############################################################################
H5PartTestParallel: H5PartTestParallel.o
$(CXX) -o $@ $< $(H5LIB) $(LIBS)
H5PartTestParallel.o: H5PartTestParallel.cc
$(CXX) $(CFLAGS) $(INC) -c $<
###############################################################################
H5PartAndreasTest: H5PartAndreasTest.o
$(CXX) -o $@ $< $(H5LIB) $(LIBS)
H5PartAndreasTest.o: H5PartAndreasTest.cc
$(CXX) $(CFLAGS) $(INC) -c $<
###############################################################################
H5testF: H5testF.o
$(FC) -o $@ $< $(H5LIB) -lH5PartF $(LIBS)
H5testF.o: H5testF.f
$(FC) $(FFLAGS) -c $(H5INC) $<
###############################################################################
H5testFpar: H5testFpar.o
$(MPIFC) -o $@ $< $(H5LIB) -lpH5PartF $(LIBS)
H5testFpar.o: H5testFpar.f90
$(MPIFC) $(FFLAGS) -c $(H5INC) $<
###############################################################################
H5test: H5test.o
$(CXX) -o $@ $< $(H5LIB) $(LIBS)
H5test.o: H5test.cc
$(CXX) $(CFLAGS) $(INC) -DREGRESSIONTEST -g -c $<
###############################################################################
% : %.o
$(CC) -o $@ $< $(H5LIB) $(LIBS)
%.o : %.c
$(CC) $(CFLAGS) $(INC) -g -c $<
%.o : %.f90
${FC} $(FFLAGS) -c $(H5INC) $<
H5BlockTestAttributes.o: H5BlockTestAttributes.c
H5BlockTestAttributes: H5BlockTestAttributes.o
H5BlockTestAttributesF.o: H5BlockTestAttributesF.f90
H5BlockTestAttributesF: H5BlockTestAttributesF.o
$(FC) -o $@ $< $(H5LIB) -lH5PartF -lH5Part $(LIBS)
H5BlockParTestScalarField.o: H5BlockParTestScalarField.c
H5BlockParTestScalarField: H5BlockParTestScalarField.o
H5BlockParTestScalarFieldF.o: H5BlockParTestScalarFieldF.f90
H5BlockParTestScalarFieldF: H5BlockParTestScalarFieldF.o
$(FC) -o $@ $< $(H5LIB) -lH5PartF -lH5Part $(LIBS)
H5BlockDissolveGhosts.o: H5BlockDissolveGhosts.c
H5BlockDissolveGhosts: H5BlockDissolveGhosts.o
###############################################################################
clean:
${RM} -f *~ *.o ${bin_PROGRAMS}
distclean: clean
${RM} -rf .deps
${RM} -rf .libs
${RM} -f parttest.h5
${RM} -rf config.status config.log config.h Makefile
SUBDIRS = h5u h5b h5t