Skip to content

Commit

Permalink
fix: Avoid thread conflicts
Browse files Browse the repository at this point in the history
Makes root finder initialization status `threadprivate` to avoid thread conflicts.
  • Loading branch information
abensonca committed Jul 27, 2024
1 parent 6020c20 commit b240c4c
Showing 1 changed file with 4 additions and 4 deletions.
8 changes: 4 additions & 4 deletions source/merger_trees.construct.read.F90
Original file line number Diff line number Diff line change
Expand Up @@ -2056,7 +2056,7 @@ subroutine readAssignScaleRadii(self,nodes,nodeList)
& useFallbackScaleMethod
type (rootFinder ) , save :: finder
logical , save :: finderConstructed =.false.
!$omp threadprivate(finder)
!$omp threadprivate(finder,finderConstructed)
type (varying_string ) :: message
character (len=16 ) :: label

Expand Down Expand Up @@ -2161,11 +2161,11 @@ subroutine readAssignScaleRadii(self,nodes,nodeList)
! The node mass is below the reliability threshold, or no scale information is available. Set the scale radius using
! the fallback method.
node_ => nodeList(iIsolatedNode)%node
radiusScale=max( &
& min( &
radiusScale=max( &
& min( &
& self%darkMatterProfileScaleRadius_%radius (node_) , &
& self%darkMatterHaloScale_ %radiusVirial(node_)/self%presetScaleRadiiConcentrationMinimum &
& ) , &
& ) , &
& self%darkMatterHaloScale_ %radiusVirial(node_)/self%presetScaleRadiiConcentrationMaximum &
& )
call darkMatterProfile%scaleSet(radiusScale)
Expand Down

0 comments on commit b240c4c

Please sign in to comment.