Community
cancel
Showing results for 
Search instead for 
Did you mean: 
mattsdad
Beginner
35 Views

Are Pure Subroutine Locals Safe

I have a very large amount of code in a multi-body simulator that I have made parallel. All the subroutines in the parallel section are pure, and all the data passed into the top level of this section iscleanly divided by body. So each entry into the per bodypropagation is split off into a parallel task by an OMP Parallel Do statement.

My concern is will the local data in the pure subroutines ever "cross wires" due to parallel read-modify-write?

Do I need to use mutexes or critical sections in the pure subroutines?

0 Kudos
3 Replies
TimP
Black Belt
35 Views

It doesn't sound like you have a problem, if you have enabled these data to be thread local. You might want to try Intel Thread Checker.
allyn_shell
Beginner
35 Views

Does thread local mean that every subroutine must have all of its local data specified as a thread variable?
mattsdad
Beginner
35 Views

tim18:
if you have enabled these data to be thread local

Does that apply to every variable in every subroutine individually?

Reply