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

HD/Morison performance improvement, NWTC Lib and BD bug fixes #615

Merged
merged 13 commits into from
Jan 20, 2021

Conversation

bjonkman
Copy link
Contributor

@bjonkman bjonkman commented Dec 18, 2020

Feature or improvement description
This pull request increases the efficiency of HydroDyn's Morison CalcOutput routine (based on profiling results), fixes a few minor debugging issues that seem to be related to the latest Intel compiler suite I installed, and updates some minor issues I found in NWTC Library.

Related issue, if one exists
none

Impacted areas of the software
HydroDyn, NWTC_Library, BeamDyn

The details:

  • HydroDyn

    • HydroDyn's Morison CalcOutput routine was updated so that the interpolation routiness it uses are more efficient. The waveTime (X) array is checked only one time, and it uses the calculated slope for all of the corresponding (Y) arrays (in nested loops) In my tests, this change resulted in a little more than 1% speed improvement.
    • I also updated some HydroDyn code so that my newest Intel debugger does not complain about uninitialized variables or passing unallocated arrays.
    • I removed a (non-standard) tab from the Waves.f90 source file.
  • NWTC_Library

    • I regenerated the parts of the NWTC_Library that are generated by the registry to ensure consistency between the Registry include files and the code.
    • I added an #else statement in DispCompileRuntimeInfo to prevent any chance of using uninitialized variables there.
    • I added a NWTC_SizeOfNumWord parameter to use in place of hard-coded values in the input-file parsing routines, for consistency between Envision and NREL code bases.
    • I fixed a bug in ReadFASTbin, where trying to read from uncompressed binary files would have resulted in garbage or a seg fault.
    • I changed the error number if the LoadDynamicLibProc routines ever fail, to allow calling routines to determine which procedure failed to load (this is potentially used in ServoDyn with loading non-legacy DLLs)
  • BeamDyn

    • The error status variables weren't initialized in the BD_Interp_Pos_CRV routine. If the compiler initialized the error status variable to a large random number, the code would fail.

Test results, if applicable

These changes do not affect the regression tests: https://github.com/bjonkman/openfast/actions/runs/413886628

1. fix `ReadFASTbin` for uncompressed files. Previous implementation would have resulted in seg fault or garbage data.
2. added default #else for #if statement in `DispCompileRuntimeInfo` to avoid printing an uninitialized string in (rare) cases
3. Also (not a bug): updated code to use parameter for size of numeric "word" being read to lessen conflicts with Envision.
Find the slope (x-interpolant) only one time, then use that to interpolate all the other dependent variables inside loops. This saved a little over 1% processing time in the case I ran.

This could also be used elsewhere in the HydroDyn CalcOutput routines, though I didn't do that, yet.
Though we should probably just add an interface for these routines instead.
Some unallocated arrays are passed as subroutine arguments; my latest debugger is unhappy with this unless we add the "allocatable" attribute to the arguments.
also added some more "allocatable" attributes for unallocated arrays passed to subroutines
Copy link
Collaborator

@andrew-platt andrew-platt left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This might cause conflicts with #537, but I would like to merge this before then.

It all looks good to me.

@rafmudaf rafmudaf changed the title HD/Morison efficiency improvements + minor bug fixes HD/Morison performance improvement, NWTC Lib and BD bug fixes Jan 20, 2021
@rafmudaf rafmudaf merged commit 07838f7 into OpenFAST:dev Jan 20, 2021
@bjonkman bjonkman deleted the b/MinorFixes branch January 20, 2021 21:34
@rafmudaf rafmudaf mentioned this pull request May 11, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants