Use the SHARED clause on the PARALLEL, PARALLEL DO, and PARALLEL SECTIONS directives to make variables shared among all the threads in a team.
In the following example, the variables X and NPOINTS are shared among all the threads in the team:
Example |
---|
!$OMP PARALLEL DEFAULT(PRIVATE),SHARED(X,NPOINTS) |