Hi<div><br></div><div>I checked this out (you could have too). </div><div><br></div><div>It is the latter situation that you mentioned. By using private, the value of C will remain intact. So after for-loop, value of C is the same as its value before the loop. </div><div><br></div><div><br></div><div>Bests,</div><div>Millad<span></span><br><br>On Monday, September 29, 2014, Simone Atzeni <<a href="mailto:simone.at@gmail.com">simone.at@gmail.com</a>> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">Hi all,<br>
<br>
I have a OpenMP code like the following:<br>
<br>
--------------------------------------------------------------------------------<br>
“c" is global<br>
<br>
#pragma omp parallel for default(shared) private(c,eps)<br>
  for (i=0; i<N; i++) {<br>
    for (j=0; j<N; j++) {<br>
      cr = -2.0+2.5*(double)(i)/(double)(N)+eps;<br>
      c.i = 1.125*(double)(j)/(double)(NPOINTS)+eps;<br>
      test();<br>
    }<br>
  }<br>
<br>
and “test" is a function that read the values in “c”.<br>
<br>
--------------------------------------------------------------------------------<br>
<br>
The “c” inside the for loop and inside the function are the same?<br>
Or that one in the for loop is local (because of the private clause) and that one within the function is global?<br>
<br>
Thanks.<br>
Best,<br>
Simone<br>
_______________________________________________<br>
Openmp-dev mailing list<br>
<a href="javascript:;" onclick="_e(event, 'cvml', 'Openmp-dev@dcs-maillist2.engr.illinois.edu')">Openmp-dev@dcs-maillist2.engr.illinois.edu</a><br>
<a href="http://lists.cs.uiuc.edu/mailman/listinfo/openmp-dev" target="_blank">http://lists.cs.uiuc.edu/mailman/listinfo/openmp-dev</a><br>
</blockquote></div><br><br>-- <br>Sent from my iPhone<br>