19 const std::string
FILE_NAME(
"parallel_dataset_example.h5");
29 int mpi_rank, mpi_size;
32 MPI_Init(&argc, &argv);
33 MPI_Comm_size(MPI_COMM_WORLD, &mpi_size);
34 MPI_Comm_rank(MPI_COMM_WORLD, &mpi_rank);
46 std::vector<size_t> dims(2);
47 dims[0] = std::size_t(mpi_size);
56 int data[1][2] = {{mpi_rank, mpi_rank}};
59 dataset.
select({std::size_t(mpi_rank), 0}, {1, 2}).write(data);
63 std::cerr << err.
what() << std::endl;
64 MPI_Abort(MPI_COMM_WORLD, 1);
int main(int argc, char **argv)
static const int ReadWrite
Open flag: Read Write access.
static const int Truncate
Open flag: Truncate a file if already existing.
MPIIO Driver for Parallel HDF5.
const std::string DATASET_NAME("dset")
const char * what() const override
get the current exception error message
Selection select(const std::vector< size_t > &offset, const std::vector< size_t > &count, const std::vector< size_t > &stride=std::vector< size_t >()) const
Basic HighFive Exception class.
const std::string FILE_NAME("parallel_dataset_example.h5")
DataSet createDataSet(const std::string &dataset_name, const DataSpace &space, const DataType &type, const DataSetCreateProps &createProps=DataSetCreateProps(), const DataSetAccessProps &accessProps=DataSetAccessProps())
createDataSet Create a new dataset in the current file of datatype type and of size space ...
static const int Create
Open flag: Create non existing file.