Skip to content

Commit

Permalink
Record global dimensions in metadata file
Browse files Browse the repository at this point in the history
  • Loading branch information
draenog committed Nov 6, 2023
1 parent d2dd202 commit 3ed83cc
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions Partitioner.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -148,6 +148,16 @@ void Partitioner::save_metadata(const std::string& filename) const
CHECK_MPI(MPI_Exscan(&right_num_neighbors, &right_offset, 1, MPI_INT, MPI_SUM,
_comm));

// Create 2 dimensions
// The values to be written are associated with the netCDF variable by
// assuming that the last dimension of the netCDF variable varies fastest in
// the C interface
const int NDIMS = 2;
int dimid_global[NDIMS];
NC_CHECK(nc_def_dim(nc_id, "globalX", _global_ext_0, &dimid_global[0]));
NC_CHECK(nc_def_dim(nc_id, "globalY", _global_ext_1, &dimid_global[1]));


// Define dimensions in netCDF file
int dimid, top_dimid, bottom_dimid, left_dimid, right_dimid;
NC_CHECK(nc_def_dim(nc_id, "P", _num_procs, &dimid));
Expand Down

0 comments on commit 3ed83cc

Please sign in to comment.