<?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 Problem with OpenMP loop and polymorphic object in Intel® Fortran Compiler</title>
    <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-OpenMP-loop-and-polymorphic-object/m-p/970481#M97003</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have a problem in my program when i compile it with&amp;nbsp;&lt;EM&gt;/Qopenmp&lt;/EM&gt;. At a random point, the following run-time error apeared:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;"forrtl: severe (173): a pointer passed to DEALLOCATE points to an object that cannot be deallocated"&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;Here there is a simplified version of my code:&lt;/P&gt;
&lt;P&gt;[fortran]&lt;/P&gt;
&lt;P&gt;module ModuleVector&lt;BR /&gt; implicit none&lt;BR /&gt; integer, parameter :: wp = kind(1.0d0)&lt;BR /&gt; !====================================================================================&lt;BR /&gt; type,abstract :: TypeVectorBase&lt;BR /&gt; real(wp) :: x=0._wp&lt;BR /&gt; real(wp) :: y=0._wp&lt;BR /&gt; contains&lt;BR /&gt; procedure(interfaceVectorAssignment),deferred,private :: vectorAssignment&lt;BR /&gt; generic :: assignment(=) =&amp;gt;vectorAssignment&lt;BR /&gt; end type&lt;BR /&gt; !---------&lt;BR /&gt; type,extends(TypeVectorBase) :: TypeVector2d&lt;BR /&gt; contains&lt;BR /&gt; procedure,private :: vectorAssignment=&amp;gt;vectorAssignment2d&lt;BR /&gt; end type&lt;BR /&gt; !================================&lt;BR /&gt; abstract interface&lt;BR /&gt; subroutine interfaceVectorAssignment(vector1,vector2)&lt;BR /&gt; import :: TypeVectorBase&lt;BR /&gt; class(TypeVectorBase) ,intent(out) :: vector1&lt;BR /&gt; class(TypeVectorBase) ,intent(in) :: vector2&lt;BR /&gt; end subroutine interfaceVectorAssignment&lt;BR /&gt; end interface&lt;BR /&gt;!====================================================================================&lt;BR /&gt; ! declerations&lt;BR /&gt; class(TypeVectorBase),allocatable :: baseVector&lt;BR /&gt; class(TypeVectorBase),allocatable :: testVector(:,:)&lt;BR /&gt; !====================================================================================&lt;BR /&gt; contains&lt;BR /&gt; subroutine vectorAssignment2d(vector1,vector2)&lt;BR /&gt; ! 11/18/2012&lt;BR /&gt; class(TypeVector2d) ,intent(out) :: vector1&lt;BR /&gt; class(TypeVectorBase) ,intent(in) :: vector2&lt;BR /&gt; ! body&lt;BR /&gt; vector1%x=vector2%x&lt;BR /&gt; vector1%y=vector2%y&lt;BR /&gt; end subroutine vectorAssignment2d&lt;BR /&gt; end module&lt;BR /&gt; !************************************************************************************&lt;BR /&gt; module ModuleEquationOfState&lt;BR /&gt; ! Created: 02/23/2013&lt;BR /&gt; use ModuleVector&lt;BR /&gt; implicit none&lt;BR /&gt; !====================================================================================&lt;BR /&gt; type,abstract :: TypeEquationOfStateBase&lt;BR /&gt; class(TypeVectorBase),allocatable :: rhoU&lt;BR /&gt; end type TypeEquationOfStateBase&lt;BR /&gt; !---------------------------------------&lt;BR /&gt; type,extends(TypeEquationOfStateBase) :: TypeCaloricallyPrefectGas&lt;BR /&gt; end type TypeCaloricallyPrefectGas&lt;BR /&gt; !====================================================================================&lt;BR /&gt; ! deceleartions&lt;BR /&gt; class(TypeEquationOfStateBase),allocatable :: equationOfState&lt;BR /&gt; !$OMP THREADPRIVATE(equationOfState)&lt;BR /&gt; !====================================================================================&lt;BR /&gt; end module ModuleEquationOfState&lt;BR /&gt; !************************************************************************************&lt;BR /&gt; subroutine initiateCaloricallyPrefectGas(equation)&lt;BR /&gt; use ModuleEquationOfState&lt;BR /&gt; use ModuleVector&lt;BR /&gt; implicit none&lt;BR /&gt; ! Created : 05/24/2013&lt;BR /&gt; !Arguments&lt;BR /&gt; class(TypeEquationOfStateBase),intent(inout) :: equation&lt;BR /&gt; ! local variables&lt;BR /&gt; ! body&lt;BR /&gt; allocate(equation%rhoU,source=baseVector)&lt;BR /&gt; end subroutine initiateCaloricallyPrefectGas&lt;BR /&gt; !***************************************&lt;BR /&gt; subroutine evaluateTimeStepSimple(blockNumber,ElementNumber)&lt;BR /&gt; ! 05/27/2013&lt;BR /&gt; use ModuleVector&lt;BR /&gt; use ModuleEquationOfState&lt;BR /&gt; implicit none&lt;BR /&gt; !Arguments&lt;BR /&gt; integer,intent(in) :: blockNumber,ElementNumber&lt;BR /&gt; !Local variables&lt;BR /&gt; ! Body&lt;BR /&gt; equationOfState%rhoU=testVector(blockNumber,ElementNumber)&lt;BR /&gt; end subroutine evaluateTimeStepSimple&lt;BR /&gt; !***************************************&lt;BR /&gt; subroutine runLowStorageRungeKutta()&lt;BR /&gt; !$ use omp_lib, only: OMP_GET_NUM_PROCS,omp_set_num_threads&lt;BR /&gt; !$ use ModuleVector&lt;BR /&gt; !$ use ModuleEquationOfState&lt;BR /&gt; implicit none&lt;BR /&gt; ! local variables&lt;BR /&gt; integer :: m,i,j&lt;BR /&gt; !$ real(8) :: power&lt;BR /&gt; !$ integer :: numberOfThreads,numberOfProcessors&lt;BR /&gt; !$ power=0.75 !Conditional compilation&lt;BR /&gt; !$ numberOfProcessors= OMP_GET_NUM_PROCS() !Conditional compilation&lt;BR /&gt; !$ numberOfThreads= numberOfProcessors*power !Conditional compilation&lt;BR /&gt; !$ call omp_set_num_threads(numberOfThreads) !Conditional compilation&lt;BR /&gt; !$ call omp_set_nested(.true.)&lt;BR /&gt; !!$ call omp_set_dynamic(.true.)&lt;BR /&gt; do m=1,5&lt;BR /&gt; !-----&lt;BR /&gt; !$OMP PARALLEL DO SCHEDULE(DYNAMIC,1) DEFAULT(SHARED) COPYIN(equationOfState)&lt;BR /&gt; do i=1,10&lt;BR /&gt; !-----&lt;BR /&gt; !$OMP PARALLEL DO SCHEDULE(GUIDED) SHARED(i) DEFAULT(SHARED) COPYIN(equationOfState)&lt;BR /&gt; do j=1,15&lt;BR /&gt; !write(*,*), "Hello world." ! When this statement uncommented, issue doesn't occur.&lt;BR /&gt; call evaluateTimeStepSimple(i,j)&lt;BR /&gt; end do&lt;BR /&gt; !$OMP END PARALLEL DO&lt;BR /&gt; !-----&lt;BR /&gt; end do&lt;BR /&gt; !$OMP END PARALLEL DO&lt;BR /&gt; !-----&lt;BR /&gt; end do&lt;BR /&gt; end subroutine runLowStorageRungeKutta&lt;BR /&gt; !***************************************&lt;BR /&gt; program testProgram&lt;BR /&gt; use ModuleVector&lt;BR /&gt; use ModuleEquationOfState&lt;BR /&gt; allocate(TypeVector2d::baseVector)&lt;BR /&gt; allocate(testVector(10,15),source=baseVector)&lt;BR /&gt; allocate(TypeCaloricallyPrefectGas:: equationOfState)&lt;BR /&gt; testVector.x=10._wp&lt;BR /&gt; testVector.y=20._wp&lt;BR /&gt; call initiateCaloricallyPrefectGas(equationOfState)&lt;BR /&gt; call runLowStorageRungeKutta()&lt;BR /&gt; end&lt;/P&gt;
&lt;P&gt;[/fortran]&lt;/P&gt;
&lt;P&gt;When i uncomment the write statement in&amp;nbsp;&lt;EM&gt;runLowStorageRungeKutta&lt;/EM&gt;&amp;nbsp;subroutine, the program work without problem.&lt;/P&gt;
&lt;P&gt;I use Intel Fortran&amp;nbsp;13.0.3615 and my project configuration is:&lt;/P&gt;
&lt;P&gt;[xml]&lt;/P&gt;
&lt;P&gt;&amp;lt;Configuration Name="Debug|x64"&amp;gt;&lt;BR /&gt; &amp;lt;Tool Name="VFFortranCompilerTool" AdditionalOptions="&amp;amp;#xA;" SuppressStartupBanner="true" DebugInformationFormat="debugEnabled" Optimization="optimizeDisabled" Preprocess="preprocessYes" AdditionalIncludeDirectories="&amp;amp;quot;C:\Program Files (x86)\Intel\Composer XE 2013\mkl\include&amp;amp;quot;;&amp;amp;quot;C:\Program Files (x86)\Intel\Composer XE 2013\compiler\include&amp;amp;quot;" OpenMP="OpenMPParallelCode" F2003Semantics="true" Diagnostics="diagnosticsShowAll" DebugParameter="debugParameterAll" WarnInterfaces="true" Traceback="true" BoundsCheck="true" RuntimeLibrary="rtMultiThreadedDebug" Interfaces="true"/&amp;gt;&lt;BR /&gt; &amp;lt;Tool Name="VFLinkerTool" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" AdditionalLibraryDirectories="&amp;amp;quot;C:\Program Files (x86)\Intel\Composer XE 2013\mkl\lib\intel64&amp;amp;quot;" GenerateDebugInformation="true" GenerateMapFile="true" SubSystem="subSystemConsole" AdditionalDependencies="mkl_lapack95_ilp64.lib mkl_intel_ilp64.lib mkl_intel_thread.lib mkl_core.lib libiomp5md.lib"/&amp;gt;&lt;BR /&gt; &amp;lt;Tool Name="VFResourceCompilerTool"/&amp;gt;&lt;BR /&gt; &amp;lt;Tool Name="VFMidlTool" SuppressStartupBanner="true" TargetEnvironment="midlTargetAMD64"/&amp;gt;&lt;BR /&gt; &amp;lt;Tool Name="VFCustomBuildTool"/&amp;gt;&lt;BR /&gt; &amp;lt;Tool Name="VFPreLinkEventTool"/&amp;gt;&lt;BR /&gt; &amp;lt;Tool Name="VFPreBuildEventTool"/&amp;gt;&lt;BR /&gt; &amp;lt;Tool Name="VFPostBuildEventTool"/&amp;gt;&lt;BR /&gt; &amp;lt;Tool Name="VFManifestTool" SuppressStartupBanner="true"/&amp;gt;&amp;lt;/Configuration&amp;gt;&lt;/P&gt;
&lt;P&gt;[/xml]&lt;/P&gt;
&lt;P&gt;Best regards, Arash.&lt;/P&gt;</description>
    <pubDate>Wed, 07 Aug 2013 08:21:13 GMT</pubDate>
    <dc:creator>Arash_Rasekh</dc:creator>
    <dc:date>2013-08-07T08:21:13Z</dc:date>
    <item>
      <title>Problem with OpenMP loop and polymorphic object</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-OpenMP-loop-and-polymorphic-object/m-p/970481#M97003</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;I have a problem in my program when i compile it with&amp;nbsp;&lt;EM&gt;/Qopenmp&lt;/EM&gt;. At a random point, the following run-time error apeared:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;"forrtl: severe (173): a pointer passed to DEALLOCATE points to an object that cannot be deallocated"&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;&lt;BR /&gt;&lt;/EM&gt;Here there is a simplified version of my code:&lt;/P&gt;
&lt;P&gt;[fortran]&lt;/P&gt;
&lt;P&gt;module ModuleVector&lt;BR /&gt; implicit none&lt;BR /&gt; integer, parameter :: wp = kind(1.0d0)&lt;BR /&gt; !====================================================================================&lt;BR /&gt; type,abstract :: TypeVectorBase&lt;BR /&gt; real(wp) :: x=0._wp&lt;BR /&gt; real(wp) :: y=0._wp&lt;BR /&gt; contains&lt;BR /&gt; procedure(interfaceVectorAssignment),deferred,private :: vectorAssignment&lt;BR /&gt; generic :: assignment(=) =&amp;gt;vectorAssignment&lt;BR /&gt; end type&lt;BR /&gt; !---------&lt;BR /&gt; type,extends(TypeVectorBase) :: TypeVector2d&lt;BR /&gt; contains&lt;BR /&gt; procedure,private :: vectorAssignment=&amp;gt;vectorAssignment2d&lt;BR /&gt; end type&lt;BR /&gt; !================================&lt;BR /&gt; abstract interface&lt;BR /&gt; subroutine interfaceVectorAssignment(vector1,vector2)&lt;BR /&gt; import :: TypeVectorBase&lt;BR /&gt; class(TypeVectorBase) ,intent(out) :: vector1&lt;BR /&gt; class(TypeVectorBase) ,intent(in) :: vector2&lt;BR /&gt; end subroutine interfaceVectorAssignment&lt;BR /&gt; end interface&lt;BR /&gt;!====================================================================================&lt;BR /&gt; ! declerations&lt;BR /&gt; class(TypeVectorBase),allocatable :: baseVector&lt;BR /&gt; class(TypeVectorBase),allocatable :: testVector(:,:)&lt;BR /&gt; !====================================================================================&lt;BR /&gt; contains&lt;BR /&gt; subroutine vectorAssignment2d(vector1,vector2)&lt;BR /&gt; ! 11/18/2012&lt;BR /&gt; class(TypeVector2d) ,intent(out) :: vector1&lt;BR /&gt; class(TypeVectorBase) ,intent(in) :: vector2&lt;BR /&gt; ! body&lt;BR /&gt; vector1%x=vector2%x&lt;BR /&gt; vector1%y=vector2%y&lt;BR /&gt; end subroutine vectorAssignment2d&lt;BR /&gt; end module&lt;BR /&gt; !************************************************************************************&lt;BR /&gt; module ModuleEquationOfState&lt;BR /&gt; ! Created: 02/23/2013&lt;BR /&gt; use ModuleVector&lt;BR /&gt; implicit none&lt;BR /&gt; !====================================================================================&lt;BR /&gt; type,abstract :: TypeEquationOfStateBase&lt;BR /&gt; class(TypeVectorBase),allocatable :: rhoU&lt;BR /&gt; end type TypeEquationOfStateBase&lt;BR /&gt; !---------------------------------------&lt;BR /&gt; type,extends(TypeEquationOfStateBase) :: TypeCaloricallyPrefectGas&lt;BR /&gt; end type TypeCaloricallyPrefectGas&lt;BR /&gt; !====================================================================================&lt;BR /&gt; ! deceleartions&lt;BR /&gt; class(TypeEquationOfStateBase),allocatable :: equationOfState&lt;BR /&gt; !$OMP THREADPRIVATE(equationOfState)&lt;BR /&gt; !====================================================================================&lt;BR /&gt; end module ModuleEquationOfState&lt;BR /&gt; !************************************************************************************&lt;BR /&gt; subroutine initiateCaloricallyPrefectGas(equation)&lt;BR /&gt; use ModuleEquationOfState&lt;BR /&gt; use ModuleVector&lt;BR /&gt; implicit none&lt;BR /&gt; ! Created : 05/24/2013&lt;BR /&gt; !Arguments&lt;BR /&gt; class(TypeEquationOfStateBase),intent(inout) :: equation&lt;BR /&gt; ! local variables&lt;BR /&gt; ! body&lt;BR /&gt; allocate(equation%rhoU,source=baseVector)&lt;BR /&gt; end subroutine initiateCaloricallyPrefectGas&lt;BR /&gt; !***************************************&lt;BR /&gt; subroutine evaluateTimeStepSimple(blockNumber,ElementNumber)&lt;BR /&gt; ! 05/27/2013&lt;BR /&gt; use ModuleVector&lt;BR /&gt; use ModuleEquationOfState&lt;BR /&gt; implicit none&lt;BR /&gt; !Arguments&lt;BR /&gt; integer,intent(in) :: blockNumber,ElementNumber&lt;BR /&gt; !Local variables&lt;BR /&gt; ! Body&lt;BR /&gt; equationOfState%rhoU=testVector(blockNumber,ElementNumber)&lt;BR /&gt; end subroutine evaluateTimeStepSimple&lt;BR /&gt; !***************************************&lt;BR /&gt; subroutine runLowStorageRungeKutta()&lt;BR /&gt; !$ use omp_lib, only: OMP_GET_NUM_PROCS,omp_set_num_threads&lt;BR /&gt; !$ use ModuleVector&lt;BR /&gt; !$ use ModuleEquationOfState&lt;BR /&gt; implicit none&lt;BR /&gt; ! local variables&lt;BR /&gt; integer :: m,i,j&lt;BR /&gt; !$ real(8) :: power&lt;BR /&gt; !$ integer :: numberOfThreads,numberOfProcessors&lt;BR /&gt; !$ power=0.75 !Conditional compilation&lt;BR /&gt; !$ numberOfProcessors= OMP_GET_NUM_PROCS() !Conditional compilation&lt;BR /&gt; !$ numberOfThreads= numberOfProcessors*power !Conditional compilation&lt;BR /&gt; !$ call omp_set_num_threads(numberOfThreads) !Conditional compilation&lt;BR /&gt; !$ call omp_set_nested(.true.)&lt;BR /&gt; !!$ call omp_set_dynamic(.true.)&lt;BR /&gt; do m=1,5&lt;BR /&gt; !-----&lt;BR /&gt; !$OMP PARALLEL DO SCHEDULE(DYNAMIC,1) DEFAULT(SHARED) COPYIN(equationOfState)&lt;BR /&gt; do i=1,10&lt;BR /&gt; !-----&lt;BR /&gt; !$OMP PARALLEL DO SCHEDULE(GUIDED) SHARED(i) DEFAULT(SHARED) COPYIN(equationOfState)&lt;BR /&gt; do j=1,15&lt;BR /&gt; !write(*,*), "Hello world." ! When this statement uncommented, issue doesn't occur.&lt;BR /&gt; call evaluateTimeStepSimple(i,j)&lt;BR /&gt; end do&lt;BR /&gt; !$OMP END PARALLEL DO&lt;BR /&gt; !-----&lt;BR /&gt; end do&lt;BR /&gt; !$OMP END PARALLEL DO&lt;BR /&gt; !-----&lt;BR /&gt; end do&lt;BR /&gt; end subroutine runLowStorageRungeKutta&lt;BR /&gt; !***************************************&lt;BR /&gt; program testProgram&lt;BR /&gt; use ModuleVector&lt;BR /&gt; use ModuleEquationOfState&lt;BR /&gt; allocate(TypeVector2d::baseVector)&lt;BR /&gt; allocate(testVector(10,15),source=baseVector)&lt;BR /&gt; allocate(TypeCaloricallyPrefectGas:: equationOfState)&lt;BR /&gt; testVector.x=10._wp&lt;BR /&gt; testVector.y=20._wp&lt;BR /&gt; call initiateCaloricallyPrefectGas(equationOfState)&lt;BR /&gt; call runLowStorageRungeKutta()&lt;BR /&gt; end&lt;/P&gt;
&lt;P&gt;[/fortran]&lt;/P&gt;
&lt;P&gt;When i uncomment the write statement in&amp;nbsp;&lt;EM&gt;runLowStorageRungeKutta&lt;/EM&gt;&amp;nbsp;subroutine, the program work without problem.&lt;/P&gt;
&lt;P&gt;I use Intel Fortran&amp;nbsp;13.0.3615 and my project configuration is:&lt;/P&gt;
&lt;P&gt;[xml]&lt;/P&gt;
&lt;P&gt;&amp;lt;Configuration Name="Debug|x64"&amp;gt;&lt;BR /&gt; &amp;lt;Tool Name="VFFortranCompilerTool" AdditionalOptions="&amp;amp;#xA;" SuppressStartupBanner="true" DebugInformationFormat="debugEnabled" Optimization="optimizeDisabled" Preprocess="preprocessYes" AdditionalIncludeDirectories="&amp;amp;quot;C:\Program Files (x86)\Intel\Composer XE 2013\mkl\include&amp;amp;quot;;&amp;amp;quot;C:\Program Files (x86)\Intel\Composer XE 2013\compiler\include&amp;amp;quot;" OpenMP="OpenMPParallelCode" F2003Semantics="true" Diagnostics="diagnosticsShowAll" DebugParameter="debugParameterAll" WarnInterfaces="true" Traceback="true" BoundsCheck="true" RuntimeLibrary="rtMultiThreadedDebug" Interfaces="true"/&amp;gt;&lt;BR /&gt; &amp;lt;Tool Name="VFLinkerTool" LinkIncremental="linkIncrementalNo" SuppressStartupBanner="true" AdditionalLibraryDirectories="&amp;amp;quot;C:\Program Files (x86)\Intel\Composer XE 2013\mkl\lib\intel64&amp;amp;quot;" GenerateDebugInformation="true" GenerateMapFile="true" SubSystem="subSystemConsole" AdditionalDependencies="mkl_lapack95_ilp64.lib mkl_intel_ilp64.lib mkl_intel_thread.lib mkl_core.lib libiomp5md.lib"/&amp;gt;&lt;BR /&gt; &amp;lt;Tool Name="VFResourceCompilerTool"/&amp;gt;&lt;BR /&gt; &amp;lt;Tool Name="VFMidlTool" SuppressStartupBanner="true" TargetEnvironment="midlTargetAMD64"/&amp;gt;&lt;BR /&gt; &amp;lt;Tool Name="VFCustomBuildTool"/&amp;gt;&lt;BR /&gt; &amp;lt;Tool Name="VFPreLinkEventTool"/&amp;gt;&lt;BR /&gt; &amp;lt;Tool Name="VFPreBuildEventTool"/&amp;gt;&lt;BR /&gt; &amp;lt;Tool Name="VFPostBuildEventTool"/&amp;gt;&lt;BR /&gt; &amp;lt;Tool Name="VFManifestTool" SuppressStartupBanner="true"/&amp;gt;&amp;lt;/Configuration&amp;gt;&lt;/P&gt;
&lt;P&gt;[/xml]&lt;/P&gt;
&lt;P&gt;Best regards, Arash.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2013 08:21:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-OpenMP-loop-and-polymorphic-object/m-p/970481#M97003</guid>
      <dc:creator>Arash_Rasekh</dc:creator>
      <dc:date>2013-08-07T08:21:13Z</dc:date>
    </item>
    <item>
      <title>The problem apear in</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-OpenMP-loop-and-polymorphic-object/m-p/970482#M97004</link>
      <description>&lt;P&gt;The problem apear in&amp;nbsp;&lt;EM&gt;vectorAssignment2d&lt;/EM&gt; subroutine which called in nested parallel loop by calling&amp;nbsp;&lt;EM&gt;evaluateTimeStepSimple.&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;Arash.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2013 08:27:24 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-OpenMP-loop-and-polymorphic-object/m-p/970482#M97004</guid>
      <dc:creator>Arash_Rasekh</dc:creator>
      <dc:date>2013-08-07T08:27:24Z</dc:date>
    </item>
    <item>
      <title>After changing the intent of</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-OpenMP-loop-and-polymorphic-object/m-p/970483#M97005</link>
      <description>&lt;P&gt;After changing the intent of vector1 from&lt;EM&gt; intent(in)&lt;/EM&gt; to &lt;EM&gt;intent(inout)&lt;/EM&gt;, the problem solved but new issues apeard.&lt;/P&gt;
&lt;P&gt;Here there is the new code which new function added to it:&lt;/P&gt;
&lt;P&gt;[fortran]&lt;/P&gt;
&lt;P&gt;module ModuleVector&lt;BR /&gt; implicit none&lt;BR /&gt; integer, parameter :: wp = kind(1.0d0)&lt;BR /&gt; !====================================================================================&lt;BR /&gt; type,abstract :: TypeVectorBase&lt;BR /&gt; real(wp) :: x=0._wp&lt;BR /&gt; real(wp) :: y=0._wp&lt;BR /&gt; contains&lt;BR /&gt; procedure(interfaceVectorAssignment),deferred,private :: vectorAssignment&lt;BR /&gt; procedure(interfaceVectorVectorRealVectorOperator),deferred,private :: vectorVectorRealAdditionVectorResult&lt;BR /&gt; generic :: assignment(=) =&amp;gt;vectorAssignment&lt;BR /&gt; generic,public :: add=&amp;gt;vectorVectorRealAdditionVectorResult&lt;BR /&gt; end type&lt;BR /&gt; !---------&lt;BR /&gt; type,extends(TypeVectorBase) :: TypeVector2d&lt;BR /&gt; contains&lt;BR /&gt; procedure,private :: vectorAssignment=&amp;gt;vectorAssignment2d&lt;BR /&gt; procedure,private :: vectorVectorRealAdditionVectorResult =&amp;gt;vectorVectorRealAdditionVectorResult2d&lt;BR /&gt; end type&lt;BR /&gt; !================================&lt;BR /&gt; abstract interface&lt;BR /&gt; subroutine interfaceVectorAssignment(vector1,vector2)&lt;BR /&gt; import :: TypeVectorBase&lt;BR /&gt; class(TypeVectorBase) ,intent(inout) :: vector1&lt;BR /&gt; class(TypeVectorBase) ,intent(in) :: vector2&lt;BR /&gt; end subroutine interfaceVectorAssignment&lt;BR /&gt; !--------&lt;BR /&gt; function interfaceVectorVectorRealVectorOperator(vector1,vector2) result(vector3)&lt;BR /&gt; import :: TypeVectorBase,wp&lt;BR /&gt; class(TypeVectorBase),intent(in) :: vector1&lt;BR /&gt; real(wp),intent(in) :: vector2(:)&lt;BR /&gt; !class(TypeVectorBase),intent(inout) :: vector1 ! changed due to OMP bugs.&lt;BR /&gt; !real(wp),intent(inout) :: vector2(:)! changed due to OMP bugs.&lt;BR /&gt; class(TypeVectorBase),allocatable:: vector3&lt;BR /&gt; end function interfaceVectorVectorRealVectorOperator&lt;BR /&gt; end interface&lt;BR /&gt; !================================&lt;BR /&gt; !====================================================================================&lt;BR /&gt; ! declerations&lt;BR /&gt; class(TypeVectorBase),allocatable :: baseVector&lt;BR /&gt; class(TypeVectorBase),allocatable :: testVector(:,:)&lt;BR /&gt; !====================================================================================&lt;BR /&gt; contains&lt;BR /&gt; subroutine vectorAssignment2d(vector1,vector2)&lt;BR /&gt; ! 11/18/2012&lt;BR /&gt; class(TypeVector2d) ,intent(inout) :: vector1&lt;BR /&gt; class(TypeVectorBase) ,intent(in) :: vector2&lt;BR /&gt; ! body&lt;BR /&gt; vector1%x=vector2%x&lt;BR /&gt; vector1%y=vector2%y&lt;BR /&gt; end subroutine vectorAssignment2d&lt;BR /&gt; !-------------&lt;BR /&gt; function vectorVectorRealAdditionVectorResult2d(vector1,vector2) result(vector3)&lt;BR /&gt; !12/15/2012&lt;BR /&gt; ! arguments&lt;BR /&gt; class(TypeVector2d),intent(in) :: vector1&lt;BR /&gt; real(wp),intent(in) :: vector2(:)&lt;BR /&gt; class(TypeVectorBase),allocatable:: vector3&lt;BR /&gt; !!$OMP THREADPRIVATE(vector3)&lt;BR /&gt; ! body&lt;BR /&gt; !&lt;BR /&gt; allocate(TypeVector2d :: vector3)&lt;BR /&gt; vector3.x=vector1.x+vector2(1)&lt;BR /&gt; vector3.y=vector1.y+vector2(2)&lt;BR /&gt; return&lt;BR /&gt; end function vectorVectorRealAdditionVectorResult2d&lt;BR /&gt; end module&lt;BR /&gt; !************************************************************************************&lt;BR /&gt; module ModuleEquationOfState&lt;BR /&gt; ! Created: 02/23/2013&lt;BR /&gt; use ModuleVector&lt;BR /&gt; implicit none&lt;BR /&gt; !====================================================================================&lt;BR /&gt; type,abstract :: TypeEquationOfStateBase&lt;BR /&gt; class(TypeVectorBase),allocatable :: rhoU&lt;BR /&gt; integer,allocatable :: a&lt;BR /&gt; end type TypeEquationOfStateBase&lt;BR /&gt; !---------------------------------------&lt;BR /&gt; type,extends(TypeEquationOfStateBase) :: TypeCaloricallyPrefectGas&lt;BR /&gt; end type TypeCaloricallyPrefectGas&lt;BR /&gt; !====================================================================================&lt;BR /&gt; ! deceleartions&lt;BR /&gt; class(TypeEquationOfStateBase),allocatable :: equationOfState&lt;BR /&gt; !$OMP THREADPRIVATE(equationOfState)&lt;BR /&gt; !====================================================================================&lt;BR /&gt; end module ModuleEquationOfState&lt;BR /&gt; !************************************************************************************&lt;BR /&gt; subroutine initiateCaloricallyPrefectGas(equation)&lt;BR /&gt; use ModuleEquationOfState&lt;BR /&gt; use ModuleVector&lt;BR /&gt; implicit none&lt;BR /&gt; ! Created : 05/24/2013&lt;BR /&gt; !Arguments&lt;BR /&gt; class(TypeEquationOfStateBase),intent(inout) :: equation&lt;BR /&gt; ! local variables&lt;BR /&gt; ! body&lt;BR /&gt; allocate(equation%rhoU,source=baseVector)&lt;BR /&gt; allocate(equation%a)&lt;BR /&gt; end subroutine initiateCaloricallyPrefectGas&lt;BR /&gt; !***************************************&lt;BR /&gt; subroutine evaluateTimeStepSimple(blockNumber,ElementNumber)&lt;BR /&gt; ! 05/27/2013&lt;BR /&gt; use ModuleVector&lt;BR /&gt; use ModuleEquationOfState&lt;BR /&gt; implicit none&lt;BR /&gt; !Arguments&lt;BR /&gt; integer,intent(in) :: blockNumber,ElementNumber&lt;BR /&gt; !Local variables&lt;BR /&gt; ! Body&lt;BR /&gt; equationOfState%rhoU=testVector(blockNumber,ElementNumber)&lt;BR /&gt; end subroutine evaluateTimeStepSimple&lt;BR /&gt; !***************************************&lt;BR /&gt; subroutine runLowStorageRungeKutta()&lt;BR /&gt; !$ use omp_lib, only: OMP_GET_NUM_PROCS,omp_set_num_threads&lt;BR /&gt; !$ use ModuleVector&lt;BR /&gt; !$ use ModuleEquationOfState&lt;BR /&gt; implicit none&lt;BR /&gt; ! local variables&lt;BR /&gt; integer :: m,i,j&lt;BR /&gt; !$ real(8) :: power&lt;BR /&gt; !$ integer :: numberOfThreads,numberOfProcessors&lt;BR /&gt; !$ power=0.75 !Conditional compilation&lt;BR /&gt; !$ numberOfProcessors= OMP_GET_NUM_PROCS() !Conditional compilation&lt;BR /&gt; !$ numberOfThreads= numberOfProcessors*power !Conditional compilation&lt;BR /&gt; !$ call omp_set_num_threads(numberOfThreads) !Conditional compilation&lt;BR /&gt; !$ call omp_set_nested(.true.)&lt;BR /&gt; !!$ call omp_set_dynamic(.true.)&lt;BR /&gt; do m=1,1&lt;BR /&gt; !-----&lt;BR /&gt; !$OMP PARALLEL DO SCHEDULE(DYNAMIC,1) DEFAULT(SHARED) COPYIN(equationOfState)&lt;BR /&gt; do i=1,10&lt;BR /&gt; !-----&lt;BR /&gt; !$OMP PARALLEL DO SCHEDULE(GUIDED) SHARED(i) DEFAULT(SHARED) COPYIN(equationOfState)&lt;BR /&gt; do j=1,10&lt;BR /&gt; !write(*,*), "Hello world." ! When this statement uncommented, issue doesn't occur.&lt;BR /&gt; call evaluateTimeStepSimple(i,j)&lt;BR /&gt; testVector(i,j)=equationOfState%rhoU%add([1._wp,1._wp])&lt;/P&gt;
&lt;P&gt;end do&lt;BR /&gt; !$OMP END PARALLEL DO&lt;BR /&gt; !!$omp barrier&lt;BR /&gt; !-----&lt;BR /&gt; end do&lt;BR /&gt; !$OMP END PARALLEL DO&lt;BR /&gt; !-----&lt;BR /&gt; end do&lt;BR /&gt; end subroutine runLowStorageRungeKutta&lt;BR /&gt; !***************************************&lt;BR /&gt; program testProgram&lt;BR /&gt; use ModuleVector&lt;BR /&gt; use ModuleEquationOfState&lt;BR /&gt; allocate(TypeVector2d::baseVector)&lt;BR /&gt; allocate(testVector(50,50),source=baseVector)&lt;BR /&gt; allocate(TypeCaloricallyPrefectGas:: equationOfState)&lt;BR /&gt; testVector.x=10._wp&lt;BR /&gt; testVector.y=20._wp&lt;BR /&gt; call initiateCaloricallyPrefectGas(equationOfState)&lt;BR /&gt; call runLowStorageRungeKutta()&lt;BR /&gt; end&lt;/P&gt;
&lt;P&gt;[/fortran]&lt;/P&gt;
&lt;P&gt;The new problem occur due to allocation and deallocation of &lt;EM&gt;vector3&lt;/EM&gt; in&amp;nbsp;function &lt;EM&gt;vectorVectorRealAdditionVectorResult2d&lt;/EM&gt; by multiple threads at same time. Because the &lt;EM&gt;vector3&lt;/EM&gt; is the return value of the function, i cannot define it as a threadprivate variable.&amp;nbsp;(it need save attribute which cannot use for result of function)&lt;/P&gt;
&lt;P&gt;I want to know is there anyway to define the result value of a function as a private variable for each thread&amp;nbsp;(in dynamic extent of a parallel region)?&lt;/P&gt;
&lt;P&gt;P.S: I have to much functions where their results are polymorphic variables or allocatable arrays. So i cannot change them to subroutine in order to prevent ussing temporary variables.(i.e result of function)&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2013 18:07:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-OpenMP-loop-and-polymorphic-object/m-p/970483#M97005</guid>
      <dc:creator>Arash_Rasekh</dc:creator>
      <dc:date>2013-08-07T18:07:56Z</dc:date>
    </item>
    <item>
      <title>You do have an error in your</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-OpenMP-loop-and-polymorphic-object/m-p/970484#M97006</link>
      <description>&lt;P&gt;You do have an error in your program which the compiler warns me about - you call initiateCaloricallyPrefectGas from the main program, and this routine has an implicit interface (it isn't in a module.) However, the routine has a polymorphic argument and the standard requires an explicit interface in this case.&amp;nbsp; You should put those routines in a module as well.&lt;/P&gt;
&lt;P&gt;What you're doing should work - it is almost certainly a compiler bug that it doesn't. I will take a look at the revised program and see what is going on.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2013 18:36:55 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-OpenMP-loop-and-polymorphic-object/m-p/970484#M97006</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2013-08-07T18:36:55Z</dc:date>
    </item>
    <item>
      <title>Hi,</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-OpenMP-loop-and-polymorphic-object/m-p/970485#M97007</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Thank you Steve.&lt;/P&gt;
&lt;P&gt;In my orginal program explicit interfaces are included, But here for simplification i removed them from sample code.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2013 18:58:11 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-OpenMP-loop-and-polymorphic-object/m-p/970485#M97007</guid>
      <dc:creator>Arash_Rasekh</dc:creator>
      <dc:date>2013-08-07T18:58:11Z</dc:date>
    </item>
    <item>
      <title>Ok. They don't affect the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-OpenMP-loop-and-polymorphic-object/m-p/970486#M97008</link>
      <description>&lt;P&gt;Ok. They don't affect the symptoms, but I wanted to mention it.&lt;/P&gt;
&lt;P&gt;Out of curiosity, why did you use OMP !$ to conditionally USE the modules in runLowStorageRungeKutta? The program won't compile then if you don't enable OpenMP.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2013 19:22:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-OpenMP-loop-and-polymorphic-object/m-p/970486#M97008</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2013-08-07T19:22:41Z</dc:date>
    </item>
    <item>
      <title>I'm working on a project</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-OpenMP-loop-and-polymorphic-object/m-p/970487#M97009</link>
      <description>&lt;P&gt;I'm working on a project which have serial and parallel cores. The cores are FORTRAN DLL and handled by a C# user interface. I use conditional compilation just for safety, because the cores built&amp;nbsp;by a set of shared sources. (i.e. the serial and parallel cores sources are almost same and just their project configurations are different)&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2013 19:48:33 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-OpenMP-loop-and-polymorphic-object/m-p/970487#M97009</guid>
      <dc:creator>Arash_Rasekh</dc:creator>
      <dc:date>2013-08-07T19:48:33Z</dc:date>
    </item>
    <item>
      <title>I have escalated the problem</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-OpenMP-loop-and-polymorphic-object/m-p/970488#M97010</link>
      <description>&lt;P&gt;I have escalated the problem to developers as issue DPD200246974.&lt;/P&gt;
&lt;P&gt;I asked about the conditional compilation for the USE lines specifically, as without them the source would not compile at all - at least not in this version. Maybe your actual code looks different.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2013 19:54:59 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-OpenMP-loop-and-polymorphic-object/m-p/970488#M97010</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2013-08-07T19:54:59Z</dc:date>
    </item>
    <item>
      <title>Ah, sorry, you are right.</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-OpenMP-loop-and-polymorphic-object/m-p/970489#M97011</link>
      <description>&lt;P&gt;Ah, sorry, you are right.&lt;/P&gt;
&lt;P&gt;In the original code they must compiled just for parallel core. i forget to remove their conditional compilation&amp;nbsp;on the sample code.&lt;/P&gt;
&lt;P&gt;In&amp;nbsp;OpenMP Application Program Interface Version3.1 specification document, the data-sharing attributes&amp;nbsp;of result values for FORTRAN doesn't mentioned. Are they encountered as local variables - and thus they are shared variables- or they are private to each thread?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2013 20:11:17 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-OpenMP-loop-and-polymorphic-object/m-p/970489#M97011</guid>
      <dc:creator>Arash_Rasekh</dc:creator>
      <dc:date>2013-08-07T20:11:17Z</dc:date>
    </item>
    <item>
      <title>They should be the same as</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-OpenMP-loop-and-polymorphic-object/m-p/970490#M97012</link>
      <description>&lt;P&gt;They should be the same as any local variable in the function and private to each call of the routine in each thread.&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2013 20:15:25 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-OpenMP-loop-and-polymorphic-object/m-p/970490#M97012</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2013-08-07T20:15:25Z</dc:date>
    </item>
    <item>
      <title>Thank you Steve for your help</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-OpenMP-loop-and-polymorphic-object/m-p/970491#M97013</link>
      <description>Thank you Steve for your help.</description>
      <pubDate>Wed, 07 Aug 2013 20:53:56 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-OpenMP-loop-and-polymorphic-object/m-p/970491#M97013</guid>
      <dc:creator>Arash_Rasekh</dc:creator>
      <dc:date>2013-08-07T20:53:56Z</dc:date>
    </item>
    <item>
      <title>The OpenMP 4.0 spec says</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-OpenMP-loop-and-polymorphic-object/m-p/970492#M97014</link>
      <description>&lt;P&gt;The OpenMP 4.0 spec says "polymorphic things aren't supported".&amp;nbsp; Is this really a bug proper, or just a reflection of that spec?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Aug 2013 23:06:13 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-OpenMP-loop-and-polymorphic-object/m-p/970492#M97014</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2013-08-07T23:06:13Z</dc:date>
    </item>
    <item>
      <title>I made the type non</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-OpenMP-loop-and-polymorphic-object/m-p/970493#M97015</link>
      <description>&lt;P&gt;I made the type non-polymorphic and still saw a problem, but I'll take another look. You could be right.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2013 00:32:48 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-OpenMP-loop-and-polymorphic-object/m-p/970493#M97015</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2013-08-08T00:32:48Z</dc:date>
    </item>
    <item>
      <title>If your answer was "sod the</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-OpenMP-loop-and-polymorphic-object/m-p/970494#M97016</link>
      <description>&lt;P&gt;If your answer was "sod the spec - we've taken the initiative to extend our implementation of OpenMP to cover other bits of F2003 in what we think is a sensible fashion" I'd be very happy.&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2013 01:26:41 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-OpenMP-loop-and-polymorphic-object/m-p/970494#M97016</guid>
      <dc:creator>IanH</dc:creator>
      <dc:date>2013-08-08T01:26:41Z</dc:date>
    </item>
    <item>
      <title>My opinion is that either it</title>
      <link>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-OpenMP-loop-and-polymorphic-object/m-p/970495#M97017</link>
      <description>&lt;P&gt;My opinion is that either it should work, or the compiler should complain if such is not supported.&lt;/P&gt;
&lt;P&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2013 13:22:52 GMT</pubDate>
      <guid>https://community.intel.com/t5/Intel-Fortran-Compiler/Problem-with-OpenMP-loop-and-polymorphic-object/m-p/970495#M97017</guid>
      <dc:creator>Steven_L_Intel1</dc:creator>
      <dc:date>2013-08-08T13:22:52Z</dc:date>
    </item>
  </channel>
</rss>

