Intel® Fortran Compiler
Build applications that can scale for the future with optimized code designed for Intel® Xeon® and compatible processors.

XE 2017 regression with OpenMP parallel if clause

Mark_Lewy
Valued Contributor I
389 Views

Apologies for posting this here rather than at Premier Support, but:

1) I won't be around for the next week.

2) I haven't managed to produce a small reproducer yet and won't have time to do so today.

While trying to build our main engine project with Intel Fortran Composer XE2017 (17.0.0.109), I get several compilation errors on OpenMP directives:

    subroutine perf_faceflux_lp(current_model, retval)
        ! The following statement is only compiled when OpenMP directives are processed
        !$ use omp_lib
        logical :: do_in_parallel

        ! Declarations and code elided

        !$OMP parallel &
        !$OMP & if(do_in_parallel) &
        !$OMP & shared(current_model) &
        !$OMP & private(update_face) &
        !$OMP & private(dt_l) &
        !$OMP & private(list_of_new_updated_elem) &
        !$OMP & private(num_new_update_elem) &
        !$OMP & private(istat) &
        !$OMP & reduction(.or.: activate_bed_load)

        ! More code!

generates the following compilation errors:

F:\Source\bluezone.xe2017\engines\infoworks_2d\iw_2d_sim\Lib1\face_flux.F90(120): error #5192: Lead underscore not allowed
F:\Source\bluezone.xe2017\engines\infoworks_2d\iw_2d_sim\Lib1\face_flux.F90(120): error #5082: Syntax error, found 'DO' when expecting one of: TASK TASKLOOP TARGET PARALLEL <REAL_KIND_CON> <REAL_CONSTANT> <DBLPRC_CONSTANT> ...
F:\Source\bluezone.xe2017\engines\infoworks_2d\iw_2d_sim\Lib1\face_flux.F90(169): error #7622: Misplaced part of an OpenMP* parallel directive.

This code has compiled successfully on older versions of the compiler including XE 2016 and XE 2015 update with no problems.

Fails on all platforms and configurations for XE 2017.

Sample command line options:

/nologo /debug:full /Od /I"..\lib2\Debug.x64" /I"..\..\..\cs\simlib\Debug.x64" /I"F:\Source\bluezone.xe2017\engines\cs\simlib\Debug.x64" /Qopenmp /stand:f03 /Qdiag-disable:7025,7363 /warn:declarations /warn:unused /warn:truncated_source /Qauto /module:"Debug.x64/" /object:"Debug.x64/" /Fd"Debug.x64\vc120.pdb" /traceback /check:bounds /libs:dll /threads /dbglibs /Qmkl:parallel /libdir:noauto /c

I can work around this by renaming do_in_parallel to exec_in_parallel!

0 Kudos
4 Replies
Mark_Lewy
Valued Contributor I
389 Views

Update: I've submitted a small reproducer for this with Premier Support, it's issue 6000163005.

0 Kudos
Lorri_M_Intel
Employee
389 Views

Hmm ... this seems vaguely familiar.

The parser is getting confused by this line:

!$OMP & if(do_in_parallel) &

If you change the name of that logical to something else, maybe "goo_in_parallel", then it should compile.

      --Lorri

0 Kudos
Mark_Lewy
Valued Contributor I
389 Views

Thanks Lorri,

You will note that in my original post, I also found that renaming the scalar-logical-expression (as the OpenMP spec names it) in the if clause allowed the code to compile.  I wonder if the issue is that the original variable name starts with an OpenMP (or Fortran) keyword?

0 Kudos
Steven_L_Intel1
Employee
389 Views

The presence of the reduction clause is also significant - if it's not there then no problem. Thanks for filing the IPS issue.

0 Kudos
Reply