diff --git a/.gitattributes b/.gitattributes index 10efffc..5b748d1 100644 --- a/.gitattributes +++ b/.gitattributes @@ -78,6 +78,7 @@ test/h5b/H5BlockTestAttributesF.f90 -text test/h5u/Bench.c -text test/h5u/H5ParallelTest.cc -text test/h5u/H5PartTest.cc -text +test/h5u/H5PartTestParallel.cc -text test/h5u/H5test.cc -text test/h5u/H5testF.f -text test/h5u/H5testFpar.f90 -text diff --git a/test/h5u/H5PartTestParallel.cc b/test/h5u/H5PartTestParallel.cc new file mode 100755 index 0000000..eb728ac --- /dev/null +++ b/test/h5u/H5PartTestParallel.cc @@ -0,0 +1,120 @@ +#include +#include +#include +#include +#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