Skip to content

Commit

Permalink
Merge pull request #1479 from su2code/warns_for_cgns_memory_issue
Browse files Browse the repository at this point in the history
Inform user of possible CGNS memory usage issue
  • Loading branch information
MicK7 authored Jan 4, 2022
2 parents 9efe761 + 67f8cee commit cdf780a
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion Common/src/geometry/meshreader/CCGNSMeshReaderFVM.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ void CCGNSMeshReaderFVM::OpenCGNSFile(string val_filename) {
/*--- Check whether the supplied file is truly a CGNS file. ---*/

int file_type;
float file_version;
if (cg_is_cgns(val_filename.c_str(), &file_type) != CG_OK) {
SU2_MPI::Error(val_filename +
string(" was not found or is not a properly formatted") +
Expand All @@ -107,7 +108,13 @@ void CCGNSMeshReaderFVM::OpenCGNSFile(string val_filename) {
cout << "Reading the CGNS file: ";
cout << val_filename.c_str() << "." << endl;
}

if (cg_version(cgnsFileID, &file_version))
cg_error_exit();
if (rank == MASTER_NODE) {
if (file_version < 4.0) {
cout << "WARNING: The CGNS file version (" << file_version << ") is old and may cause high memory usage issues, consider updating the file with the cgnsupdate tool.\n";
}
}
}

void CCGNSMeshReaderFVM::ReadCGNSDatabaseMetadata() {
Expand Down

0 comments on commit cdf780a

Please sign in to comment.