Skip to content

Commit

Permalink
Merge branch 'jgfouca/fix_nvidia_pm_cpu_diffs' into next (PR #5976)
Browse files Browse the repository at this point in the history
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]
  • Loading branch information
jgfouca committed Oct 10, 2023
2 parents 177c473 + c4e81db commit 886da34
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 4 deletions.
2 changes: 1 addition & 1 deletion cime_config/machines/cmake_macros/nvidia_pm-cpu.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -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")
Expand Down
16 changes: 13 additions & 3 deletions cime_config/machines/scripts/compare-flags
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down

0 comments on commit 886da34

Please sign in to comment.