Skip to content

Commit

Permalink
Set MPI props for hdf5 file
Browse files Browse the repository at this point in the history
  • Loading branch information
pgrete committed Nov 29, 2023
1 parent e41ea97 commit 29e4cbb
Showing 1 changed file with 12 additions and 7 deletions.
19 changes: 12 additions & 7 deletions src/outputs/parthenon_hdf5.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -445,9 +445,9 @@ void PHDF5Output::WriteOutputFileImpl(Mesh *pm, ParameterInput *pin, SimTime *tm

#ifndef PARTHENON_DISABLE_HDF5_COMPRESSION
// if (output_params.hdf5_compression_level > 0) {
for (int i = ndim - 3; i < ndim; i++) {
chunk_size[i] = local_count[i];
}
for (int i = ndim - 3; i < ndim; i++) {
chunk_size[i] = local_count[i];
}
// }
#endif
} else if (vinfo.where == MetadataFlag(Metadata::None)) {
Expand All @@ -458,10 +458,10 @@ void PHDF5Output::WriteOutputFileImpl(Mesh *pm, ParameterInput *pin, SimTime *tm

#ifndef PARTHENON_DISABLE_HDF5_COMPRESSION
// if (output_params.hdf5_compression_level > 0) {
int nchunk_indices = std::min<int>(vinfo.tensor_rank, 3);
for (int i = ndim - nchunk_indices; i < ndim; i++) {
chunk_size[i] = alldims[6 - nchunk_indices + i];
}
int nchunk_indices = std::min<int>(vinfo.tensor_rank, 3);
for (int i = ndim - nchunk_indices; i < ndim; i++) {
chunk_size[i] = alldims[6 - nchunk_indices + i];
}
// }
#endif
} else {
Expand Down Expand Up @@ -879,6 +879,11 @@ hid_t GenerateFileAccessProps() {
/* set the file access template for parallel IO access */
hid_t acc_file = H5Pcreate(H5P_FILE_ACCESS);

// TODO(hdf5 support) Is this harmful to just always call/set?
if constexpr (BuildOptions::hdf5_vfd) {
PARTHENON_HDF5_CHECK(H5Pset_mpi_params(acc_file, MPI_COMM_WORLD, MPI_INFO_NULL));
}

/* ---------------------------------------------------------------------
platform dependent code goes here -- the access template must be
tuned for a particular filesystem blocksize. some of these
Expand Down

0 comments on commit 29e4cbb

Please sign in to comment.