From 4df14a3ec9b657dd1acab7d6bb8335953f3b38e7 Mon Sep 17 00:00:00 2001 From: David Schneller Date: Mon, 11 Nov 2024 22:52:35 +0100 Subject: [PATCH] Fix last-bit boundary handling --- src/pumgen.cpp | 24 +++++++++++++++--------- 1 file changed, 15 insertions(+), 9 deletions(-) diff --git a/src/pumgen.cpp b/src/pumgen.cpp index 654edca..5a46c04 100644 --- a/src/pumgen.cpp +++ b/src/pumgen.cpp @@ -422,9 +422,9 @@ int main(int argc, char* argv[]) { // Write cells std::size_t connectBytesPerData = 8; logInfo(rank) << "Writing cells"; - writeH5Data(meshInput->connectivity(), h5file, "connect", mesh, 3, - H5T_NATIVE_ULONG, H5T_STD_U64LE, chunksize, localSize[0], - globalSize[0], reduceInts, filterEnable, filterChunksize, 4); + writeH5Data(meshInput->connectivity(), h5file, "connect", mesh, 3, H5T_NATIVE_UINT64, + H5T_STD_U64LE, chunksize, localSize[0], globalSize[0], reduceInts, + filterEnable, filterChunksize, 4); // Vertices logInfo(rank) << "Writing vertices"; @@ -436,15 +436,21 @@ int main(int argc, char* argv[]) { std::size_t groupBytesPerData = 4; logInfo(rank) << "Writing group information"; - writeH5Data(meshInput->group(), h5file, "group", mesh, 3, H5T_NATIVE_INT, H5T_STD_I32LE, - chunksize, localSize[0], globalSize[0], reduceInts, filterEnable, - filterChunksize, NoSecondDim); + writeH5Data(meshInput->group(), h5file, "group", mesh, 3, H5T_NATIVE_INT32, + H5T_STD_I32LE, chunksize, localSize[0], globalSize[0], reduceInts, + filterEnable, filterChunksize, NoSecondDim); // Write boundary condition logInfo(rank) << "Writing boundary condition"; - writeH5Data(meshInput->boundary(), h5file, "boundary", mesh, 3, H5T_NATIVE_LONG, - boundaryDatatype, chunksize, localSize[0], globalSize[0], reduceInts, - filterEnable, filterChunksize, secondShape); + if (boundaryFormatAttr == "i32") { + writeH5Data(meshInput->boundary(), h5file, "boundary", mesh, 3, H5T_NATIVE_INT32, + boundaryDatatype, chunksize, localSize[0], globalSize[0], reduceInts, + filterEnable, filterChunksize, secondShape); + } else { + writeH5Data(meshInput->boundary(), h5file, "boundary", mesh, 3, H5T_NATIVE_INT64, + boundaryDatatype, chunksize, localSize[0], globalSize[0], reduceInts, + filterEnable, filterChunksize, secondShape); + } hid_t attrSpace = checkH5Err(H5Screate(H5S_SCALAR)); hid_t attrType = checkH5Err(H5Tcopy(H5T_C_S1));