Add !$ OMP critical around file opening for VTK #2340
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.
This is the preferred alternate approach to PR #2339. If this works, this PR will be merged in and the other closed.
Feature or improvement description
We were having problems with the
!OMP
directives around high resolution file reading in AWAE.f90. Since the file reading starts with a call toGetNewUnit
before starting the opening, parallel calls toGetNewUnit
could result in the same unit number handed out to two processes. The first process would open the file and start reading, but then the second process would open a different file with the same unit number causing read errors for both processes as they attempted to read the same file at the same time.Adding
$OMP critical
around theGetNewUnit
and followingOpenFile...
calls so that in theory these cannot be done in parallel.Related issue, if one exists
#2339
Impacted areas of the software
VTK file reading within
!$OMP
loopsAdditional supporting information
Test results, if applicable
@rthedin will report on testing with many turbines in a FAST.Farm simulation.