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

Vectorize a section of VariousWaves_Init #602

Merged
merged 3 commits into from
Nov 24, 2020

Conversation

rafmudaf
Copy link
Collaborator

Feature or improvement description
This pull request improves the vectorization potential of a set of initialization lines in the Waves submodule of HydroDyn. This is relatively small performance improvement as it saves only about 3 seconds of initialization time in the offshore 5MW cases. Its also a fixed-cost improvement since it is in the init; that is, the speed up is similar whether the simulation duration is 60 seconds or 1 second. In any case, faster is faster :)

I've also added commented flags for getting profiling and performance information from the Intel compiler in the CMake configuration. See the attached optimization reports for details regarding the vectorization improvements by the compiler due to this change. These are best viewed as a side-by-side diff.

One question is whether the bounds of the loop are meaningful in the current version. The outer loop goes from 0 to InitOut%NStepWave-1, but all of the variables accessed in the loop are allocated to 0:InitOut%NStepWave in their first dimension. Is the last index of the first dimension required to be empty or uninitialized?

Related issue, if one exists
None

Impacted areas of the software
Waves submodule of HydroDyn: VariousWave_Init subroutine

Additional supporting information
This was funded by Intel through their designation of NREL as an Intel Parallel Computing Center (IPCC). The objective was to improve the vectorization of the offshore module by using the Intel compiler and related tools. We wanted to get as much speed up as possible without making significant changed to the OpenFAST source code.

current_Waves.f90.optrpt.log
incoming_Waves.f90.optrpt.log

@rafmudaf rafmudaf self-assigned this Nov 24, 2020
@andrew-platt
Copy link
Collaborator

The last point in the array can be initialized to zero. It gets set to value of the first point in the array here.

@andrew-platt
Copy link
Collaborator

Nice find! This looks good to me!

@andrew-platt andrew-platt merged commit f4e1192 into dev Nov 24, 2020
@rafmudaf rafmudaf deleted the vectorize_variouswavesinit branch November 24, 2020 23:40
andrew-platt added a commit to andrew-platt/openfast that referenced this pull request Dec 2, 2020
andrew-platt added a commit to andrew-platt/openfast that referenced this pull request Dec 2, 2020
@rafmudaf rafmudaf mentioned this pull request Jan 13, 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.

2 participants