AD14: Restructure loop to fix optimization bug #348
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Complete this sentence
THIS PULL REQUEST IS READY TO MERGE
Feature or improvement description
When compiling with gfortran version 8+ on macOS and
-O3
compiler optimization level, AeroDyn 14 seg faults. This seems to be an issue with the compiler as the faulty loop shouldn't be compiled since it has a read and write to a location in memory within the same iteration loop. In any case, this change removes the read-write operation in the same line by replacing the loops with a more explicit summation.Related issue, if one exists
#347
Impacted areas of the software
AeroDyn 14
Additional supporting information
None
Test results, if applicable
As seen below, 4 tests did fail in the regression test suite. However, this is due to running with the newer
gfortran
compiler rather thangfortran-7
which was used to generate the baselines. These test cases show that the bug is fixed, and the error plots for the failing tests are consistent with what we expect when changing the compiler.