From 754c1ad4173597697c57568a7434705193b831eb Mon Sep 17 00:00:00 2001 From: MicK7 Date: Tue, 4 Jan 2022 07:47:24 +0100 Subject: [PATCH 1/2] Inform user of possible memory issue CGNS file older than 4.0 release have a high ram memory usage --- Common/src/geometry/meshreader/CCGNSMeshReaderFVM.cpp | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/Common/src/geometry/meshreader/CCGNSMeshReaderFVM.cpp b/Common/src/geometry/meshreader/CCGNSMeshReaderFVM.cpp index ac0fde07ead..d153e91dc72 100644 --- a/Common/src/geometry/meshreader/CCGNSMeshReaderFVM.cpp +++ b/Common/src/geometry/meshreader/CCGNSMeshReaderFVM.cpp @@ -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") + @@ -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 << "The file version is too old, please update it with the cgnsupdate tool." << endl; + } + } } void CCGNSMeshReaderFVM::ReadCGNSDatabaseMetadata() { From 67f8cee6a696bdef77dace1cfe2626196b4215ac Mon Sep 17 00:00:00 2001 From: MicK7 Date: Tue, 4 Jan 2022 18:30:43 +0100 Subject: [PATCH 2/2] clearer message Co-authored-by: Pedro Gomes <38071223+pcarruscag@users.noreply.github.com> --- Common/src/geometry/meshreader/CCGNSMeshReaderFVM.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/Common/src/geometry/meshreader/CCGNSMeshReaderFVM.cpp b/Common/src/geometry/meshreader/CCGNSMeshReaderFVM.cpp index d153e91dc72..5cde580d32c 100644 --- a/Common/src/geometry/meshreader/CCGNSMeshReaderFVM.cpp +++ b/Common/src/geometry/meshreader/CCGNSMeshReaderFVM.cpp @@ -112,7 +112,7 @@ void CCGNSMeshReaderFVM::OpenCGNSFile(string val_filename) { cg_error_exit(); if (rank == MASTER_NODE) { if (file_version < 4.0) { - cout << "The file version is too old, please update it with the cgnsupdate tool." << endl; + 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"; } } }