Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.
Announcements
FPGA community forums and blogs on community.intel.com are migrating to the new Altera Community and are read-only. For urgent support needs during this transition, please visit the FPGA Design Resources page or contact an Altera Authorized Distributor.

OpenMP crash when using CLASS(*)

John_Young
New Contributor I
837 Views

Hi,

I'm seeing a weird crash when using an openmp do loop with a class(*) pointer.  A short test case is attached.  In the test case, if the three lines of the 'select type' statement are included, the code crashes.  If the select type is commented, the code runs.  Interestingly, the code does not even need to execute the select type statement for the crash to happen as I have a 'cycle' statement at the start of the loop. 

I can't see anything apparently wrong with the code.  Is this a possible openmp and/or fortran bug or am I violating something in the openmp standard?

I'm using intel fortran 14.0.3 on a linux machine. My compile line is 'ifort -openmp test.f90'

Thanks,

John

0 Kudos
7 Replies
IanH
Honored Contributor III
837 Views

Note that the current OpenMP standard (and the draft next standard) explicitly states that polymorphic entities are not supported.  I don't know what the compiler itself supports in this regard.

0 Kudos
John_Young
New Contributor I
837 Views

Thanks.  That's good to know that this is non-standard. We were wondering why it was not working.

Interestingly, if we give classpointer the 'save' attribute and make it THREADPRIVATE, then the code works fine.  Do you know if THREADPRIVATE polymorphic entities are allowable by the standard or is this just luck that it is working.

Thanks again,

John

0 Kudos
jimdempseyatthecove
Honored Contributor III
837 Views

What happens when you point classpointer at something prior to entering the parallel region?

Jim Dempsey

0 Kudos
John_Young
New Contributor I
837 Views

In our full code (which this test case was boiled down from), use of classpointer before the parallel region works fine.  The crash only happens after entering the parallel region, and, in this case, is produced when the select case statement is added (whether the select case code is executed or not).

I could modify the test case to show this if that would help.

0 Kudos
jimdempseyatthecove
Honored Contributor III
837 Views

I do not have an older version here for testing. I seem to recall issues with CLASS(*) on some of the earlier version of IVF. Try the following:

   !$omp parallel                &
   !$omp private(i_t,classpointer), COPYIN(CLASSPOINTER)

Jim Dempsey

 

0 Kudos
John_Young
New Contributor I
837 Views
Adding the copyin clause does not prevent the crash. John
0 Kudos
Kevin_D_Intel
Employee
837 Views

Thanks for the report John. I can reproduce this also with the current release. I will pass along all the findings the Developers to get their feedback.

0 Kudos
Reply