From cd1cc2cb749f23ed37019b93fa1efb013a9f01cd Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Mon, 11 Jan 2021 20:14:12 -0600 Subject: [PATCH 1/4] Configure compiler flags for Intel 2021 --- cmake/OpenfastFortranOptions.cmake | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/cmake/OpenfastFortranOptions.cmake b/cmake/OpenfastFortranOptions.cmake index b4cc263b36..61d3ce6e01 100644 --- a/cmake/OpenfastFortranOptions.cmake +++ b/cmake/OpenfastFortranOptions.cmake @@ -158,7 +158,11 @@ macro(set_fast_intel_fortran_posix) # Deal with Double/Single precision if (DOUBLE_PRECISION) add_definitions(-DOPENFAST_DOUBLE_PRECISION) - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -double_size 128") + if("${CMAKE_Fortran_COMPILER_VERSION}" VERSION_GREATER "19") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -double-size 128") + else() + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -r8 -double_size 128") + endif() endif (DOUBLE_PRECISION) # debug flags @@ -204,7 +208,11 @@ macro(set_fast_intel_fortran_windows) # Deal with Double/Single precision if (DOUBLE_PRECISION) add_definitions(-DOPENFAST_DOUBLE_PRECISION) - set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /real_size:64 /double_size:128") + if("${CMAKE_Fortran_COMPILER_VERSION}" VERSION_GREATER "19") + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /real-size:64 /double-size:128") + else() + set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /real_size:64 /double_size:128") + endif() endif (DOUBLE_PRECISION) # increase the default 2MB stack size to 16 MB From e5f848f6b928a21b6974051cb454000e25f3d83c Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Tue, 12 Jan 2021 12:46:46 -0600 Subject: [PATCH 2/4] "Fix" Intel seg fault --- modules/aerodyn/src/FVW_Wings.f90 | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/modules/aerodyn/src/FVW_Wings.f90 b/modules/aerodyn/src/FVW_Wings.f90 index 431ab3403b..bad06fbce5 100644 --- a/modules/aerodyn/src/FVW_Wings.f90 +++ b/modules/aerodyn/src/FVW_Wings.f90 @@ -175,9 +175,13 @@ subroutine Wings_Panelling(Meshes, p, m, ErrStat, ErrMsg ) DP1 = P6-P8 DP2 = P10-P9 DP3 = P7-P5 + + ! NOTE: The denominator below has seg-faulted with Intel Fortran in Release mode, possibly due to nuances in copmiler optimizations. + ! This code was previously after the m%Norm calculations, but moving it up "fixes" the bug. + m%Tang(1:3,iSpan,iW) = (DP1)/TwoNorm(DP1) ! tangential unit vector, along chord + m%Norm(1:3,iSpan,iW) = cross_product(DP1,DP2) m%Norm(1:3,iSpan,iW) = m%Norm(1:3,iSpan,iW)/TwoNorm(m%Norm(1:3,iSpan,iW)) - m%Tang(1:3,iSpan,iW) = (DP1)/TwoNorm(DP1) ! tangential unit vector, along chord ! m%Tscoord(1:3,iSpan) = (DP3)/norm2(DP3) ! tangential unit vector, along span, follows ref line m%dl (1:3,iSpan,iW) = DP2 m%Orth(1:3,iSpan,iW) = cross_product(m%Norm(1:3,iSpan,iW),m%Tang(1:3,iSpan,iW)) ! orthogonal vector to N and T From 094fbcc43799bab4571a94a02e391cbee6fc095e Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Wed, 13 Jan 2021 13:24:32 -0600 Subject: [PATCH 3/4] Support linearization reg tests in Python script Bug fix in linear regression test script --- reg_tests/executeOpenfastLinearRegressionCase.py | 3 +++ reg_tests/manualRegressionTest.py | 8 +++++++- 2 files changed, 10 insertions(+), 1 deletion(-) diff --git a/reg_tests/executeOpenfastLinearRegressionCase.py b/reg_tests/executeOpenfastLinearRegressionCase.py index 11c7671e11..d23937bbfd 100644 --- a/reg_tests/executeOpenfastLinearRegressionCase.py +++ b/reg_tests/executeOpenfastLinearRegressionCase.py @@ -164,6 +164,9 @@ def isclose(a, b, rel_tol=1e-09, abs_tol=0.0): ### Get a list of all the files in the baseline directory baselineOutFiles = os.listdir(targetOutputDirectory) +# Drop the log file, if its listed +if caseName + '.log' in baselineOutFiles: + baselineOutFiles.remove(caseName + '.log') # these should all exist in the local outputs directory localFiles = os.listdir(testBuildDirectory) diff --git a/reg_tests/manualRegressionTest.py b/reg_tests/manualRegressionTest.py index ef63ddfac9..f51b1e5a5c 100644 --- a/reg_tests/manualRegressionTest.py +++ b/reg_tests/manualRegressionTest.py @@ -65,14 +65,20 @@ def strFormat(string): else: with open(os.path.join("r-test", "glue-codes", "openfast", "CaseList.md")) as listfile: caselist = listfile.readlines() +# allow comments with '#' casenames = [c.rstrip("\n\r").strip() for c in caselist if "#" not in c] +# allow empty lines +casenames = [c for c in casenames if len(c.strip()) > 0] results = [] prefix, passString, failString = "executing", "PASS", "FAIL" longestName = max(casenames, key=len) for case in casenames: print(strFormat(prefix).format(prefix), strFormat(longestName+" ").format(case), end="", flush=True) - command = "\"{}\" executeOpenfastRegressionCase.py {} {} {} {} {} {} {} {} {}".format(pythonCommand, case, openfast_executable, sourceDirectory, buildDirectory, tolerance, machine, compiler, plotFlag, noExecFlag) + if "linear" in case.lower(): + command = "\"{}\" executeOpenfastLinearRegressionCase.py {} {} {} {} {} {} {} {} {}".format(pythonCommand, case, openfast_executable, sourceDirectory, buildDirectory, tolerance, machine, compiler, plotFlag, noExecFlag) + else: + command = "\"{}\" executeOpenfastRegressionCase.py {} {} {} {} {} {} {} {} {}".format(pythonCommand, case, openfast_executable, sourceDirectory, buildDirectory, tolerance, machine, compiler, plotFlag, noExecFlag) returnCode = subprocess.call(command, stdout=outstd, shell=True) resultString = passString if returnCode == 0 else failString results.append((case, resultString)) From 38541e5b0dab4600805304481c174584d7090b6c Mon Sep 17 00:00:00 2001 From: Rafael M Mudafort Date: Wed, 13 Jan 2021 13:24:50 -0600 Subject: [PATCH 4/4] Use Intel 2021 for reg test baselines --- reg_tests/r-test | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/reg_tests/r-test b/reg_tests/r-test index 01f51597b8..4fdfdecfce 160000 --- a/reg_tests/r-test +++ b/reg_tests/r-test @@ -1 +1 @@ -Subproject commit 01f51597b8f058d6f08ec67d7b9aeb4a2ffccaad +Subproject commit 4fdfdecfce5be5da8ee5a37c837804948e6962a7