preprocessor now filters debug output

This commit is contained in:
2025-05-28 15:27:00 +02:00
parent e2167fb75b
commit f510d0a39a
39 changed files with 375 additions and 14 deletions
+10 -3
View File
@@ -277,23 +277,24 @@ std::stringstream Hdf5Reader::readEngineString(std::string path) {
std::to_string(SimConstants::engine_string_length_max) +
", size of string: " + std::to_string(size));
}
#ifdef debug_level3
DEBUG_LEVEL_3("RestartInfo: " + std::to_string(H5Tdetect_class(dtype, H5T_STRING)));
#endif
const int ndims = H5Sget_simple_extent_ndims(dataspace);
hsize_t dims[ndims];
if (ndims != 1) {
ERROR("The given dataset is not one dimensional. It has dims: " + ndims);
}
#ifdef debug_level3
DEBUG_LEVEL_3(std::to_string(ndims));
DEBUG_LEVEL_3("RestartInfo: " + std::to_string(size));
#endif
H5Sget_simple_extent_dims(dataspace, dims, NULL);
char data[SimConstants::engine_string_length_max];
H5Dread(dataset, dtype, H5S_ALL, H5S_ALL, H5P_DEFAULT,
&data);
std::stringstream temp;
temp << data;
H5Tclose(dtype);
H5Sclose(dataspace);
@@ -314,15 +315,21 @@ std::stringstream Hdf5Reader::readEngineString(std::string path) {
size_t length;
H5Dread(dataset, H5T_NATIVE_HSIZE, H5S_ALL, H5S_ALL, H5P_DEFAULT, &length);
#ifdef debug_level3
DEBUG_LEVEL_3("RestartInfo: read length from file: " + std::to_string(length));
#endif
H5Sclose(dataspace);
H5Dclose(dataset);
H5Fclose(file);
#ifdef debug_level3
std::stringstream temp;
temp << data;
out << temp.str().substr(0, length);
DEBUG_LEVEL_3(std::to_string(out.str().size()));
#endif
return out;
}