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

ISO_fotran_binding (bug?)

Edmondo_G_
Beginner
402 Views

I'm experimenting with the iso_fortran_binding  facilities. I have found something that may be a bug.

The compiler Version is:16.0.0.109 Build 20150815

I have written the following C routine:

#include <stdio.h>
#include "ISO_Fortran_binding.h"

void printarraydesc(const CFI_cdesc_t * vin) {
    CFI_index_t i;
    printf("Array\n");
    printf("Rank: %d\n", vin-> rank);
    for(i=0; i<vin->rank; i++) {
        printf("Dimension: %d ", i);
        printf("lbounds %d ", vin->dim.lower_bound);
        printf("extent  %d ", vin->dim.extent);
        printf("stride  %d\n", vin->dim.sm);
    }
}

And the following Fortran program:

program smalltest
implicit none
    interface
        subroutine printarraydesc(vin) bind(C,name="printarraydesc")
            type(*),intent(in) :: vin(..)
        endsubroutine
    end interface

    real :: a(3,4)
    
    call printarraydesc(a)
    call printarraydesc(a(3,:)) 
end program

While the first descriptor is correctly written, it seems that the second one is not. The rank is not passed correctly. It prints:

Array
Rank: 2
Dimension: 0 lbounds 0 extent  3 stride  4
Dimension: 1 lbounds 0 extent  4 stride  12
Array
Rank: 2
Dimension: 0 lbounds 0 extent  4 stride  12
Dimension: 1 lbounds 993324632 extent  2051380828 stride  993324632

 

 

0 Kudos
3 Replies
Kevin_D_Intel
Employee
402 Views

Thank you for your post. I will investigate and update when I know more.

0 Kudos
Kevin_D_Intel
Employee
402 Views

Development confirmed with me earlier that this was a defect. The compiler should only be passing along details for what is actually a one-dimensional array representing the slice of A being sent. I reported the details to them for eventual repair in a future update. Thank you for reporting this and for the convenient reproducer.

(Internal tracking id: DPD200376759)

(Resolution Update on 02/23/2016): This defect is fixed in the Intel® Parallel Studio XE 2016 Update 2 Release (PSXE 2016.2.062/ CnL 2016.2.181 - Linux)
 

0 Kudos
Kevin_D_Intel
Employee
402 Views

This defect is fixed in the latest Intel® Parallel Studio XE 2016 Update 2 release (PSXE 2016.2.062/ CnL 2016.2.181 - Linux).

0 Kudos
Reply