Skip to content
Snippets Groups Projects
Commit 20fc8a25 authored by Matthieu Schaller's avatar Matthieu Schaller
Browse files

Un-tested parallel-io version.

parent 60ed4235
No related branches found
No related tags found
1 merge request!710Snapshot offsets
......@@ -489,8 +489,8 @@ void io_write_cell_offsets(hid_t h_grp, const int cdim[3],
MPI_COMM_WORLD);
#endif
message("offsets=%lld %lld", offset_part[0], offset_part[1]);
message("counts=%lld %lld", count_part[0], count_part[1]);
/* Only rank 0 actually writes */
if (nodeID != 0) return;
/* Write some meta-information first */
hid_t h_subgrp =
......
......@@ -1282,6 +1282,21 @@ void write_output_parallel(struct engine* e, const char* baseName,
snprintf(fileName, FILENAME_BUFFER_SIZE, "%s_%04i.hdf5", baseName,
e->snapshot_output_count);
if (nodeID == 0) {
h_file = H5Fopen(fileName, H5F_ACC_RDWR, H5P_DEFAULT);
if (h_file < 0)
error("Error while opening file '%s' on rank %d.", fileName, mpi_rank);
} else {
h_file = 0;
}
io_write_cell_offsets(h_file, e->s->cdim, e->s->cells_top, e->s->nr_cells,
e->s->width, e->nodeID, N_total, offset);
if (nodeID == 0) {
H5Fclose(h_file);
}
/* Prepare some file-access properties */
hid_t plist_id = H5Pcreate(H5P_FILE_ACCESS);
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment