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

Temporarily removing InflowWind parallelization #1266

Merged
merged 1 commit into from
Oct 4, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
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
12 changes: 6 additions & 6 deletions modules/inflowwind/src/IfW_FFWind_Base.f90
Original file line number Diff line number Diff line change
Expand Up @@ -102,28 +102,28 @@ SUBROUTINE IfW_FFWind_CalcOutput(Time, PositionXYZ, p, Velocity, DiskVel, ErrSta


! Step through all the positions and get the velocities
!$OMP PARALLEL default(shared) if(PointNum>1000)
!$OMP do private(PointNum, TmpErrStat, TmpErrMsg ) schedule(runtime)
!OMP PARALLEL default(shared) if(NumPoints>1000)
!OMP do private(PointNum, TmpErrStat, TmpErrMsg ) schedule(runtime)
DO PointNum = 1, NumPoints

! Calculate the velocity for the position
Velocity(:,PointNum) = FFWind_Interp(Time,PositionXYZ(:,PointNum),p,TmpErrStat,TmpErrMsg)

! Error handling
IF (TmpErrStat /= ErrID_None) THEN ! adding this so we don't have to convert numbers to strings every time
!$OMP CRITICAL ! Needed to avoid data race on ErrStat and ErrMsg
!OMP CRITICAL ! Needed to avoid data race on ErrStat and ErrMsg
ErrStat = ErrID_None
ErrMsg = ""
CALL SetErrStat( TmpErrStat, TmpErrMsg, ErrStat, ErrMsg, RoutineName//" [position=("// &
TRIM(Num2LStr(PositionXYZ(1,PointNum)))//", "// &
TRIM(Num2LStr(PositionXYZ(2,PointNum)))//", "// &
TRIM(Num2LStr(PositionXYZ(3,PointNum)))//") in wind-file coordinates]" )
!$OMP END CRITICAL
!OMP END CRITICAL
END IF

ENDDO
!$OMP END DO
!$OMP END PARALLEL
!OMP END DO
!OMP END PARALLEL
IF (ErrStat >= AbortErrLev) RETURN ! Return cannot be in parallel loop

IF (p%AddMeanAfterInterp) THEN
Expand Down
12 changes: 6 additions & 6 deletions modules/inflowwind/src/IfW_UniformWind.f90
Original file line number Diff line number Diff line change
Expand Up @@ -481,8 +481,8 @@ SUBROUTINE IfW_UniformWind_CalcOutput(Time, PositionXYZ, p, Velocity, DiskVel, m
CALL InterpParams(Time, p, m, op)

! Step through all the positions and get the velocities
!$OMP PARALLEL default(shared) if(NumPoints>1000)
!$OMP do private(PointNum, TmpErrStat, TmpErrMsg ) schedule(runtime)
!OMP PARALLEL default(shared) if(NumPoints>1000)
!OMP do private(PointNum, TmpErrStat, TmpErrMsg ) schedule(runtime)
DO PointNum = 1, NumPoints

! Calculate the velocity for the position
Expand All @@ -495,16 +495,16 @@ SUBROUTINE IfW_UniformWind_CalcOutput(Time, PositionXYZ, p, Velocity, DiskVel, m
TRIM(Num2LStr(PositionXYZ(1,PointNum)))//", "// &
TRIM(Num2LStr(PositionXYZ(2,PointNum)))//", "// &
TRIM(Num2LStr(PositionXYZ(3,PointNum)))//") in the wind-file coordinates"
!$OMP CRITICAL ! Needed to avoid data race on ErrStat and ErrMsg
!OMP CRITICAL ! Needed to avoid data race on ErrStat and ErrMsg
ErrStat = ErrID_None
ErrMsg = ""
CALL SetErrStat(TmpErrStat,TmpErrMsg,ErrStat,ErrMsg,RoutineName)
!$OMP END CRITICAL
!OMP END CRITICAL
ENDIF

ENDDO
!$OMP END DO
!$OMP END PARALLEL
!OMP END DO
!OMP END PARALLEL

IF (ErrStat >= AbortErrLev) RETURN ! Return cannot be in parallel loop

Expand Down