#include #include #include #include "H5Part.h" #include "H5Block.h" #if 0 int ReadFile(const char *fn){ char name[64]; H5PartFile *file; h5part_int64_t i,t,nt,nds,myproc; unsigned int steps; printf ( "Open %s\n", fn ); file = H5PartOpenFile (fn, H5PART_READ); nt=H5PartGetNumSteps(file); H5PartSetStep(file,0); nds=H5PartGetNumDatasets(file); printf ( "Timesteps = %d; dataSets per timestep = %d\n", nt, nds ); printf ( "\n\n===============================" ); for(i=0;imyproc; } } } herr = H5BlockDefine3DFieldLayout ( f, f->myproc*2, f->myproc*2+i_dims-1, 0, j_dims-1, 0, k_dims-1 ); if ( herr < 0 ) exit ( 2 ); herr = H5Block3dWriteScalarField ( f, "test", data ); if ( herr < 0 ) exit ( 2 ); free ( data ); } herr = H5BlockClose ( f ); if ( herr < 0 ) exit ( 2 ); H5PartCloseFile ( f ); return 1; } int main(int argc,char **argv){ char *fn = "testfile.h5"; MPI_Init(&argc,&argv); H5PartSetVerbosityLevel ( 40 ); if(!WriteFile(fn)){ printf ("Failed to write file %s\n", fn ); exit ( 2 ); } #if 0 if(!ReadFile(fn)){ printf ("Failed to read file %s\n", fn ); exit ( 2 ); } #endif return 0; }