Intel® Moderncode for Parallel Architectures
Support for developing parallel programming applications on Intel® Architecture.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

Are Pure Subroutine Locals Safe

mattsdad
Beginner
710 Views

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
Honored Contributor III
710 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.
0 Kudos
allyn_shell
Beginner
710 Views
Does thread local mean that every subroutine must have all of its local data specified as a thread variable?
0 Kudos
mattsdad
Beginner
710 Views

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

Does that apply to every variable in every subroutine individually?

0 Kudos
Reply