<?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 Question about compiled program by ifort in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Question-about-compiled-program-by-ifort/m-p/822586#M1275</link>
    <description>Is there anybody that can help me about this question?</description>
    <pubDate>Sat, 18 Sep 2010 07:35:32 GMT</pubDate>
    <dc:creator>xqg1084</dc:creator>
    <dc:date>2010-09-18T07:35:32Z</dc:date>
    <item>
      <title>Question about compiled program by ifort</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Question-about-compiled-program-by-ifort/m-p/822585#M1274</link>
      <description>Recenly I have an old source codes programmedby &lt;STRONG&gt;Fortran77&lt;/STRONG&gt;.&lt;BR /&gt;I tried to compiled them under an &lt;STRONG&gt;64-bits&lt;/STRONG&gt; machine with &lt;STRONG&gt;unix&lt;/STRONG&gt; operating system. and I tried to compile them by different compilers (one is&lt;STRONG&gt; intel fortran&lt;/STRONG&gt; , the other is &lt;STRONG&gt;gcc4.1.2&lt;/STRONG&gt;)&lt;BR /&gt;I used command like : &lt;STRONG&gt;'gfortran -O3 -m32 -double *.f'&lt;/STRONG&gt; ,when I used gcc 4.1.2 compiler&lt;BR /&gt;I used command like:&lt;STRONG&gt;'ifort -O3 -parallel -real_size 64 -mp -ipo -axT -fast *.f'&lt;/STRONG&gt;, when I used intel fortran compiler.&lt;BR /&gt;&lt;BR /&gt;Then of course, the intel fortran compiled program use &lt;STRONG&gt;2min20&lt;/STRONG&gt; sec to finish calculation ( 1 input), while gcc compiled program need &lt;STRONG&gt;4min 13&lt;/STRONG&gt; &lt;STRONG&gt;sec &lt;/STRONG&gt;to finish calculation (1 input). &lt;BR /&gt;&lt;BR /&gt;But sine the &lt;STRONG&gt;CPU&lt;/STRONG&gt; that I used is an &lt;STRONG&gt;8 core CPU&lt;/STRONG&gt;. So I used '&lt;STRONG&gt;OPENMP'&lt;/STRONG&gt; to let these compiled program run for &lt;STRONG&gt;8 inputs&lt;/STRONG&gt; &lt;STRONG&gt;at the same time&lt;/STRONG&gt;. So I made a simple program just to use &lt;STRONG&gt;OPENMP &lt;/STRONG&gt;to give an&lt;STRONG&gt; 8 threads&lt;/STRONG&gt; calculation. But I found that:&lt;BR /&gt;When I wanted to use OPENMP to run the program with &lt;STRONG&gt;8 inputs&lt;/STRONG&gt; at the same time. the &lt;STRONG&gt;ifort &lt;/STRONG&gt;compiled program would need &lt;STRONG&gt;7min51sec&lt;/STRONG&gt;, while gfortran compiled program need &lt;STRONG&gt;5min6 sec&lt;/STRONG&gt;.&lt;BR /&gt;&lt;BR /&gt;So these results suprised me very much, who can help me to find the possible reason and what should I do? Maybe the compilling options that I chose were not right!&lt;BR /&gt;&lt;BR /&gt;belows are the OPENMP codes:&lt;BR /&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;use omp_lib&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;implicit none&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;character(len=99) cmdtxt,str&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;character*1 xqgid&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;integer mpid&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;EM&gt;&lt;STRONG&gt;call omp_set_num_threads(8)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;&lt;/STRONG&gt;&lt;/EM&gt;&lt;EM&gt;&lt;STRONG&gt;*$OMP PARALLEL DEFAULT(PRIVATE) &lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;mpid=omp_get_thread_num()&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;write(xqgid,'(i1)') mpid &lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;cmdtxt='Program'//xqgid&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;CALL SYSTEM(cmdtxt)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;*$OMP END PARALLEL &lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;cmdtxt='cat result-?.txt&amp;gt;&amp;gt; results.txt'&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;&lt;P&gt;&lt;EM&gt;&lt;STRONG&gt;CALL SYSTEM(cmdtxt)&lt;/STRONG&gt;&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 15 Sep 2010 11:28:19 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Question-about-compiled-program-by-ifort/m-p/822585#M1274</guid>
      <dc:creator>xqg1084</dc:creator>
      <dc:date>2010-09-15T11:28:19Z</dc:date>
    </item>
    <item>
      <title>Question about compiled program by ifort</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Question-about-compiled-program-by-ifort/m-p/822586#M1275</link>
      <description>Is there anybody that can help me about this question?</description>
      <pubDate>Sat, 18 Sep 2010 07:35:32 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Question-about-compiled-program-by-ifort/m-p/822586#M1275</guid>
      <dc:creator>xqg1084</dc:creator>
      <dc:date>2010-09-18T07:35:32Z</dc:date>
    </item>
    <item>
      <title>Question about compiled program by ifort</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Question-about-compiled-program-by-ifort/m-p/822587#M1276</link>
      <description>Generally you should not use a parallel region to spawn programs. Rather you take the execuitable statements within the program you spawn and place them into a subroutine within the application then call the subroutine from within your parallel region.&lt;BR /&gt;&lt;BR /&gt;If you need to spawn multiple programs, I suggest you do thisfrom a command shell.&lt;BR /&gt;&lt;BR /&gt;!$omp parallel sections&lt;BR /&gt;call Program1Subroutine()&lt;BR /&gt;!$omp section&lt;BR /&gt;call Program2Subroutine()&lt;BR /&gt;!$omp section&lt;BR /&gt;...&lt;BR /&gt;!$omp section&lt;BR /&gt;call ProgramNSubroutine()&lt;BR /&gt;!$omp end parallel sections&lt;BR /&gt;&lt;BR /&gt;Jim Dempsey</description>
      <pubDate>Sun, 19 Sep 2010 00:43:14 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/Question-about-compiled-program-by-ifort/m-p/822587#M1276</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2010-09-19T00:43:14Z</dc:date>
    </item>
  </channel>
</rss>

