Skip to content

OpenFAST 4.1.0: changes to ExtInfw #1665

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 3 commits into from
Jul 9, 2025

Conversation

mbkuhn
Copy link
Contributor

@mbkuhn mbkuhn commented Jun 20, 2025

Summary

Pull request type

Please check the type of change introduced:

  • Bugfix
  • Feature
  • Code style update (formatting, renaming)
  • Refactoring (no functional changes, no api changes)
  • Build related changes
  • Documentation content changes
  • Other (please describe):

Checklist

The following is included:

  • new unit-test(s)
  • new regression test(s)
  • documentation for new capability

This PR was tested by running:

  • the unit tests
    • on GPU
    • on CPU
  • the regression tests
    • on GPU
    • on CPU

Additional background

Issue Number:

@mbkuhn mbkuhn requested a review from marchdf June 20, 2025 15:30
@mbkuhn
Copy link
Contributor Author

mbkuhn commented Jun 20, 2025

Haven't tried it out yet. This is just following Andy's comments.

@mbkuhn
Copy link
Contributor Author

mbkuhn commented Jun 20, 2025

Couldn't find any instances of ExtLoads - I'm guessing that isn't used by AMR-Wind.

@marchdf
Copy link
Contributor

marchdf commented Jun 20, 2025

Thanks for doing this.

Could you also modify the cmake? https://github.com/Exawind/amr-wind/blob/main/CMakeLists.txt#L181

I think we can also add some checks there so that we don't let people build with 4.0.

@marchdf
Copy link
Contributor

marchdf commented Jun 20, 2025

Corresponding spack update: spack/spack-packages#327

@marchdf
Copy link
Contributor

marchdf commented Jun 20, 2025

I am getting:

==> Error: ProcessError: Command exited with status 2:
    '/Users/mhenryde/exawind/exawind-manager/spack/opt/spack/darwin-m1/gmake-4.4.1-wkfzb6bhicjq62gpt5hyusgopxcmsfqg/bin/make' '-j10'

5 errors found in build log:
     711    [ 49%] Building CXX object CMakeFiles/amrwind_obj.dir/amr-wind/utilities/sampling/KineticEnergy.cpp.o
     712    /Users/mhenryde/exawind/exawind-manager/spack/opt/spack/darwin-m1/compiler-wrapper-1.0-gt2el4rjwniufkjzgjggn6uud2kcedwd/libexec/spack/clang/clang++ -DAMREX_SPACEDIM=3 -DAMR_WIND_USE_NETCDF -DAMR_WIND_USE_OPENFAST -DLibLoad -DOPENFAST_VERSION_MAJOR=4 -I/Users/mhenryde/exawind/exawind-manager/spack/opt/spack/darwin-m1/openfast-4.1.0-daasazxjfbjcfj4bynztqc237nhbw2xv/include -I/Users/mhenryde/exawind/exawind-manag
            er/environments/amr-wind-of/amr-wind -I/Users/mhenryde/exawind/exawind-manager/stage/spack-stage-amr-wind-main-jokoivqtdb2usvuizdfreodu3n66zqud/spack-build-jokoivq -I/Users/mhenryde/exawind/exawind-manager/environments/amr-wind-of/amr-wind/submods/amrex/Tools/C_scripts -isystem /opt/homebrew/Cellar/netcdf/4.9.3/include -isystem /Users/mhenryde/exawind/exawind-manager/stage/spack-stage-amr-wind-main-jokoivqtdb2
            usvuizdfreodu3n66zqud/spack-build-jokoivq/submods/amrex/mod_files_3d -isystem /Users/mhenryde/exawind/exawind-manager/environments/amr-wind-of/amr-wind/submods/amrex/Src/Base -isystem /Users/mhenryde/exawind/exawind-manager/environments/amr-wind-of/amr-wind/submods/amrex/Src/Base/Parser -isystem /Users/mhenryde/exawind/exawind-manager/environments/amr-wind-of/amr-wind/submods/amrex/Src/Boundary -isystem /Users
            /mhenryde/exawind/exawind-manager/environments/amr-wind-of/amr-wind/submods/amrex/Src/AmrCore -isystem /Users/mhenryde/exawind/exawind-manager/environments/amr-wind-of/amr-wind/submods/amrex/Src/LinearSolvers -isystem /Users/mhenryde/exawind/exawind-manager/environments/amr-wind-of/amr-wind/submods/amrex/Src/LinearSolvers/MLMG -isystem /Users/mhenryde/exawind/exawind-manager/environments/amr-wind-of/amr-wind/s
            ubmods/amrex/Src/LinearSolvers/OpenBC -isystem /Users/mhenryde/exawind/exawind-manager/environments/amr-wind-of/amr-wind/submods/amrex/Src/Particle -isystem /Users/mhenryde/exawind/exawind-manager/stage/spack-stage-amr-wind-main-jokoivqtdb2usvuizdfreodu3n66zqud/spack-build-jokoivq/submods/amrex -isystem /Users/mhenryde/exawind/exawind-manager/environments/amr-wind-of/amr-wind/submods/AMReX-Hydro/Utils -isystem
             /Users/mhenryde/exawind/exawind-manager/environments/amr-wind-of/amr-wind/submods/AMReX-Hydro/MOL -isystem /Users/mhenryde/exawind/exawind-manager/environments/amr-wind-of/amr-wind/submods/AMReX-Hydro/Godunov -isystem /Users/mhenryde/exawind/exawind-manager/environments/amr-wind-of/amr-wind/submods/AMReX-Hydro/BDS -isystem /Users/mhenryde/exawind/exawind-manager/environments/amr-wind-of/amr-wind/submods/AMReX
            -Hydro/Projections -isystem /opt/homebrew/include -isystem /Users/mhenryde/exawind/exawind-manager/spack/opt/spack/darwin-m1/mpich-4.3.0-pfw6qt5u6cyargyxiw6rwonhbyglwy3t/include -g -std=c++17 -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.2.sdk -mmacosx-version-min=13.0 -fPIC -Wall -Wextra -pedantic -faligned-new -Wunreachable-code -Wnull-dereference -Wfloat-conversion -Wshadow -Woverl
            oaded-virtual -Wno-pass-failed -O0 -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -MD -MT CMakeFiles/amrwind_obj.dir/amr-wind/utilities/sampling/KineticEnergy.cpp.o -MF CMakeFiles/amrwind_obj.dir/amr-wind/utilities/sampling/KineticEnergy.cpp.o.d -o CMakeFiles/amrwind_obj.dir/amr-wind/utilities/sampling/KineticEnergy.cpp.o -c /Users/mhenryde/exawind/exawind-manager/environments/amr-wind-of/amr-win
            d/amr-wind/utilities/sampling/KineticEnergy.cpp
     713    [ 49%] Building CXX object CMakeFiles/amrwind_obj.dir/amr-wind/utilities/sampling/Enstrophy.cpp.o
     714    /Users/mhenryde/exawind/exawind-manager/spack/opt/spack/darwin-m1/compiler-wrapper-1.0-gt2el4rjwniufkjzgjggn6uud2kcedwd/libexec/spack/clang/clang++ -DAMREX_SPACEDIM=3 -DAMR_WIND_USE_NETCDF -DAMR_WIND_USE_OPENFAST -DLibLoad -DOPENFAST_VERSION_MAJOR=4 -I/Users/mhenryde/exawind/exawind-manager/spack/opt/spack/darwin-m1/openfast-4.1.0-daasazxjfbjcfj4bynztqc237nhbw2xv/include -I/Users/mhenryde/exawind/exawind-manag
            er/environments/amr-wind-of/amr-wind -I/Users/mhenryde/exawind/exawind-manager/stage/spack-stage-amr-wind-main-jokoivqtdb2usvuizdfreodu3n66zqud/spack-build-jokoivq -I/Users/mhenryde/exawind/exawind-manager/environments/amr-wind-of/amr-wind/submods/amrex/Tools/C_scripts -isystem /opt/homebrew/Cellar/netcdf/4.9.3/include -isystem /Users/mhenryde/exawind/exawind-manager/stage/spack-stage-amr-wind-main-jokoivqtdb2
            usvuizdfreodu3n66zqud/spack-build-jokoivq/submods/amrex/mod_files_3d -isystem /Users/mhenryde/exawind/exawind-manager/environments/amr-wind-of/amr-wind/submods/amrex/Src/Base -isystem /Users/mhenryde/exawind/exawind-manager/environments/amr-wind-of/amr-wind/submods/amrex/Src/Base/Parser -isystem /Users/mhenryde/exawind/exawind-manager/environments/amr-wind-of/amr-wind/submods/amrex/Src/Boundary -isystem /Users
            /mhenryde/exawind/exawind-manager/environments/amr-wind-of/amr-wind/submods/amrex/Src/AmrCore -isystem /Users/mhenryde/exawind/exawind-manager/environments/amr-wind-of/amr-wind/submods/amrex/Src/LinearSolvers -isystem /Users/mhenryde/exawind/exawind-manager/environments/amr-wind-of/amr-wind/submods/amrex/Src/LinearSolvers/MLMG -isystem /Users/mhenryde/exawind/exawind-manager/environments/amr-wind-of/amr-wind/s
            ubmods/amrex/Src/LinearSolvers/OpenBC -isystem /Users/mhenryde/exawind/exawind-manager/environments/amr-wind-of/amr-wind/submods/amrex/Src/Particle -isystem /Users/mhenryde/exawind/exawind-manager/stage/spack-stage-amr-wind-main-jokoivqtdb2usvuizdfreodu3n66zqud/spack-build-jokoivq/submods/amrex -isystem /Users/mhenryde/exawind/exawind-manager/environments/amr-wind-of/amr-wind/submods/AMReX-Hydro/Utils -isystem
             /Users/mhenryde/exawind/exawind-manager/environments/amr-wind-of/amr-wind/submods/AMReX-Hydro/MOL -isystem /Users/mhenryde/exawind/exawind-manager/environments/amr-wind-of/amr-wind/submods/AMReX-Hydro/Godunov -isystem /Users/mhenryde/exawind/exawind-manager/environments/amr-wind-of/amr-wind/submods/AMReX-Hydro/BDS -isystem /Users/mhenryde/exawind/exawind-manager/environments/amr-wind-of/amr-wind/submods/AMReX
            -Hydro/Projections -isystem /opt/homebrew/include -isystem /Users/mhenryde/exawind/exawind-manager/spack/opt/spack/darwin-m1/mpich-4.3.0-pfw6qt5u6cyargyxiw6rwonhbyglwy3t/include -g -std=c++17 -arch arm64 -isysroot /Library/Developer/CommandLineTools/SDKs/MacOSX14.2.sdk -mmacosx-version-min=13.0 -fPIC -Wall -Wextra -pedantic -faligned-new -Wunreachable-code -Wnull-dereference -Wfloat-conversion -Wshadow -Woverl
            oaded-virtual -Wno-pass-failed -O0 -Wno-sign-compare -Wno-unused-parameter -Wno-unused-variable -MD -MT CMakeFiles/amrwind_obj.dir/amr-wind/utilities/sampling/Enstrophy.cpp.o -MF CMakeFiles/amrwind_obj.dir/amr-wind/utilities/sampling/Enstrophy.cpp.o.d -o CMakeFiles/amrwind_obj.dir/amr-wind/utilities/sampling/Enstrophy.cpp.o -c /Users/mhenryde/exawind/exawind-manager/environments/amr-wind-of/amr-wind/amr-wind/u
            tilities/sampling/Enstrophy.cpp
     715    In file included from /Users/mhenryde/exawind/exawind-manager/environments/amr-wind-of/amr-wind/amr-wind/utilities/sampling/DTUSpinnerSampler.cpp:10:
     716    In file included from /Users/mhenryde/exawind/exawind-manager/environments/amr-wind-of/amr-wind/amr-wind/wind_energy/actuator/turbine/fast/TurbineFast.H:5:
  >> 717    /Users/mhenryde/exawind/exawind-manager/environments/amr-wind-of/amr-wind/amr-wind/wind_energy/actuator/turbine/fast/fast_types.H:97:15: error: no type named 'SC_DX_InputType' in namespace 'exw_fast'; did you mean 'ExtLdDX_InputType'?
     718        exw_fast::SC_DX_InputType to_sc;
     719        ~~~~~~~~~~^~~~~~~~~~~~~~~
     720                  ExtLdDX_InputType
     721    /Users/mhenryde/exawind/exawind-manager/spack/opt/spack/darwin-m1/openfast-4.1.0-daasazxjfbjcfj4bynztqc237nhbw2xv/include/ExtLoadsDX_Types.h:21:16: note: 'ExtLdDX_InputType' declared here
     722    typedef struct ExtLdDX_InputType {

@marchdf
Copy link
Contributor

marchdf commented Jun 20, 2025

The cmake works as expected though, so that's good:

45 errors found in build log:
     45      CMake Warning at cmake/amr-wind-utils.cmake:102 (message):
     46        clang-tidy not found.
     47      Call Stack (most recent call first):
     48        CMakeLists.txt:129 (init_code_checks)
     49
     50
  >> 51      CMake Error at CMakeLists.txt:189 (message):
     52        AMR-Wind does not support OpenFAST version 4.0.  Either update to 4.1 or
     53        revert to 3.

@marchdf
Copy link
Contributor

marchdf commented Jun 20, 2025

Pushed a fix, so it now builds. Want to make sure I didn't also break OF 3.5 and non-OF builds.

@marchdf
Copy link
Contributor

marchdf commented Jun 20, 2025

Building with 3.5 seems ok.

Let's get: spack/spack-packages#327 merged and then update exawind-manager with the updated package repo and then merge this?

@marchdf
Copy link
Contributor

marchdf commented Jun 23, 2025

I realized the spack package logic will be a bit more complex.

For any version of amr-wind >= 2.0, we allow in general, openfast >= 3.5.
Except:

  • we don't ever want to allow 4.0.0 - 4.0.3 since those have bugs. But they are marked deprecated in the openfast package so I don't think we need to worry about that;
  • for amr-wind between 2.0.0 and 3.5.0, we can only have openfast 3.5.x-4.0.x
  • for amr-wind above 3.5.0, we can only have openfast 3.5.x-4.1.x, but not 4.0.x.

I think we can capture this with this:

    depends_on("[email protected]:", when="@2: +openfast")
    depends_on('[email protected]:4.0', when='@2.0.0:3.5.0')
    depends_on('[email protected]:3.5.9,4.1:', when='@3.5.1:')

but that assumes our next version of amr-wind (3.5.1) is the one that is going to contain this commit. Feels weird to have a patch version of amr-wind need that kind of logic. So what should it be? 3.6? And we only merge this when we are ready for that release?

@marchdf marchdf changed the title OpenFAST 4.1.0: changes to ExtInfw based on github comments OpenFAST 4.1.0: changes to ExtInfw Jun 23, 2025
@marchdf
Copy link
Contributor

marchdf commented Jun 23, 2025

Game plan: wait for OF to release more tags (based on some bug fixes), merge this, tag AMR-Wind, immediately update the spack PR with all the tags, merge that, update exawind-manager with latest spack.

@marchdf marchdf force-pushed the OpenFAST_4.1_compatible branch from a55994c to 01c3f81 Compare July 7, 2025 20:44
@mbkuhn mbkuhn marked this pull request as ready for review July 7, 2025 20:55
@andrew-platt
Copy link

OpenFAST 4.1.1 is now out: https://github.com/OpenFAST/openfast/releases/tag/v4.1.1

This includes a fix from @marchdf for the C++ interfacing

@marchdf marchdf force-pushed the OpenFAST_4.1_compatible branch from 01c3f81 to 59b184e Compare July 9, 2025 13:50
@marchdf marchdf enabled auto-merge (squash) July 9, 2025 13:51
@marchdf marchdf merged commit 56f79ad into Exawind:main Jul 9, 2025
14 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants