<?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 It looks like your program is in Intel® Moderncode for Parallel Architectures</title>
    <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/initialize-common-block-defined-in-a-module-in-OMP/m-p/919599#M4888</link>
    <description>&lt;P&gt;It looks like your program is non-conforming. Let's refer to specifications.&lt;/P&gt;
&lt;P&gt;OpenMP:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A common block name that appears in a copyin clause must be declared to be a&amp;nbsp;Fortran&amp;nbsp;common block in the same scoping unit in which the copyin clause appears.&lt;/P&gt;
&lt;P&gt;Fortran:&lt;/P&gt;
&lt;P&gt;Use association is the association of names in different scoping units specified by a USE statement.&lt;/P&gt;
&lt;P&gt;Thus you are trying to specify in the copyin clause the common block declared in different scoping unit, that is not allowed. &amp;nbsp;Though it is possible to list the variables from common block of different unit&amp;nbsp;(not the common block itself) in the copyin clause.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Andrey&lt;/P&gt;</description>
    <pubDate>Fri, 14 Jun 2013 09:13:35 GMT</pubDate>
    <dc:creator>Andrey_C_Intel1</dc:creator>
    <dc:date>2013-06-14T09:13:35Z</dc:date>
    <item>
      <title>initialize common block defined in a module in OMP</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/initialize-common-block-defined-in-a-module-in-OMP/m-p/919594#M4883</link>
      <description>&lt;P&gt;Define a common block in an include file, for example&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Test.ins&lt;/P&gt;
&lt;P&gt;Common /test/ a b&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Then wrap up the include file in a module file, for example&lt;/P&gt;
&lt;P&gt;&amp;nbsp;Module test&lt;/P&gt;
&lt;P&gt;Include ‘test.ins’&lt;/P&gt;
&lt;P&gt;End module&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Basically I just define the common block in the module. I do not have issue to use the common block in the regular Fortran codes. However in OMP I define the common block as threadprivate and when I initialize the block for child threads with COPYIN directive, I got the error below.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;error #7460: A common block name is required&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Please let me know if I am not clear about the issue.&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2013 14:53:37 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/initialize-common-block-defined-in-a-module-in-OMP/m-p/919594#M4883</guid>
      <dc:creator>stydofe1</dc:creator>
      <dc:date>2013-06-12T14:53:37Z</dc:date>
    </item>
    <item>
      <title>The error message "A common</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/initialize-common-block-defined-in-a-module-in-OMP/m-p/919595#M4884</link>
      <description>&lt;P&gt;The error message "A common block name is required" is self explanitory.&lt;/P&gt;
&lt;P&gt;[fortran]&lt;/P&gt;
&lt;P&gt;type&amp;nbsp;&amp;nbsp;&amp;nbsp; TypeThreadContext&lt;BR /&gt;SEQUENCE&lt;BR /&gt;... declarations here&lt;BR /&gt;end type TypeThreadContext&lt;/P&gt;
&lt;P&gt;type(TypeThreadContext) :: ThreadContext&lt;BR /&gt;COMMON /CONTEXT/ ThreadContext&lt;BR /&gt;!$OMP THREADPRIVATE(/CONTEXT/)&lt;/P&gt;
&lt;P&gt;COMMON /FOO/ A,B,C&lt;BR /&gt;!$OMP THREADPRIVATE(/FOO/)&lt;BR /&gt;[/fortran]&lt;/P&gt;
&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2013 15:30:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/initialize-common-block-defined-in-a-module-in-OMP/m-p/919595#M4884</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2013-06-12T15:30:35Z</dc:date>
    </item>
    <item>
      <title>Normally you do not place</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/initialize-common-block-defined-in-a-module-in-OMP/m-p/919596#M4885</link>
      <description>&lt;P&gt;Normally you do not place COMMON data in modules because the name of the COMMON block you use will get pre-pended with a module prefex name&lt;/P&gt;
&lt;P&gt;In your case the actual name might be TEST_MP_TEST&lt;/P&gt;
&lt;P&gt;You will have to check, and the compiler may change the prepend now or later. It may work to scope the declaration&lt;/P&gt;
&lt;P&gt;!$OMP THREADPRIVATE(test::/test/)&lt;/P&gt;
&lt;P&gt;I haven't tried the above, don't complain if it doesn't work.&lt;/P&gt;
&lt;P&gt;I suggest using the user defined type and remove COMMON though this may be problematic for your case.&lt;/P&gt;
&lt;P&gt;Usually where you had COMMON /FOO/ A,B,C,...&lt;BR /&gt;you would make a user defined type (e.g. FOO_t) and declare an instance of FOO_t as FOO. Then you can !$OMP THREADPRIVATE(FOO). And reference variables as FOO%A, ...&lt;/P&gt;
&lt;P&gt;In the event you have no variable naming conflics amongst your various COMMONs, then these not need to be in a typed variable. And you can forgoe the FOO%...&lt;/P&gt;
&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2013 15:41:42 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/initialize-common-block-defined-in-a-module-in-OMP/m-p/919596#M4885</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2013-06-12T15:41:42Z</dc:date>
    </item>
    <item>
      <title>The block has been defined as</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/initialize-common-block-defined-in-a-module-in-OMP/m-p/919597#M4886</link>
      <description>&lt;P&gt;The block has been defined as threadprivate in the include file,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Test.ins&lt;/P&gt;
&lt;P&gt;Common /test/ a b&lt;/P&gt;
&lt;P&gt;!$OMP threadprivate(test)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If the common block is refereed with the include file, the file with COPYIN statement is compiled successfully. But if it is refereed with the module file, which is simply a wrapper of the include file, OMP fails to compile with the error ‘A common block name is required’&lt;/P&gt;
&lt;P&gt;I can not see the difference between these two methods. Is it a bug in compiler?&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2013 15:46:20 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/initialize-common-block-defined-in-a-module-in-OMP/m-p/919597#M4886</guid>
      <dc:creator>stydofe1</dc:creator>
      <dc:date>2013-06-12T15:46:20Z</dc:date>
    </item>
    <item>
      <title>But your "include 'test.ins'"</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/initialize-common-block-defined-in-a-module-in-OMP/m-p/919598#M4887</link>
      <description>&lt;P&gt;But your "include 'test.ins'" is enclosed in "module test" / "end module test", thus making the enclosed "COMMON /test/" within the scope of the module test. As stated in earlier post, all members of the module, in this case "test" have a prefix pre-pended to the name. In the case of "module test" the module name is test, and the prepend text is "TEST_MP_", thus producing a COMMON block name of /TEST_MP_TEST/ (implicit name) for given name /TEST/ within the scope of module test (TEST_MP_....).&lt;/P&gt;
&lt;P&gt;Had you used "module foo" in your example then the name would be FOO_MP_TEST.&lt;/P&gt;
&lt;P&gt;*** Note, the actual prefix may be of a different form (_FOO_MP_) or some other thing.&lt;/P&gt;
&lt;P&gt;module foo&lt;BR /&gt;REAL :: A&lt;BR /&gt;COMMON /TEST/ B&lt;BR /&gt;end module foo&lt;/P&gt;
&lt;P&gt;produces&lt;/P&gt;
&lt;P&gt;REAL FOO_MP_A&lt;BR /&gt;COMMON /FOO_MP_TEST/ B&lt;/P&gt;
&lt;P&gt;Jim Dempsey&lt;/P&gt;</description>
      <pubDate>Wed, 12 Jun 2013 21:17:07 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/initialize-common-block-defined-in-a-module-in-OMP/m-p/919598#M4887</guid>
      <dc:creator>jimdempseyatthecove</dc:creator>
      <dc:date>2013-06-12T21:17:07Z</dc:date>
    </item>
    <item>
      <title>It looks like your program is</title>
      <link>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/initialize-common-block-defined-in-a-module-in-OMP/m-p/919599#M4888</link>
      <description>&lt;P&gt;It looks like your program is non-conforming. Let's refer to specifications.&lt;/P&gt;
&lt;P&gt;OpenMP:&amp;nbsp;&lt;/P&gt;
&lt;P&gt;A common block name that appears in a copyin clause must be declared to be a&amp;nbsp;Fortran&amp;nbsp;common block in the same scoping unit in which the copyin clause appears.&lt;/P&gt;
&lt;P&gt;Fortran:&lt;/P&gt;
&lt;P&gt;Use association is the association of names in different scoping units specified by a USE statement.&lt;/P&gt;
&lt;P&gt;Thus you are trying to specify in the copyin clause the common block declared in different scoping unit, that is not allowed. &amp;nbsp;Though it is possible to list the variables from common block of different unit&amp;nbsp;(not the common block itself) in the copyin clause.&lt;/P&gt;
&lt;P&gt;Regards,&lt;BR /&gt;Andrey&lt;/P&gt;</description>
      <pubDate>Fri, 14 Jun 2013 09:13:35 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Moderncode-for-Parallel/initialize-common-block-defined-in-a-module-in-OMP/m-p/919599#M4888</guid>
      <dc:creator>Andrey_C_Intel1</dc:creator>
      <dc:date>2013-06-14T09:13:35Z</dc:date>
    </item>
  </channel>
</rss>

