Skip to content
Snippets Groups Projects

Large parallel hdf5

Merged Matthieu Schaller requested to merge large_parallel_hdf5 into master

Fix to #72 (closed).

This is a workaround to the limitation of parallel-HDF5. The low-level MPI-IO implementations limit writes to 2GB per rank (irrespective of the total amount being written across all nodes).

The solution involves writing chunks of 2GB (or in practice 2'000'000'000Bytes) and then repeat for the remaining chunks, if any, by shifting the position to write of each node in the file and in memory by 2GB. Ranks that did not pass the threshold just write nothing. In realistic scenarios we won't need more than a handful of iterations.

Merge request reports

Merged by avatar (May 28, 2025 2:56pm UTC)

Loading

Activity

Filter activity
  • Approvals
  • Assignees & reviewers
  • Comments (from bots)
  • Comments (from users)
  • Commits & branches
  • Edits
  • Labels
  • Lock status
  • Mentions
  • Merge request status
  • Tracking
  • 297 h_err = H5Sset_extent_simple(h_filespace, rank, shape_total, NULL);
    359 hid_t h_err = H5Sset_extent_simple(h_filespace, rank, shape_total, NULL);
    298 360 if (h_err < 0) {
    299 361 error("Error while changing data space (file) shape for field '%s'.",
    300 362 props.name);
    301 363 }
    302 364
    365 /* Dataset properties */
    366 const hid_t h_prop = H5Pcreate(H5P_DATASET_CREATE);
    367
    368 /* Set chunk size */
    369 /* h_err = H5Pset_chunk(h_prop, rank, chunk_shape); */
    370 /* if (h_err < 0) { */
    371 /* error("Error while setting chunk size (%llu, %llu) for field '%s'.", */
    372 /* chunk_shape[0], chunk_shape[1], props.name); */
    373 /* } */
  • 297 h_err = H5Sset_extent_simple(h_filespace, rank, shape_total, NULL);
    359 hid_t h_err = H5Sset_extent_simple(h_filespace, rank, shape_total, NULL);
    298 360 if (h_err < 0) {
    299 361 error("Error while changing data space (file) shape for field '%s'.",
    300 362 props.name);
    301 363 }
    302 364
    365 /* Dataset properties */
    366 const hid_t h_prop = H5Pcreate(H5P_DATASET_CREATE);
    367
    368 /* Set chunk size */
    369 /* h_err = H5Pset_chunk(h_prop, rank, chunk_shape); */
    370 /* if (h_err < 0) { */
    371 /* error("Error while setting chunk size (%llu, %llu) for field '%s'.", */
    372 /* chunk_shape[0], chunk_shape[1], props.name); */
    373 /* } */
    • I was going to play with the chunking at some point to explore the effect it has on the performance for our filesystem so I'd rather keep it in for now.

  • Added 1 commit:

    • fb2c10ac - Use LL instead of ll for the long long suffix of literals.
  • Thanks, all looks good to go, do you want to keep the branch?

  • No, it can go. Cheers.

  • Peter W. Draper Status changed to merged

    Status changed to merged

  • Peter W. Draper mentioned in commit f8efb3a4

    mentioned in commit f8efb3a4

  • mentioned in issue #72 (closed)

  • Please register or sign in to reply
    Loading