Skip to content

Commit

Permalink
Merge pull request #2340 from andrew-platt/b/OpenMP_FF_vtk_read_Opt2
Browse files Browse the repository at this point in the history
Add !$ OMP critical around file opening for VTK
  • Loading branch information
andrew-platt authored Jul 19, 2024
2 parents 75f1e32 + 0e7774a commit 44ff26d
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions modules/nwtc-library/src/VTK.f90
Original file line number Diff line number Diff line change
Expand Up @@ -158,8 +158,10 @@ SUBROUTINE ReadVTK_SP_info( FileName, descr, dims, origin, gridSpacing, vecLabel
closeOnReturn = .FALSE.
END IF

!$OMP critical
CALL GetNewUnit( Un, ErrStat, ErrMsg )
CALL OpenFInpFile ( Un, TRIM(FileName), ErrStat, ErrMsg )
!$OMP end critical
if (ErrStat >= AbortErrLev) return

CALL ReadCom( Un, FileName, 'File header: Module Version (line 1)', ErrStat2, ErrMsg2, 0 )
Expand Down Expand Up @@ -358,8 +360,10 @@ SUBROUTINE WrVTK_SP_header( FileName, descr, Un, ErrStat, ErrMsg )
INTEGER(IntKi) , INTENT( OUT) :: ErrStat !< error level/status of OpenFOutFile operation
CHARACTER(*) , INTENT( OUT) :: ErrMsg !< message when error occurs

!$OMP critical
CALL GetNewUnit( Un, ErrStat, ErrMsg )
CALL OpenFOutFile ( Un, TRIM(FileName), ErrStat, ErrMsg )
!$OMP end critical
if (ErrStat >= AbortErrLev) return

WRITE(Un,'(A)') '# vtk DataFile Version 3.0'
Expand Down

0 comments on commit 44ff26d

Please sign in to comment.