<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: Problem with Thread Checker &amp; OpenMP in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Problem-with-Thread-Checker-OpenMP/m-p/950441#M5157</link>
    <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Hi Peter,&lt;/DIV&gt;
&lt;DIV&gt;The /Qtcheck option is required to analyze OpenMP code. Did you use this option? If not, please try again with this option and let us know what happens.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;I don't see any errors in your example program. A couple of comments about your OpenMP:&lt;/DIV&gt;
&lt;OL&gt;
&lt;LI&gt;You can declare multiple variables in the same reduction clause.&lt;/LI&gt;
&lt;LI&gt;It appears that you modified your code to replace HF(3) with three scalars. OpenMP 2.0 supports array reductions so you could have declared HF in the reduction clause, provided it's not a deferred shape or assumed size array.&lt;/LI&gt;&lt;/OL&gt;
&lt;DIV&gt;Best regards,&lt;/DIV&gt;
&lt;DIV&gt;Henry&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;PS This forum is fine for questions about the Intel Threading Tools. If we can't answerthe question, we'll provide apointerto Intel Premier Support.&lt;/DIV&gt;&lt;/DIV&gt;</description>
    <pubDate>Tue, 06 Jul 2004 20:58:46 GMT</pubDate>
    <dc:creator>Henry_G_Intel</dc:creator>
    <dc:date>2004-07-06T20:58:46Z</dc:date>
    <item>
      <title>Problem with Thread Checker &amp; OpenMP</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Problem-with-Thread-Checker-OpenMP/m-p/950440#M5156</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Hi, I hope this is the correct forum for this question. I am an experienced Fortran programmer but a newbie wrt threads and OpenMP. I'm attempting to parallelize the following loop using OpenMP and the Intel v. 8 Fortran compiler for windows (within the Microsoft dotnet 2003 IDE):&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR /&gt; HF = 0.&lt;BR /&gt; HF1 = 0.; HF2 = 0.; HF3 = 0. !pss 7/5/2004 for OMP&lt;BR /&gt;!$OMP PARALLEL DO PRIVATE(J_INT1,RK,RK2,RKL,RK3R,CFAC,CJ1) &amp;amp;&lt;BR /&gt;!$OMP &amp;amp; REDUCTION(+:HF1) REDUCTION(+:HF2) REDUCTION(+:HF3)&lt;BR /&gt; First_refl_loop : &amp;amp;&lt;BR /&gt; DO J_INT1 = 1, N_INT1&lt;/DIV&gt;
&lt;DIV&gt; ! Vector RK from first to second reflector times wavenumber&lt;BR /&gt; RK(1) = (PUF(1) - P_R1%X(J_INT1))*AK&lt;BR /&gt; RK(2) = (PUF(2) - P_R1%Y(J_INT1))*AK&lt;BR /&gt; RK(3) = (PUF(3) - P_R1%ACTZ(J_INT1))*AK&lt;/DIV&gt;
&lt;DIV&gt; ! RK2 : RK**2&lt;BR /&gt; RK2 = RK(1)**2 + RK(2)**2 + RK(3)**2&lt;/DIV&gt;
&lt;DIV&gt; ! RKL : Length of RK&lt;BR /&gt; RKL = SQRT(RK2)&lt;/DIV&gt;
&lt;DIV&gt; ! RK3R : 1/RKL**3&lt;BR /&gt; RK3R = 1./(RKL*RK2)&lt;/DIV&gt;
&lt;DIV&gt; ! CFAC : Complex factor&lt;BR /&gt; CFAC = FAC*RK3R*(1.+AJ*RKL)*(COS(RKL)-AJ*SIN(RKL))&lt;/DIV&gt;
&lt;DIV&gt; ! CJ1 : Current element on first reflector&lt;BR /&gt; CJ1 = P_C1%CUR(:,J_INT1+I_OFF1)&lt;/DIV&gt;
&lt;DIV&gt; ! HF : H-field incident on second reflector&lt;BR /&gt;!!$ HF(1) = (CJ1(2)*RK(3)-CJ1(3)*RK(2))*CFAC + HF(1)&lt;BR /&gt;!!$ HF(2) = (CJ1(3)*RK(1)-CJ1(1)*RK(3))*CFAC + HF(2)&lt;BR /&gt;!!$ HF(3) = (CJ1(1)*RK(2)-CJ1(2)*RK(1))*CFAC + HF(3)&lt;BR /&gt; HF1 = (CJ1(2)*RK(3)-CJ1(3)*RK(2))*CFAC + HF1&lt;BR /&gt; HF2 = (CJ1(3)*RK(1)-CJ1(1)*RK(3))*CFAC + HF2&lt;BR /&gt; HF3 = (CJ1(1)*RK(2)-CJ1(2)*RK(1))*CFAC + HF3&lt;BR /&gt; END DO First_refl_loop&lt;BR /&gt;!$OMP END PARALLEL DO&lt;BR /&gt; HF(1) = HF1; HF(2) = HF2; HF(3) = HF3; ! pss 7/5/2004 for OMP&lt;BR /&gt;&lt;/DIV&gt;
&lt;DIV&gt;I compiled the debug versionwith /Qopenmp using the IDE settings (also including /FIXED:NO on the linker command line and set up a Thread Checker Activity. After running the acitivity, I obtain several diagnostics, including a severity "red" one that reads: "Using of a syncrhonization object at "optim3.f90" : 3417 conflicts with its closing at "a_map.c" : 53"&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Line 3417 is the line beginning with "HF1 = 0."&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;There is also a "yellow": warning that a thread at "optim4.f90" : 3417 has been waiting more than 3 seconds trying to acquire a resource.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;I don't understand the first of these messages. "a_map.c" appears to be some sort of system routine involving threads that is only available in machine code. I don't know how to proceed to solve this problem, if there even is a problem. I also don't understand the reason for the second (yellow) warning. There shouldn't be any resource conflict, if I've coded the OpenMP directives correctly.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;A printout of the diagnostic messages from Thread Checker and the Fortran source code file are available on my web site at &lt;A href="http://www.vcnet.com/~simonp/pos4" target="_blank"&gt;www.vcnet.com/~simonp/pos4&lt;/A&gt;, along with the project configuration files from the IDE.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Any assistance would be greatly appreciated.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Thanks,&lt;/DIV&gt;
&lt;DIV&gt;Peter SImon&lt;/DIV&gt;</description>
      <pubDate>Mon, 05 Jul 2004 22:02:30 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Problem-with-Thread-Checker-OpenMP/m-p/950440#M5156</guid>
      <dc:creator>Peter_Simon</dc:creator>
      <dc:date>2004-07-05T22:02:30Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Thread Checker &amp; OpenMP</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Problem-with-Thread-Checker-OpenMP/m-p/950441#M5157</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Hi Peter,&lt;/DIV&gt;
&lt;DIV&gt;The /Qtcheck option is required to analyze OpenMP code. Did you use this option? If not, please try again with this option and let us know what happens.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;I don't see any errors in your example program. A couple of comments about your OpenMP:&lt;/DIV&gt;
&lt;OL&gt;
&lt;LI&gt;You can declare multiple variables in the same reduction clause.&lt;/LI&gt;
&lt;LI&gt;It appears that you modified your code to replace HF(3) with three scalars. OpenMP 2.0 supports array reductions so you could have declared HF in the reduction clause, provided it's not a deferred shape or assumed size array.&lt;/LI&gt;&lt;/OL&gt;
&lt;DIV&gt;Best regards,&lt;/DIV&gt;
&lt;DIV&gt;Henry&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;
&lt;DIV&gt;PS This forum is fine for questions about the Intel Threading Tools. If we can't answerthe question, we'll provide apointerto Intel Premier Support.&lt;/DIV&gt;&lt;/DIV&gt;</description>
      <pubDate>Tue, 06 Jul 2004 20:58:46 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Problem-with-Thread-Checker-OpenMP/m-p/950441#M5157</guid>
      <dc:creator>Henry_G_Intel</dc:creator>
      <dc:date>2004-07-06T20:58:46Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Thread Checker &amp; OpenMP</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Problem-with-Thread-Checker-OpenMP/m-p/950442#M5158</link>
      <description>&lt;P&gt;Message Edited by tim18 on &lt;SPAN class="date_text"&gt;08-25-2004&lt;/SPAN&gt; &lt;SPAN class="time_text"&gt;03:59 PM&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 06 Jul 2004 21:44:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Problem-with-Thread-Checker-OpenMP/m-p/950442#M5158</guid>
      <dc:creator>TimP</dc:creator>
      <dc:date>2004-07-06T21:44:07Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Thread Checker &amp; OpenMP</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Problem-with-Thread-Checker-OpenMP/m-p/950443#M5159</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Hi, Henry.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Thanks for responding. I had used the /Qtcheck option on the compiler command line but not on the linker command line. When I added it to the linker command line, it made no difference.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Re your comments:&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;1. Thanks, I will use the abbreviated form in the future.&lt;/DIV&gt;
&lt;DIV&gt;2. I need to maintain compatibility with OpenMP 1.0 because the code will also be used on some Alpha platforms at work with an old Fortran compiler that only supports the old standard.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Still looking for a solution :-(.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;--Peter&lt;/DIV&gt;</description>
      <pubDate>Wed, 07 Jul 2004 10:23:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Problem-with-Thread-Checker-OpenMP/m-p/950443#M5159</guid>
      <dc:creator>Peter_Simon</dc:creator>
      <dc:date>2004-07-07T10:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Thread Checker &amp; OpenMP</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Problem-with-Thread-Checker-OpenMP/m-p/950444#M5160</link>
      <description>&lt;DIV&gt;Hi, tcprince, thanks for responding.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Yes, I'm using the 32 bit Windows 8.0 compiler. Re your comments:&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;1) I initialized the sum reduction variables on separate lines. I also expanded the line following the !$OMP END PARALLEL DO to be three separate lines.&lt;/DIV&gt;
&lt;DIV&gt;This did not make a difference.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;2) When you say I don't "have COMPLEX" I don't know exactly what you mean. For instance, the reduction variables are declared COMPLEX(TYPE=LONG). Could this be part of the problem? Please note that in my original post I provided a URL where the entire source file (including declarations) can be retrieved. The machine on which I'm compiling and running the code has a pair of Pentium 4 Xeon processors (without hyperthreading). I'm using OpenMP on this short, simple,interior loop as a first try at something simple where I hoped to get immediate success (ha-ha). My intention, after sucessfully parallelizing this loop, was to then try to parallelize insteadthe outer, enclosing loop, where hopefully some performance gain can be achieved, though I assume it will be more difficult to parallelize correctly.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;3) Good point. I changed the code IAW with your suggestion. Note that this isn't my code. I'm just trying to get it to run faster on SMP workstations.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Still looking for a solution :-(, but thanks for the input!&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;--Peter&lt;/DIV&gt;</description>
      <pubDate>Wed, 07 Jul 2004 10:47:28 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Problem-with-Thread-Checker-OpenMP/m-p/950444#M5160</guid>
      <dc:creator>Peter_Simon</dc:creator>
      <dc:date>2004-07-07T10:47:28Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Thread Checker &amp; OpenMP</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Problem-with-Thread-Checker-OpenMP/m-p/950445#M5161</link>
      <description>&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;I just noticed something; perhaps it will help in identifying the problem. After I changed the code as suggested by tcprince to&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt; HF1 = 0. !pss 7/6/2004 for OMP&lt;BR /&gt; HF2 = 0. !pss 7/6/2004 for OMP&lt;BR /&gt; HF3 = 0. !pss 7/6/2004 for OMP&lt;BR /&gt;!$OMP PARALLEL DO PRIVATE(J_INT1,RK,RK2,RKL,CFAC,CJ1) &amp;amp;&lt;BR /&gt;!$OMP &amp;amp; REDUCTION(+:HF1, HF2, HF3) &lt;BR /&gt; First_refl_loop : &amp;amp;&lt;/DIV&gt;
&lt;DIV&gt; ...&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;&lt;BR /&gt;and ran the thread checker activity, the "red" diagnostic that I quoted in my original post ("Using of a syncrhonization object at ...") is again produced and it still refers to the exact same source line as it did before I made the edit! That is, it refers to the first source line above (the one that starts with "HF1 = ...". This is several lines prior to the parallel section of code! Does this provide a useful clue???&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Thanks,&lt;/DIV&gt;
&lt;DIV&gt;Peter&lt;/DIV&gt;</description>
      <pubDate>Wed, 07 Jul 2004 10:55:54 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Problem-with-Thread-Checker-OpenMP/m-p/950445#M5161</guid>
      <dc:creator>Peter_Simon</dc:creator>
      <dc:date>2004-07-07T10:55:54Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Thread Checker &amp; OpenMP</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Problem-with-Thread-Checker-OpenMP/m-p/950446#M5162</link>
      <description>&lt;DIV&gt;Peter -&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;It seems that your problem has escalated to the point that it would be better served if you report this to the Intel Premier support site. If none of the "obvious" things that have been pointed out by previuos posts, I think you should seek out the professionals that deal with these kinds of thngs on a regular basis. They may have seen a similar situation in the past and be able to tell you what is going on, or they will have more sophisticated tools and contact with developers to iunvestigate your questions and concerns.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Did you sign up for a Premier account when you registered the Intel Thread Checker?&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;--clay&lt;/DIV&gt;</description>
      <pubDate>Wed, 07 Jul 2004 20:56:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Problem-with-Thread-Checker-OpenMP/m-p/950446#M5162</guid>
      <dc:creator>ClayB</dc:creator>
      <dc:date>2004-07-07T20:56:32Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with Thread Checker &amp; OpenMP</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Problem-with-Thread-Checker-OpenMP/m-p/950447#M5163</link>
      <description>&lt;DIV&gt;OK, Clay, I've submitted a problem report to the Premier website. I thought I should try here first because I assumed I was doing something wrong that would be easy to spot.&lt;/DIV&gt;
&lt;DIV&gt;&lt;/DIV&gt;
&lt;DIV&gt;Thanks,&lt;/DIV&gt;
&lt;DIV&gt;Peter&lt;/DIV&gt;</description>
      <pubDate>Wed, 07 Jul 2004 21:38:36 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Problem-with-Thread-Checker-OpenMP/m-p/950447#M5163</guid>
      <dc:creator>Peter_Simon</dc:creator>
      <dc:date>2004-07-07T21:38:36Z</dc:date>
    </item>
  </channel>
</rss>

