diff --git a/examples/H5Part/Bench.c b/examples/H5Part/Bench.c deleted file mode 100644 index c5e4499..0000000 --- a/examples/H5Part/Bench.c +++ /dev/null @@ -1,263 +0,0 @@ -#include -#include -#include -#include -/* #include */ -#include -#include -#ifndef PARALLEL_IO -#define PARALLEL_IO -#endif - -#ifndef DISABLE_H5PART -#include "H5hut.h" -#endif - -#define FILENAME "testio" -/* normally 64 steps for real benchmark */ -/* #define NSTEPS 5 */ - -/* normally 51e6 for real benchmark */ -#define NPARTICLES 51e4 -#define NTRIALS 3 - -/* - -bench - -*/ - - -int main(int argc,char *argv[]){ - - if (argc < 3) { - printf("Usage: bench \n"); - exit(-1); - } - else { - printf("nparticles: %d, nsteps: %d \n", atoi(argv[1]), atoi(argv[2])); - } - - MPI_Info info; - int nprocs,rank; - int trial; - int i,j,n; /* iteration variables */ - double starttime,curtime, endtime; - - int nparticles = atoi(argv[1]); - int nsteps = atoi(argv[2]); - - double *x,*y,*z,*px,*py,*pz; - typedef double *ddouble; - ddouble data[6]; - MPI_Datatype chunktype; - int offset; - int localnp; - char filename[128]; /*= FILENAME; */ -#ifndef DISABLE_H5PART - h5_file_t f; -#endif - char newfilename[128]; - FILE *fd; - MPI_File file; - MPI_Offset foffset; - - MPI_Comm dcomm = MPI_COMM_WORLD; - - MPI_Init(&argc,&argv); - MPI_Comm_rank(dcomm,&rank); - MPI_Comm_size(dcomm,&nprocs); - - localnp=nparticles/(int64_t)nprocs; - for(offset=0,i=0;i -#include "H5hut.h" - -/* - A simple regression test that shows how you use this API - to write and read multi-timestep files of particle data. -*/ - - -#ifdef PARALLEL_IO - -int main(int argc,char *argv[]){ - int sz=5; - double *x,*y,*z; - h5_int64_t *id; - h5_file_t file; - int i,t,nt,nds; - - int nprocs = 1; - int myproc = 0; - MPI_Comm comm = MPI_COMM_WORLD; - -#if PARALLEL_IO - MPI_Init (&argc,&argv); - MPI_Comm_size (comm,&nprocs); - MPI_Comm_rank (comm,&myproc); -#endif - x = (double*)malloc (sz*nprocs*sizeof(double)); - y = (double*)malloc (sz*nprocs*sizeof(double)); - z = (double*)malloc (sz*nprocs*sizeof(double)); - id=(h5_int64_t*)malloc (sz*nprocs*sizeof(h5_int64_t)); - - file=H5OpenFile ("parttest.h5",H5_O_WRONLY,comm); - if(!file) { - perror("File open failed: exiting!"); - exit(0); - } - - H5PartWriteFileAttribString ( - file, - "File Description", - "This file is created by H5PartTest.cc. " - "Simple H5Part file for testing purpose..."); - char* FileAttrib = "Created by H5PartTest.cc"; - H5PartWriteFileAttrib ( - file, - "Origin", - H5T_NATIVE_CHAR, - FileAttrib ,strlen(FileAttrib)); - - for(t=0;t<5;t++){ - MPI_Barrier(comm); - for(i=0;i>1); - printf("Set new view = %d:%d\n",(int)idStart,(int)(idEnd>>1)); - H5PartGetView(file,&idStart,&idEnd); - np=H5PartGetNumParticles(file); - printf("steps= %u datasets= %u particles= %d with view %d:%d\n", - nt,nds,(int)np,(int)idStart,(int)idEnd); - H5PartSetStep(file,nt-1); // set to last step - printf("Setting to last step = %u\n",nt-1); - for(i=0;i<10;i++){ x[i]=y[i]=z[i]=0.0; id[i]=0; } /* clear the arrays */ - H5PartReadDataFloat64(file,"x",x); - H5PartReadDataFloat64(file,"y",y); - H5PartReadDataFloat64(file,"z",z); - H5PartReadDataInt64(file,"id",id); - - for(i=0;i>1,(int)idEnd); - H5PartSetView(file,(idEnd>>1),idEnd); - np=H5PartGetNumParticles(file); - printf("Now particles in selection are %d\n",np); - printf("doubleCheck=%lld\n", (long long)H5PartGetView(file,0,0)); - - for(i=0;i<10;i++){ x[i]=y[i]=z[i]=0.0; id[i]=0; } /* clear the arrays */ - - H5PartReadDataFloat64(file,"x",x); - H5PartReadDataFloat64(file,"y",y); - H5PartReadDataFloat64(file,"z",z); - H5PartReadDataInt64(file,"id",id); - for(i=0;i