From 23c2bdd189b08fb4aad3bc554609787795a4498c Mon Sep 17 00:00:00 2001 From: Achim Gsell Date: Thu, 31 Oct 2013 13:38:27 +0100 Subject: [PATCH] typo in filename 'examples/H5Part/use_core_vfd.c' fixed --- examples/H5Part/use_core_vfd.c | 56 ++++++++++++++++++++++++++++++++++ 1 file changed, 56 insertions(+) create mode 100644 examples/H5Part/use_core_vfd.c diff --git a/examples/H5Part/use_core_vfd.c b/examples/H5Part/use_core_vfd.c new file mode 100644 index 0000000..44eac11 --- /dev/null +++ b/examples/H5Part/use_core_vfd.c @@ -0,0 +1,56 @@ +/* + Copyright (c) 2006-2013, The Regents of the University of California, + through Lawrence Berkeley National Laboratory (subject to receipt of any + required approvals from the U.S. Dept. of Energy) and the Paul Scherrer + Institut (Switzerland). All rights reserved. + + License: see file COPYING in top level of source distribution. +*/ + +#include "H5hut.h" +#include "examples.h" + +#include +#include + +#define FNAME "example_core_vfd" +#define DATASIZE 32 + +int +main ( + int argc, char* argv[] + ){ + // initialize MPI & H5hut + int mpi_rank = 0; + int mpi_size = 1; + MPI_Init (&argc, &argv); + MPI_Comm comm = MPI_COMM_WORLD; + MPI_Comm_rank (comm, &mpi_rank); + MPI_Comm_size (comm, &mpi_size); + + // open file and go to step#0 + char fname[64]; + sprintf (fname, "%s.%d.h5", FNAME, mpi_rank); + h5_prop_t prop = H5CreateFileProp (); + H5SetPropFileCoreVFD (prop); + h5_file_t file = H5OpenFile (fname, H5_O_RDONLY, prop); + H5SetStep (file, 0); + + h5_int32_t data[DATASIZE]; + + H5PartSetNumParticles(file, DATASIZE); + + // create fake data + for (int i = 0; i < DATASIZE; i++) { + data[i] = i + mpi_rank * DATASIZE; + } + + // write the data + H5PartWriteDataInt32 (file, "data", data); + + H5CloseFile (file); + + MPI_Finalize (); + return H5_SUCCESS; +} +