Skip to content

Commit 20632d7

Browse files
authored
Merge pull request #2740 from OpenFAST/rc-4.0.3
Release 4.0.3
2 parents fc11101 + 2ac5c58 commit 20632d7

File tree

19 files changed

+282
-165
lines changed

19 files changed

+282
-165
lines changed

cmake/OpenfastFortranOptions.cmake

+15-8
Original file line numberDiff line numberDiff line change
@@ -158,13 +158,18 @@ endmacro(set_fast_intel_fortran)
158158
# arch
159159
#
160160
macro(set_fast_intel_fortran_posix)
161-
# Set size where temporary are stored on heap instead of stack
162-
# 1000: size in kB (1 MB)
163-
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpic -fpp -heap-arrays 1000")
161+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} -fpic -fpp")
164162

165163
# debug flags
166164
if(CMAKE_BUILD_TYPE MATCHES Debug)
167-
set( CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -check all,noarg_temp_created -traceback -init=huge,infinity" )
165+
if(${CMAKE_Fortran_COMPILER_ID} MATCHES "IntelLLVM")
166+
# NOTE: there is a bug in the 2024 and 2025 IFX compiler causing conflicts between the `check:uninit` and `-lm -ldl` flags
167+
# When this is fixed in IFX, we will want to update this to check against versions before fix
168+
# See here: https://community.intel.com/t5/Intel-Fortran-Compiler/ifx-IFX-2023-2-0-20230721-linker-problems-with-check-uninit/m-p/1527816
169+
set( CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -check all,noarg_temp_created,nouninit -traceback -init=huge,infinity" )
170+
else()
171+
set( CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} -check all,noarg_temp_created -traceback -init=huge,infinity" )
172+
endif()
168173
endif()
169174

170175
# If double precision, make real and double constants 64 bits
@@ -203,9 +208,7 @@ macro(set_fast_intel_fortran_windows)
203208
# Turn off specific warnings
204209
# - 5199: too many continuation lines
205210
# - 5268: 132 column limit
206-
# Set size where temporary are stored on heap instead of stack
207-
# 1000: size in kB (1 MB)
208-
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /Qdiag-disable:5199,5268 /fpp /heap-arrays:1000")
211+
set(CMAKE_Fortran_FLAGS "${CMAKE_Fortran_FLAGS} /Qdiag-disable:5199,5268 /fpp")
209212

210213
# If double precision, make constants double precision
211214
if (DOUBLE_PRECISION)
@@ -222,7 +225,11 @@ macro(set_fast_intel_fortran_windows)
222225

223226
# debug flags
224227
if(CMAKE_BUILD_TYPE MATCHES Debug)
225-
set( CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} /check:all,noarg_temp_created /traceback /Qinit=huge,infinity" )
228+
if(${CMAKE_Fortran_COMPILER_ID} MATCHES "IntelLLVM")
229+
set( CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} /check:all,noarg_temp_created,nouninit /traceback /Qinit=huge,infinity" )
230+
else()
231+
set( CMAKE_Fortran_FLAGS_DEBUG "${CMAKE_Fortran_FLAGS_DEBUG} /check:all,noarg_temp_created /traceback /Qinit=huge,infinity" )
232+
endif()
226233
endif()
227234

228235
check_f2008_features()

docs/changelogs/ReleaseProcess.md

+27-27
Original file line numberDiff line numberDiff line change
@@ -49,33 +49,33 @@ After posting and tagging release
4949
* Run one of the executables and check the version info. Muck about with VS if there is an issue.
5050
* Also run `dumpbin.exe /dependents <exe>.exe` to check static linking
5151
* NOTE: build the simulink last -- it messes up some things otherwise
52-
- [ ] AeroDisk_Driver_x64.exe
53-
- [ ] AeroDyn_Driver_x64.exe
54-
- [ ] AeroDyn_Driver_x64_OpenMP.exe
55-
- [ ] AeroDyn_Inflow_C_Binding_x64.dll
56-
- [ ] AeroDyn_Inflow_C_Binding_x64_OpenMP.dll
57-
- [ ] BeamDyn_Driver_x64.exe
58-
- [ ] DISCON.dll (x64)
59-
- [ ] DISCON_ITIBarge.dll (x64)
60-
- [ ] DISCON_OC3Hywind.dll (x64)
61-
- [ ] DISCON_SC.dll (x64)
62-
- [ ] FAST.Farm_x64.exe
63-
- [ ] FAST.Farm_x64_OMP.exe
64-
- [ ] FAST_SFunc.mexw64 -- build from MATLAB
65-
- [ ] HydroDynDriver_x64.exe
66-
- [ ] HydroDyn_C_Binding_x64.dll
67-
- [ ] IfW_C_Binding_x64.dll
68-
- [ ] InflowWind_Driver_x64.exe
69-
- [ ] InflowWind_Driver_x64_OpenMP.exe
70-
- [ ] MoorDyn_Driver_x64.exe
71-
- [ ] MoorDyn_C_Binding_x64.dll
72-
- [ ] OpenFAST-Simulink_x64.dll -- change `additional dependencies` in the `OpenFAST-Simulink` project in `FAST` to point to correct install of MATLAB
73-
- [ ] openfast_x64.exe
74-
- [ ] SeaStateDriver_x64.exe
75-
- [ ] SimpleElastoDyn_x64.exe
76-
- [ ] SubDyn_x64.exe
77-
- [ ] Turbsim_x64.exe
78-
- [ ] UnsteadyAero_x64.exe
52+
- [ ] `AeroDisk_Driver_x64.exe`
53+
- [ ] `AeroDyn_Driver_x64.exe`
54+
- [ ] `AeroDyn_Driver_x64_OpenMP.exe`
55+
- [ ] `AeroDyn_Inflow_c_binding_x64.dll`
56+
- [ ] `AeroDyn_Inflow_c_binding_x64_OpenMP.dll`
57+
- [ ] `BeamDyn_Driver_x64.exe`
58+
- [ ] `DISCON.dll` (x64)
59+
- [ ] `DISCON_ITIBarge.dll` (x64)
60+
- [ ] `DISCON_OC3Hywind.dll` (x64)
61+
- [ ] `DISCON_SC.dll` (x64)
62+
- [ ] `FAST.Farm_x64.exe`
63+
- [ ] `FAST.Farm_x64_OMP.exe`
64+
- [ ] `FAST_SFunc.mexw64` -- build from MATLAB
65+
- [ ] `HydroDynDriver_x64.exe`
66+
- [ ] `HydroDyn_c_binding_x64.dll`
67+
- [ ] `InflowWind_c_binding_x64.dll`
68+
- [ ] `InflowWind_Driver_x64.exe`
69+
- [ ] `InflowWind_Driver_x64_OpenMP.exe`
70+
- [ ] `MoorDyn_Driver_x64.exe`
71+
- [ ] `MoorDyn_c_binding_x64.dll`
72+
- [ ] `OpenFAST-Simulink_x64.dll` -- change `additional dependencies` in the `OpenFAST-Simulink` project in `FAST` to point to correct install of MATLAB
73+
- [ ] `openfast_x64.exe`
74+
- [ ] `SeaStateDriver_x64.exe`
75+
- [ ] `SimpleElastoDyn_x64.exe`
76+
- [ ] `SubDyn_x64.exe`
77+
- [ ] `Turbsim_x64.exe`
78+
- [ ] `UnsteadyAero_x64.exe`
7979
5. Upload all filesUnset the no tracking of files
8080
```
8181
git ls-files -v | grep "^[a-z]"

docs/changelogs/v4.0.3.md

+91
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,91 @@
1+
**Feature or improvement description**
2+
Pull request to merge `rc-4.0.3` into `main` and create a tagged release for v4.0.3
3+
4+
See the milestone and project pages for additional information
5+
6+
https://github.com/OpenFAST/openfast/milestone/19
7+
8+
Test results, if applicable
9+
See GitHub Actions
10+
11+
### Release checklist:
12+
- [ ] Update the documentation version in docs/conf.py
13+
- [ ] Update the versions in docs/source/user/api\_change.rst
14+
- [ ] Update version info in openfast\_io/pyproject.toml
15+
- [ ] Verify readthedocs builds correctly
16+
- [ ] Create an annotated tag in OpenFAST during merge (mark as most recent if necessary)
17+
- [ ] Create a merge commit in r-test and add a corresponding annotated tag
18+
- [ ] Compile executables for Windows builds
19+
- [ ] `AeroDisk_Driver_x64.exe`
20+
- [ ] `AeroDyn_Driver_x64.exe`
21+
- [ ] `AeroDyn_Driver_x64_OpenMP.exe`
22+
- [ ] `AeroDyn_Inflow_c_binding_x64.dll`
23+
- [ ] `AeroDyn_Inflow_c_binding_x64_OpenMP.dll`
24+
- [ ] `BeamDyn_Driver_x64.exe`
25+
- [ ] `DISCON.dll (x64)`
26+
- [ ] `DISCON_ITIBarge.dll (x64)`
27+
- [ ] `DISCON_OC3Hywind.dll (x64)`
28+
- [ ] `DISCON_SC.dll (x64)`
29+
- [ ] `FAST.Farm_x64.exe`
30+
- [ ] `FAST.Farm_x64_OMP.exe`
31+
- [ ] `FAST_SFunc.mexw64`
32+
- [ ] `HydroDynDriver_x64.exe`
33+
- [ ] `HydroDyn_C_Binding_x64.dll`
34+
- [ ] `IinflowWind_c_binding_x64.dll`
35+
- [ ] `InflowWind_Driver_x64.exe`
36+
- [ ] `InflowWind_Driver_x64_OpenMP.exe`
37+
- [ ] `MoorDyn_Driver_x64.exe`
38+
- [ ] `MoorDyn_c_binding_x64.dll`
39+
- [ ] `OpenFAST-Simulink_x64.dll`
40+
- [ ] `openfast_x64.exe`
41+
- [ ] `SeaStateDriver_x64.exe`
42+
- [ ] `SimpleElastoDyn_x64.exe`
43+
- [ ] `SubDyn_x64.exe`
44+
- [ ] `Turbsim_x64.exe`
45+
- [ ] `UnsteadyAero_x64.exe`
46+
47+
# Changelog
48+
49+
## Overview
50+
51+
This release includes several bug fixes and improvements for _FAST.Farm_, including segmentation faults with large farms, file I/O collision fixes, increased error message length, and build/compile issues.
52+
53+
## General
54+
55+
### CMake build system
56+
57+
#2709 Add "nouninit" to debug flags for IntelLLVM (@andrew-platt)
58+
59+
#2732 Disable use of heap arrays for the Intel fortran compilers (@deslaughter)
60+
61+
62+
### openfast_io
63+
64+
#2727 generate BD files if fst_vt dictionary BD keys are not empty (@mayankchetan)
65+
66+
67+
### Visual Studio build
68+
69+
#2742 Fix VS build for FAST when using IFX Complier (@deslaughter)
70+
71+
72+
## Solvers
73+
74+
### FAST.Farm
75+
76+
#2711 Fix FAST.Farm issues with OMP (segfaults mostly) (@andrew-platt)
77+
78+
79+
## Module changes
80+
81+
### NWTC library
82+
83+
#2710 Increase length of error messages (@andrew-platt)
84+
85+
#2741 bug in simulation status number of days left (@andrew-platt)
86+
87+
88+
## Input file changes
89+
90+
No input file changes are required from 4.0.2.
91+

docs/conf.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -138,7 +138,7 @@ def runDoxygen(sourcfile, doxyfileIn, doxyfileOut):
138138
# The short X.Y version.
139139
version = u'4.0'
140140
# The full version, including alpha/beta/rc tags.
141-
release = u'v4.0.2'
141+
release = u'v4.0.3'
142142

143143
# The language for content autogenerated by Sphinx. Refer to documentation
144144
# for a list of supported languages.

docs/source/user/api_change.rst

+6
Original file line numberDiff line numberDiff line change
@@ -10,6 +10,12 @@ The line number corresponds to the resulting line number after all changes are i
1010
Thus, be sure to implement each in order so that subsequent line numbers are correct.
1111

1212

13+
OpenFAST v4.0.2 to OpenFAST v4.0.3
14+
----------------------------------
15+
16+
No input file changes were made.
17+
18+
1319
OpenFAST v4.0.1 to OpenFAST v4.0.2
1420
----------------------------------
1521

Loading

docs/source/user/fast.farm/RunningFFarm.rst

+33
Original file line numberDiff line numberDiff line change
@@ -14,3 +14,36 @@ available in the :ref:`installation` documentation.
1414

1515
.. note::
1616
Checkpoint-restart capability has not yet been implemented within FAST.Farm.
17+
18+
19+
Troubleshooting
20+
---------------
21+
22+
Segmentation fault at start
23+
~~~~~~~~~~~~~~~~~~~~~~~~~~~
24+
25+
Very large FAST.Farm simulations may experience a segmentation fault if
26+
insufficient stack memory is set aside for OpenMP. This may appear on
27+
simulations with more than 50 turbines spaced over tens of kilometers. If this
28+
is the case, the fault is likely to occur right after screen displays the T=0
29+
timestep.
30+
31+
.. image:: Pictures/Troubleshooting_SegFaultScreen.png
32+
33+
To increase the stack assigned to the OpenMP process on linux based machines,
34+
the environment variable `OMP_STACKSIZE` can be increased from the default 4 MB
35+
(Intel compiled) to 32 MB (or more) by
36+
37+
.. code-block::
38+
39+
export OMP_STACKSIZE="32 M"
40+
41+
If this solves the segmentation fault, then the root cause is from the
42+
parallelization with OpenMP not having sufficient stack reserve. If this does
43+
not solve the issue, then there may be other problems that should be reported.
44+
45+
For further reading on segmentation faults with OpenMP, see `stackoverflow
46+
comment
47+
<https://stackoverflow.com/questions/13264274/why-segmentation-fault-is-happening-in-this-openmp-code/13266595#13266595>`_
48+
and `Intel OpenMP documentation
49+
<https://www.intel.com/content/www/us/en/developer/articles/troubleshooting/openmp-stacksize-common-error.html>`_.

modules/awae/src/AWAE.f90

+11-18
Original file line numberDiff line numberDiff line change
@@ -701,6 +701,13 @@ subroutine HighResGridCalcOutput(n, u, p, xd, y, m, errStat, errMsg)
701701
! NOTE: loop here is different from low res grid, doing: turbines > grid > turbines(nt/=nt2) > planes
702702
! instead of grid > turbines > planes
703703
! TODO explain
704+
!
705+
! WARNING: the way this is setup can use a lot of memory, and may run out of OMP stack. If that happens,
706+
! use `export OMP_STACKSIZE="32 M"` (default is 4 M).
707+
! Rough calculation of memory expected:
708+
! maxN_wake * 13 * OMP_NUM_THREADS * <precision> = size in bytes
709+
! HOWEVER, real world testing shows that for 103 threads with 114 turbines and maxN_wake=101346 is more like
710+
! maxN_wake * 40 * <precision> = size in bytes
704711
NumGrid_high = p%nX_high*p%nY_high*p%nZ_high
705712

706713
do nt = 1,p%NumTurbines
@@ -779,7 +786,7 @@ end subroutine HighResGridCalcOutput
779786
subroutine AWAE_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitOut, errStat, errMsg )
780787
type(AWAE_InitInputType), intent(in ) :: InitInp !< Input data for initialization routine
781788
type(AWAE_InputType), intent( out) :: u !< An initial guess for the input; input mesh must be defined
782-
type(AWAE_ParameterType),target,intent( out) :: p !< Parameters
789+
type(AWAE_ParameterType), intent( out) :: p !< Parameters
783790
type(AWAE_ContinuousStateType), intent( out) :: x !< Initial continuous states
784791
type(AWAE_DiscreteStateType), intent( out) :: xd !< Initial discrete states
785792
type(AWAE_ConstraintStateType), intent( out) :: z !< Initial guess of the constraint states
@@ -799,7 +806,7 @@ subroutine AWAE_Init( InitInp, u, p, x, xd, z, OtherState, y, m, Interval, InitO
799806
character(ErrMsgLen) :: errMsg2 ! temporary error message
800807
character(*), parameter :: RoutineName = 'AWAE_Init'
801808
type(InflowWind_InitInputType) :: IfW_InitInp
802-
type(InflowWind_InitOutputType), target :: IfW_InitOut
809+
type(InflowWind_InitOutputType) :: IfW_InitOut
803810

804811
! Initialize variables for this routine
805812
errStat = ErrID_None
@@ -1112,12 +1119,9 @@ subroutine CheckModAmb3Boundaries()
11121119
real(ReKi) :: ff_lim(2)
11131120
real(ReKi) :: hr_lim(2)
11141121
real(ReKi), parameter :: GridTol = 1.0E-3 ! Tolerance from IfW for checking the high-res grid (Mod_AmbWind=3 only).
1115-
type(FlowFieldType), pointer :: ff ! alias to shorten notation to fullfield
1116-
type(WindFileDat), pointer :: wfi ! alias to shorten notation to WindFileInfo
11171122
character(1024) :: tmpMsg
11181123

1119-
ff => p%IfW(nt)%FlowField
1120-
wfi => IfW_InitOut%WindFileInfo
1124+
associate(ff => p%IfW(nt)%FlowField, wfi => IfW_InitOut%WindFileInfo)
11211125

11221126
tmpMsg = NewLine//NewLine//'Turbine '//trim(Num2LStr(nt))//' -- Mod_AmbWind=3 requires the FAST.Farm high-res grid '// &
11231127
'is entirely contained within the flow-field from InflowWind. '//NewLine//' Try setting:'//NewLine
@@ -1192,6 +1196,7 @@ subroutine CheckModAmb3Boundaries()
11921196
ErrMsg2 = NewLine//NewLine//'Turbine '//trim(Num2LStr(nt))//' -- Mod_AmbWind=3 requires InflowWind propagation direction alignment with X or Y (0, 90, 180, 270 degrees).'
11931197
endif
11941198
endif
1199+
end associate
11951200
end subroutine CheckModAmb3Boundaries
11961201

11971202
logical function Failed()
@@ -1288,9 +1293,6 @@ subroutine AWAE_UpdateStates( t, n, u, p, x, xd, z, OtherState, m, errStat, errM
12881293
errMsg = ""
12891294

12901295
! Read the ambient wind data that is needed for t+dt, i.e., n+1
1291-
!#ifdef _OPENMP
1292-
! t1 = omp_get_wtime()
1293-
!#endif
12941296

12951297
if ( (n+1) == (p%NumDT-1) ) then
12961298
n_high_low = 0
@@ -1301,10 +1303,6 @@ subroutine AWAE_UpdateStates( t, n, u, p, x, xd, z, OtherState, m, errStat, errM
13011303
if ( p%Mod_AmbWind == 1 ) then
13021304
! read from file the ambient flow for the n+1 time step
13031305
call ReadLowResWindFile(n+1, p, m%Vamb_Low, errStat2, errMsg2); if (Failed()) return;
1304-
!#ifdef _OPENMP
1305-
! t2 = omp_get_wtime()
1306-
! write(*,*) ' AWAE_UpdateStates: Time spent reading Low Res data : '//trim(num2lstr(t2-t1))//' seconds'
1307-
!#endif
13081306

13091307
!$OMP PARALLEL DO DEFAULT(Shared) PRIVATE(nt, i_hl, errStat2, errMsg2) !Private(nt,tm2,tm3)
13101308
do nt = 1,p%NumTurbines
@@ -1400,11 +1398,6 @@ subroutine AWAE_UpdateStates( t, n, u, p, x, xd, z, OtherState, m, errStat, errM
14001398
xd%WAT_B_Box(1:3) = xd%WAT_B_Box(1:3) + xd%Ufarm(1:3)*real(p%dt_low,ReKi)
14011399
endif
14021400

1403-
!#ifdef _OPENMP
1404-
! t1 = omp_get_wtime()
1405-
! write(*,*) ' AWAE_UpdateStates: Time spent reading High Res data : '//trim(num2lstr(t1-t2))//' seconds'
1406-
!#endif
1407-
14081401
contains
14091402
logical function Failed()
14101403
call SetErrStat( ErrStat2, ErrMsg2, ErrStat, ErrMsg, RoutineName)

modules/awae/src/AWAE_IO.f90

+2
Original file line numberDiff line numberDiff line change
@@ -513,7 +513,9 @@ SUBROUTINE AWAE_PrintSum( p, u, y, ErrStat, ErrMsg )
513513

514514

515515

516+
!$OMP critical(fileopen_critical)
516517
CLOSE(UnSu)
518+
!$OMP end critical(fileopen_critical)
517519

518520
RETURN
519521
END SUBROUTINE AWAE_PrintSum

modules/nwtc-library/src/NWTC_Base.f90

+1-1
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,7 @@ MODULE NWTC_Base
3333
! General constants:
3434

3535
INTEGER, PARAMETER :: BITS_IN_ADDR = C_INTPTR_T*8 !< The number of bits in an address (32-bit or 64-bit).
36-
INTEGER, PARAMETER :: ErrMsgLen = 1024 !< The maximum number of characters in an error message in the FAST framework
36+
INTEGER, PARAMETER :: ErrMsgLen = 8196 !< The maximum number of characters in an error message in the FAST framework
3737

3838
INTEGER(IntKi), PARAMETER :: ChanLen = 20 !< The maximum allowable length of channel names (i.e., width of output columns) in the FAST framework
3939
INTEGER(IntKi), PARAMETER :: OutStrLenM1 = ChanLen - 1 !< The maximum allowable length of channel names without optional "-" or "M" at the beginning to indicate the negative of the channel

0 commit comments

Comments
 (0)