From c4e81dbc39ddd06090acacd56cc679b099cc72cb Mon Sep 17 00:00:00 2001 From: James Foucar Date: Mon, 9 Oct 2023 14:20:18 -0700 Subject: [PATCH] Fix nvidia_pm-cpu diffs for some tests Be explicit about which hdf5 and blas/lapack libraries to link so that later -L options don't mess things up. Also, make some minor enhancements to the compare-flags tool in order to get more useful output when comparing unordered flags. [BFB] --- .../machines/cmake_macros/nvidia_pm-cpu.cmake | 2 +- cime_config/machines/scripts/compare-flags | 16 +++++++++++++--- 2 files changed, 14 insertions(+), 4 deletions(-) diff --git a/cime_config/machines/cmake_macros/nvidia_pm-cpu.cmake b/cime_config/machines/cmake_macros/nvidia_pm-cpu.cmake index a704d43bdceb..f3a0434f9ed2 100644 --- a/cime_config/machines/cmake_macros/nvidia_pm-cpu.cmake +++ b/cime_config/machines/cmake_macros/nvidia_pm-cpu.cmake @@ -2,7 +2,7 @@ string(APPEND CONFIG_ARGS " --host=cray") if (COMP_NAME STREQUAL gptl) string(APPEND CPPDEFS " -DHAVE_NANOTIME -DBIT64 -DHAVE_SLASHPROC -DHAVE_GETTIMEOFDAY") endif() -string(APPEND SLIBS " -lblas -llapack") +string(APPEND SLIBS " $ENV{CRAY_HDF5_PARALLEL_PREFIX}/lib/libhdf5_hl.a $ENV{CRAY_HDF5_PARALLEL_PREFIX}/lib/libhdf5.a /opt/nvidia/hpc_sdk/Linux_x86_64/22.7/compilers/lib/libblas_lp64.so.0 /opt/nvidia/hpc_sdk/Linux_x86_64/22.7/compilers/lib/liblapack_lp64.so.0") set(CXX_LINKER "FORTRAN") if (NOT DEBUG) string(APPEND CFLAGS " -O2") diff --git a/cime_config/machines/scripts/compare-flags b/cime_config/machines/scripts/compare-flags index e9d8b260cc7a..be420714eafc 100755 --- a/cime_config/machines/scripts/compare-flags +++ b/cime_config/machines/scripts/compare-flags @@ -112,9 +112,19 @@ def compare_contents(case1, case2, file1, file2, contents1, contents2, unordered files_match = False if verbose: - for token1, token2 in zip(tokens1, tokens2): - if token1 != token2: - print(f" {token1} != {token2}") + tokens1_set = set(tokens1) + tokens2_set = set(tokens2) + one_not_two = tokens1_set - tokens2_set + two_not_one = tokens2_set - tokens1_set + print(f" For line {line1}:") + print(f" Case1 had unique flags:") + for item in one_not_two: + print(f" {item}") + + print(f" Case2 had unique flags:") + for item in two_not_one: + print(f" {item}") + else: break