Skip to content
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

inflowWind C-bound interface and python wrapper #720

Merged
merged 69 commits into from
Sep 30, 2021
Merged
Show file tree
Hide file tree
Changes from 68 commits
Commits
Show all changes
69 commits
Select commit Hold shift + click to select a range
0dce168
initial rough start
nrmendoza Feb 10, 2021
b3f3e66
skeleton
nrmendoza Feb 12, 2021
44b2cab
skeleton
nrmendoza Feb 12, 2021
33ddc22
convert python string array into fortran character array
nrmendoza Feb 12, 2021
0bbf4a9
Add initial IFW Python interface and driver
rafmudaf Feb 12, 2021
e63a7f5
first compilation!
nrmendoza Feb 13, 2021
faf4f2f
Merge branch 'CCT2' of https://github.com/nrmendoza/openfast into CCT2
nrmendoza Feb 13, 2021
e87745e
flushed out IFW_INIT_C, and added skeleton for IFW_CALCOUTPUT_C and I…
nrmendoza Feb 13, 2021
f297bfa
working python scripts, new features, and clean up
nrmendoza Feb 17, 2021
b24a454
Simplify InflowWind C-API CMake config
rafmudaf Feb 17, 2021
24e16cb
Pass string inputs through C-API to IFW module
rafmudaf Feb 17, 2021
8d302a4
Pass input strings through Python interface
rafmudaf Feb 17, 2021
39af5fb
Expand the Python driver code to demo string init
rafmudaf Feb 17, 2021
17b2e56
Bug fix: initialize error message variable
rafmudaf Feb 17, 2021
29408a6
Bug fix in input length
rafmudaf Feb 17, 2021
d773aa9
upgrades to ifw_init and more progress on ifw_calcOutput
nrmendoza Feb 22, 2021
b03bb6c
successful run-through of ifw_init, ifw_calcOutput, and ifw_end!
nrmendoza Feb 23, 2021
f4472e7
added a bunch of print statements for debugging wrong numbers
nrmendoza Feb 24, 2021
545f7ff
Fix the data representation from Python to Fortran
rafmudaf Feb 24, 2021
b86a0ea
Properly size the output channels array
rafmudaf Feb 24, 2021
74e772e
working, clean code for ifw with outputChannels that generates correc…
nrmendoza Feb 25, 2021
41e5f3d
minor bug fix plus compilation instructions on all platforms
nrmendoza Mar 19, 2021
99213ce
both uniform and TurbSim wind types and input files now work!
nrmendoza Mar 31, 2021
4c5bec5
added comments, documentation, and a new feature: input file lengths …
nrmendoza Apr 16, 2021
8423720
ifw_c_lib: rearrange repo, update cmakelists
andrew-platt May 4, 2021
e8751ac
Merge remote-tracking branch 'OpenFAST/dev' into f/CCT2-IFW_wrapper
andrew-platt May 4, 2021
64237ee
ifw_c_lib: move test case to r-test, rearrange
andrew-platt May 4, 2021
44cb021
ifw_c_lib: modify error handling
andrew-platt May 4, 2021
d35a99f
ifw_c_lib: add ifw driver test case infrastructure
andrew-platt May 4, 2021
4a38f91
IfW_c_lib: minor notes in r-test
andrew-platt May 13, 2021
7f26f22
IfW: redundancy in error handling of InflowWind_ParseInputFileInfo ro…
andrew-platt May 14, 2021
04f72f9
NWTC lib: add InitFileInfo_FromNullCString subroutine
andrew-platt May 18, 2021
b35c88f
NWTC lib: add unit test for InitFileInfo_FromNullCString subroutine a…
andrew-platt May 18, 2021
3140924
IfW: Change input file string passing for ifw_c_lib
andrew-platt May 18, 2021
5879407
ifw_c_lib: improve error handling and add results
andrew-platt May 19, 2021
7d49391
ifw_c_lib: configure inflowwind python driver regression test
andrew-platt May 19, 2021
e37356e
Merge remote-tracking branch 'OpenFAST/dev' into nr/f/CCT2-IFW_wrapper
andrew-platt May 19, 2021
3cf11dc
Merge remote-tracking branch 'nrmendoza/f/CCT2-IFW_wrapper' into f/CC…
andrew-platt May 19, 2021
eb2e83d
IfW_c_lib: add VS project and solution
May 11, 2021
7871b11
ifw_c_lib: error handling to prevent string overflow of ErrMsg_C
andrew-platt May 24, 2021
bc96f13
ifw_c_lib: update r-test pointer
andrew-platt May 25, 2021
6413ee3
ifw_c_lib: removed unnecessary comments and variable declerations
andrew-platt May 25, 2021
92d7d67
ifw_c_lib: simplify error passing routine in the ifw_c.f90
andrew-platt May 25, 2021
9f99279
Merge pull request #2 from andrew-platt/f/CCT2-IFW_wrapper
nrmendoza May 25, 2021
ce109ac
Merge remote-tracking branch 'OpenFAST/dev' into f/CCT2-IFW_wrapper
andrew-platt May 25, 2021
7f94898
ifw_c_lib: add some comments
andrew-platt May 26, 2021
46a9d7c
ifw_c_lib: fix passing of channel names/units
andrew-platt May 27, 2021
6e070a3
IfW_C_lib: move helper output functions from (test)driver to library
andrew-platt Jun 8, 2021
8c38cda
Merge remote-tracking branch 'OpenFAST/dev' into f/CCT2-IFW_wrapper
andrew-platt Jun 8, 2021
be437ed
ifw_c_lib: improve windows 32/64 bit handling in test case
andrew-platt Jun 9, 2021
8b98005
Merge remote-tracking branch 'OpenFAST/dev' into f/CCT2-IFW_wrapper
andrew-platt Aug 6, 2021
8298f9f
Suggested improvements to the C-binding naming
rafmudaf Sep 28, 2021
ef5eb55
Pythonize the Python interface module
rafmudaf Sep 28, 2021
7c205e8
Replace \n with portable line separator
rafmudaf Sep 28, 2021
4e4412f
Update regression test scripts
rafmudaf Sep 28, 2021
58019d7
Add InflowWind regression tests to Actions
rafmudaf Sep 28, 2021
2d05364
Add a block for running all interface-tests
rafmudaf Sep 28, 2021
8a6f78f
Bug fix in Actions case filter command
rafmudaf Sep 28, 2021
cd398f7
Actions bug fix - compile IfW driver code
rafmudaf Sep 28, 2021
144a261
Use in-source build in GitHub Actions
rafmudaf Sep 28, 2021
94dae10
Merge remote-tracking branch 'raf/dev' into f/CCT2-IFW_wrapper
rafmudaf Sep 28, 2021
d8d3fb8
Merge remote-tracking branch 'raf/dev' into f/CCT2-IFW_wrapper
rafmudaf Sep 28, 2021
03771ea
BugFix: InflowWind Python interface output
rafmudaf Sep 28, 2021
a98c58f
Merge remote-tracking branch 'OpenFAST/dev' into f/CCT2-IFW_wrapper
andrew-platt Sep 28, 2021
5a812df
Merge branch 'f/CCT2-IFW_wrapper' into f/CCT2-IFW_wrapper
andrew-platt Sep 28, 2021
6c5bc0a
Merge pull request #14 from rafmudaf/f/CCT2-IFW_wrapper
andrew-platt Sep 28, 2021
d0f576c
Resolve minor whitespace issues after merge
andrew-platt Sep 28, 2021
3999175
IfW_C_lib: update VS projects
andrew-platt Sep 28, 2021
7af1199
IfW_C: remove old library file (was renamed, but not removed somehow)
andrew-platt Sep 30, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
20 changes: 18 additions & 2 deletions .github/actions/tests-module-inflowwind/action.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,25 @@
name: 'InflowWind module tests'
description: 'Run tests specific to the InflowWind module'
author: 'Rafael Mudafort https://github.com/rafmudaf'

inputs:
test-target:
description: 'Which tests to run: unit | regression | all'
default: 'all'

runs:
using: "composite"
steps:
- run: ctest -VV -R inflowwind_utest
steps:
- run: |

if [[ ${{ inputs.test-target }} == "unit" ]] || [[ ${{ inputs.test-target }} == "all" ]]; then
ctest -VV -R inflowwind_utest
fi

if [[ ${{ inputs.test-target }} == "regression" ]] || [[ ${{ inputs.test-target }} == "all" ]]; then
ctest -VV -j7 -R ifw_ -LE python
# Exclude the Python-interface tests since those are run directly in the job
fi

working-directory: ${{runner.workspace}}/openfast/build
shell: bash
55 changes: 37 additions & 18 deletions .github/workflows/automated-dev-tests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -70,6 +70,10 @@ jobs:
test-target: regression
- name: Run HydroDyn tests
uses: ./.github/actions/tests-module-hydrodyn
- name: Run InflowWind tests
uses: ./.github/actions/tests-module-inflowwind
with:
test-target: regression
- name: Run SubDyn tests
uses: ./.github/actions/tests-module-subdyn
- name: Run OpenFAST tests
Expand Down Expand Up @@ -143,6 +147,7 @@ jobs:
cmake --build . --target aerodyn_driver -- -j ${{env.NUM_PROCS}}
cmake --build . --target beamdyn_driver -- -j ${{env.NUM_PROCS}}
cmake --build . --target hydrodyn_driver -- -j ${{env.NUM_PROCS}}
cmake --build . --target inflowwind_driver -- -j ${{env.NUM_PROCS}}
cmake --build . --target subdyn_driver -- -j ${{env.NUM_PROCS}}

- name: Run AeroDyn tests
Expand All @@ -155,6 +160,10 @@ jobs:
test-target: regression
- name: Run HydroDyn tests
uses: ./.github/actions/tests-module-hydrodyn
- name: Run InflowWind tests
uses: ./.github/actions/tests-module-inflowwind
with:
test-target: regression
- name: Run SubDyn tests
uses: ./.github/actions/tests-module-subdyn

Expand Down Expand Up @@ -213,12 +222,12 @@ jobs:
pip install numpy Bokeh==1.4

- name: Setup Workspace
run: cmake -E make_directory ${{runner.workspace}}/build
run: cmake -E make_directory ${{runner.workspace}}/openfast/build
- name: Configure Build
working-directory: ${{runner.workspace}}/build
working-directory: ${{runner.workspace}}/openfast/build
run: |
cmake \
-DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/install \
-DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/openfast/install \
-DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \
-DOPENMP:BOOL=ON \
-DBUILD_FASTFARM:BOOL=ON \
Expand All @@ -228,15 +237,15 @@ jobs:
${GITHUB_WORKSPACE}
- name: Build FAST.Farm
# if: contains(github.event.head_commit.message, 'Action - Test All') || contains(github.event.pull_request.labels.*.name, 'Action - Test All')
working-directory: ${{runner.workspace}}/build
working-directory: ${{runner.workspace}}/openfast/build
run: |
cmake --build . --target FAST.Farm -- -j ${{env.NUM_PROCS}}
cmake --build . --target regression_tests -- -j ${{env.NUM_PROCS}}

- name: Run FAST.Farm tests
run: |
ctest -VV -L fastfarm -j ${{env.NUM_PROCS}}
working-directory: ${{runner.workspace}}/build
working-directory: ${{runner.workspace}}/openfast/build
shell: bash

- name: Failing test artifacts
Expand All @@ -245,7 +254,7 @@ jobs:
with:
name: test-results
path: |
${{runner.workspace}}/build/reg_tests/glue-codes/fastfarm
${{runner.workspace}}/openfast/build/reg_tests/glue-codes/fastfarm

unit-test:
runs-on: ubuntu-20.04
Expand Down Expand Up @@ -298,6 +307,8 @@ jobs:
test-target: unit
- name: Run InflowWind tests
uses: ./.github/actions/tests-module-inflowwind
with:
test-target: unit

- name: Generate coverage report
working-directory: ${{runner.workspace}}/openfast/build
Expand Down Expand Up @@ -346,25 +357,25 @@ jobs:
with:
submodules: recursive
- name: Setup
run: cmake -E make_directory ${{runner.workspace}}/build
run: cmake -E make_directory ${{runner.workspace}}/openfast/build
- name: Configure
working-directory: ${{runner.workspace}}/build
working-directory: ${{runner.workspace}}/openfast/build
run: |
cmake \
-DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/install \
-DCMAKE_INSTALL_PREFIX:PATH=${{runner.workspace}}/openfast/install \
-DCMAKE_Fortran_COMPILER:STRING=${{env.FORTRAN_COMPILER}} \
-DCMAKE_BUILD_TYPE:STRING=Debug \
-DDOUBLE_PRECISION:BOOL=OFF \
-DGENERATE_TYPES:BOOL=ON \
${GITHUB_WORKSPACE}
- name: Build all
working-directory: ${{runner.workspace}}/build
working-directory: ${{runner.workspace}}/openfast/build
run: cmake --build . --target all -- -j ${{env.NUM_PROCS}}
- name: Test
working-directory: ${{runner.workspace}}/build
working-directory: ${{runner.workspace}}/openfast/build
run: ./glue-codes/openfast/openfast -v

cpp-interface-tests:
interface-tests:
runs-on: ubuntu-20.04
steps:
- name: Checkout
Expand Down Expand Up @@ -403,17 +414,24 @@ jobs:
-DCODECOV:BOOL=ON \
${GITHUB_WORKSPACE}

- name: Build OpenFAST C++ API
- name: Build OpenFAST C-Interfaces
working-directory: ${{runner.workspace}}/openfast/build
run: |
cmake --build . --target openfastlib -- -j ${{env.NUM_PROCS}}
cmake --build . --target openfastcpp -- -j ${{env.NUM_PROCS}}
cmake --build . --target ifw_c_binding -- -j ${{env.NUM_PROCS}}
cmake --build . --target regression_tests -- -j ${{env.NUM_PROCS}}

- name: Run OpenFAST C++ API tests
- name: Run C++ API tests
working-directory: ${{runner.workspace}}/openfast/build
run: |
ctest -VV -L cpp

- name: Run Python API tests
working-directory: ${{runner.workspace}}/openfast/build
run: |
ctest -VV -L python

- name: Generate coverage report
working-directory: ${{runner.workspace}}/openfast/build
run: |
Expand All @@ -436,15 +454,16 @@ jobs:
uses: actions/upload-artifact@v2
if: success()
with:
name: cpp-reg-tests
name: c-interface-reg-tests
path: |
${{runner.workspace}}/openfast/regressioncov.xml

- name: Failing test artifacts
uses: actions/upload-artifact@v2
if: failure()
with:
name: cpp-reg-tests
name: c-interface-reg-tests
path: |
${{runner.workspace}}/build/reg_tests/glue-codes/openfast-cpp
!${{runner.workspace}}/build/reg_tests/glue-codes/openfast-cpp/5MW_Baseline
${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast-cpp
${{runner.workspace}}/openfast/build/reg_tests/modules/inflowwind
!${{runner.workspace}}/openfast/build/reg_tests/glue-codes/openfast-cpp/5MW_Baseline
11 changes: 9 additions & 2 deletions modules/inflowwind/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ set(IFW_SOURCES
src/IfW_UserWind.f90
src/IfW_UniformWind.f90
src/InflowWind_Subs.f90
src/InflowWind.f90
src/InflowWind.f90
src/Lidar.f90
src/IfW_FFWind_Base.f90
src/IfW_FFWind_Base_Types.f90
Expand All @@ -51,6 +51,13 @@ set(IFW_SOURCES
add_library(ifwlib ${IFW_SOURCES})
target_link_libraries(ifwlib nwtclibs)

# C-bound interface library
add_library(ifw_c_binding SHARED src/IfW_C_Binding.f90)
target_link_libraries(ifw_c_binding ifwlib)
if(APPLE OR UNIX)
target_compile_definitions(ifw_c_binding PUBLIC -DIMPLICIT_DLLEXPORT)
endif()

set(IFW_DRIVER_SOURCES
src/InflowWind_Driver_Types.f90
src/InflowWind_Driver_Subs.f90
Expand All @@ -60,7 +67,7 @@ set(IFW_DRIVER_SOURCES
add_executable(inflowwind_driver ${IFW_DRIVER_SOURCES})
target_link_libraries(inflowwind_driver ifwlib ${CMAKE_DL_LIBS})

install(TARGETS inflowwind_driver ifwlib
install(TARGETS inflowwind_driver ifwlib ifw_c_binding
EXPORT "${CMAKE_PROJECT_NAME}Libraries"
RUNTIME DESTINATION bin
LIBRARY DESTINATION lib
Expand Down
Loading