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.

Another coarray issue

OP1
New Contributor III
874 Views

Let's assume I have the two following source files:

MODULE TEST_MODULE
    USE,INTRINSIC :: ISO_FORTRAN_ENV
    IMPLICIT NONE
    INTEGER,ALLOCATABLE :: A(:)[:]
END MODULE TEST_MODULE

and

PROGRAM TEST
    USE TEST_MODULE
    IMPLICIT NONE
    ALLOCATE(A(10)
  • ) END PROGRAM TEST
  • Running the code yields: "forrtl: severe (151): allocatable array is already allocated..."

    Now, if I bundle the module and the program in the same source file, as shown here:

    MODULE TEST_MODULE
        USE,INTRINSIC :: ISO_FORTRAN_ENV
        IMPLICIT NONE
        INTEGER,ALLOCATABLE :: A(:)[:]
    END MODULE TEST_MODULE
    
    PROGRAM TEST
        USE TEST_MODULE
        IMPLICIT NONE
        ALLOCATE(A(10)
  • ) END PROGRAM TEST
  • then the program runs successfully (well at least it does not crash).

    All this is with IVF 15.0 Update 0 (latest Beta) and VS2013. Any idea? I am trying very hard these days to love Intel coarrays but it's not easy...

    7 Replies
    OP1
    New Contributor III
    874 Views

    ... and when I compile from the command line I get an "fortcom: Fatal: There has been an internal compiler error (C0000005). Compilation aborted for TEST.f90 (code 1)" error message. Strange. This is with Version 15.0.0.070 Beta Build 20140530.
     

    0 Kudos
    Steven_L_Intel1
    Employee
    874 Views

    Thanks - we'll take a look at this.

    0 Kudos
    Steven_L_Intel1
    Employee
    874 Views

    I can reproduce both problems - thanks. Curiously, it's only in 15.0, not in 14.0. I have escalated this as issue DPD200360242.

    0 Kudos
    OP1
    New Contributor III
    874 Views

    Thanks Steve!

    I would add that (at least, on my machine) the behavior of the compiler (and the resulting executable) seems to differ whether it is compiled as a Debug or Release version. The Release version triggers an ICE. The Debug version compiles and links; but then the code, when executed, triggers an 'allocatable array already allocated'. This behavior holds for both 32-bit and 64-bit versions.

    This is a very basic functionality (being able to put a coarray in a module!) and therefore this bug is a complete show-stopper, I would say that because of this regression coarrays are not useable with 15.0 for any realistic, non-trivial code.

    [I also suspect that there is something fishy happening with the MPI libraries during the installation/integration of 15.0 with VS2013, although this may be limited to my environment; but I would have expected however that a fresh install of both VS2013 (first) and then the Intel compiler could solve my problems - and this did not]

    0 Kudos
    Steven_L_Intel1
    Employee
    874 Views

    Yes, that's what I found. I doubt there is any MPI issue here - it seems to be a generated code problem. The developers are looking at this now.

    0 Kudos
    Steven_L_Intel1
    Employee
    874 Views

    A simple workaround for this one - add the SAVE attribute to the coarray in the module. This is harmless as the standard has it given SAVE anyway as a module variable.

    0 Kudos
    OP1
    New Contributor III
    874 Views

    Thanks Steve - this will do as a stop gap measure. I will declare all my module coarrays with the SAVE attribute and test again.

    0 Kudos
    Reply