From a5d336c779029bf27af9899d17cf365b3cffa1e9 Mon Sep 17 00:00:00 2001 From: Cole Kendrick Date: Mon, 11 Mar 2024 06:15:58 -0700 Subject: [PATCH 1/5] Add test for writeSnapshot/endSamples in CI --- .github/workflows/run_tests/action.yml | 1 + 1 file changed, 1 insertion(+) diff --git a/.github/workflows/run_tests/action.yml b/.github/workflows/run_tests/action.yml index 8413a880b..994f45af3 100644 --- a/.github/workflows/run_tests/action.yml +++ b/.github/workflows/run_tests/action.yml @@ -7,6 +7,7 @@ runs: ./tests/test_Vector ./tests/test_Matrix mpirun -n 3 --oversubscribe ./tests/test_Matrix + ./tests/smoke_static ./tests/test_DEIM ./tests/test_GNAT ./tests/test_QDEIM From 60b1f15d40a85dc8cc7d271845afa29587b3f9d3 Mon Sep 17 00:00:00 2001 From: Cole Kendrick Date: Mon, 11 Mar 2024 06:54:37 -0700 Subject: [PATCH 2/5] Fix test return value --- unit_tests/smoke_static.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/unit_tests/smoke_static.cpp b/unit_tests/smoke_static.cpp index 856dc71c7..0fdc6f081 100644 --- a/unit_tests/smoke_static.cpp +++ b/unit_tests/smoke_static.cpp @@ -144,5 +144,5 @@ main( // Finalize MPI and return. MPI_Finalize(); - return !status; + return 0; } From c62ec3bc1bd4cb9b65d74827aca6fe706d1adf5d Mon Sep 17 00:00:00 2001 From: Cole Kendrick Date: Mon, 11 Mar 2024 08:55:26 -0700 Subject: [PATCH 3/5] Remove unused status variable --- unit_tests/smoke_static.cpp | 2 -- 1 file changed, 2 deletions(-) diff --git a/unit_tests/smoke_static.cpp b/unit_tests/smoke_static.cpp index 0fdc6f081..5e03c1707 100644 --- a/unit_tests/smoke_static.cpp +++ b/unit_tests/smoke_static.cpp @@ -53,8 +53,6 @@ main( return 1; } - bool status = false; - // Define the values for the first sample. double vals0[6] = {1.0, 6.0, 3.0, 8.0, 17.0, 9.0}; From 0ac76409947f3651d2d4d991e815637c6f8ff626 Mon Sep 17 00:00:00 2001 From: Cole Kendrick Date: Tue, 26 Mar 2024 16:03:55 -0700 Subject: [PATCH 4/5] Fix bug with assert statements in BasisReader --- lib/linalg/BasisReader.cpp | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/linalg/BasisReader.cpp b/lib/linalg/BasisReader.cpp index 1fdb11e65..b6e26eed8 100644 --- a/lib/linalg/BasisReader.cpp +++ b/lib/linalg/BasisReader.cpp @@ -103,7 +103,7 @@ BasisReader::getSpatialBasis( int num_cols = getNumSamples("basis"); char tmp[100]; - CAROM_VERIFY(0 < start_col <= num_cols); + CAROM_VERIFY(0 < start_col && start_col <= num_cols); CAROM_VERIFY(start_col <= end_col && end_col <= num_cols); int num_cols_to_read = end_col - start_col + 1; @@ -177,7 +177,7 @@ BasisReader::getTemporalBasis( int num_cols = getNumSamples("temporal_basis"); char tmp[100]; - CAROM_VERIFY(0 < start_col <= num_cols); + CAROM_VERIFY(0 < start_col && start_col <= num_cols); CAROM_VERIFY(start_col <= end_col && end_col <= num_cols); int num_cols_to_read = end_col - start_col + 1; @@ -351,7 +351,7 @@ BasisReader::getSnapshotMatrix( int num_rows = getDim("snapshot"); int num_cols = getNumSamples("snapshot"); - CAROM_VERIFY(0 < start_col <= num_cols); + CAROM_VERIFY(0 < start_col && start_col <= num_cols); CAROM_VERIFY(start_col <= end_col && end_col <= num_cols); int num_cols_to_read = end_col - start_col + 1; From c872267c0b33bc7017224d2daf2cbd483b2881f4 Mon Sep 17 00:00:00 2001 From: Cole Kendrick Date: Thu, 9 May 2024 07:29:00 -0700 Subject: [PATCH 5/5] Remove unused function --- lib/utils/Database.cpp | 6 ------ lib/utils/Database.h | 1 - 2 files changed, 7 deletions(-) diff --git a/lib/utils/Database.cpp b/lib/utils/Database.cpp index df2cb01b6..b7f34f578 100644 --- a/lib/utils/Database.cpp +++ b/lib/utils/Database.cpp @@ -16,12 +16,6 @@ namespace CAROM { -bool fileExists(const std::string& name) -{ - std::ifstream f(name.c_str()); - return f.good(); - // ifstream f will be closed upon the end of the function. -} Database::Database() { diff --git a/lib/utils/Database.h b/lib/utils/Database.h index 1008f391d..f9cf0678c 100644 --- a/lib/utils/Database.h +++ b/lib/utils/Database.h @@ -20,7 +20,6 @@ namespace CAROM { -bool fileExists(const std::string& name); /** * Class Database is an abstract base class that provides basic ability to