Quantcast
Channel: Intel® Software - Intel® Fortran Compiler for Linux* and macOS*
Viewing all 2746 articles
Browse latest View live

Boundary Run-Time Check Failure for variable

$
0
0

Hi all,

We are investigating a bug in our software and we are getting the following message from the intel fortran compiler:

" Boundary Run-Time Check Failure for variable 'var$1825.0.6'"

A similar issue has already been treated in this forum at https://software.intel.com/en-us/forums/intel-fortran-compiler-for-linux... but our problem is somewhat different, so that we could not draw use of the answer there that solved the problem. 

We would like to analyse the variable 'var$1825.0.6 but we do not know how to do it. This seems to be an automatically created variable. How are such variables getting created? Is it possible to evaluate them in for instance in gdb?

Thanks for your help in advance,

Timo

 

 

 


Segfault when passing non-allocated class variable to optional dummy arg

$
0
0

The binary produced with the ifort 17.0.4 @ x86_64/Linux crashes, if a non-allocated class variable is passed to an optional dummy argument. The code below demonstrates the issue.

Best regards,

Bálint

module mymod
  implicit none

  type :: BaseType
    integer :: ii = 0
  end type BaseType

contains

  subroutine optional(bt)
    class(BaseType), optional :: bt

    print *, 'PRESENT:', present(bt)
    if (present(bt)) then
      bt%ii = 42
    end if

  end subroutine optional

end module mymod


program myprog
  use mymod
  implicit none

  class(BaseType), allocatable :: btClass
  type(BaseType), allocatable ::  btType

  allocate(btType)
  call move_alloc(btType, btClass)
  call optional(btClass)
  deallocate(btClass)
  ! Crashes here
  call optional(btClass)

end program myprog

 

size of symbol changed

$
0
0

I am getting a warning stating:

ld: Warning: size of symbol `contrl_' changed from 120 in contempt28_tu.o to 1292 in hx1.o
 

Background information:  contempt28 is a legacy f77 code being ported to intel fortran 90. 

Here is the COMMON block named CONTRL in hx1.f

      COMMON/CONTRL/IPSPR,ICPR,IRUNG,IRSTW,IRSTR,IHUW,IPLMAP,IPOUT,            
     1ICOUT,IPLT1,ISUM,IPTSAV,IPTSPK,IPTSMX,IRECIR,IDISCH,IBW,                 
     1IAUXW,IAUXR,INODRB,IFPRAT,ITEREL,ISTW,ISTR,IBATCH,IPAINT,                
     1INPGRP,JNTGRT,ITDLIM,ISORT,IBALAN,IRSBAD,JSAVE,ISAVE,                    
     1IMAX1,IMAX2,IRMAX,JCHMAX,IHUR,INBB,IMXFP1,IMAX3,IMAX4,                   
     2INNODE,INUB,IINX(14),IIN2X(14),IBRKX(14),INSR,ICWRI,IDON(22),            
     3IOUT2X(14),INSMGR,INPHSF(15),JBH,INLOOP,JDC,JUH,JDM,JBB,JUB,JVP,         
     4JZCBL,JZSG,JUP,IDONRB(30),ICWALL(2,12),IMXFP2,ILCM,ILEST,                
     5IUO2,IZR,IZO,ICS,ISO,INSB,INRBC,INFPMX,ITL,                              
     & IPSET1(40),IPSET2(40),IUPLIS(25)                                        

Here is the COMMON block for CONTEMPT28.f

     COMMON /CONTRL/ FILID(10),INDEX(10),FILSIZ(10)

This code has been in production for many many years.   Moving this to fortran 90, do I need to change the name of the COMMON block to fix this?

 

files not found by shared library. "...try using -rpath or -rpath-link

$
0
0

This is a f77 code being ported to Intel fortran 90.   The build consists of building a shared library that is used by other fortran programs.   When building contempt28, The linker is complaining (warning) that the shared library I am linking to, cannot find library files.  The -rpath or -rpath-link is not an option I can use in the compiler.   The .so files described in the warning, are library files in the library of the compiler.

 How can I fix this?

See below:
  ld: warning: libifport.so.5, needed by /rxe/source/shlib/v21_cp03/v2.1.cp03/hpgl_routines.so, not found (try using -rpath or -rpath-link)
  ld: warning: libifcoremt.so.5, needed by /rxe/source/shlib/v21_cp03/v2.1.cp03/hpgl_routines.so, not found (try using -rpath or -rpath-link)
  ld: warning: libimf.so, needed by /rxe/source/shlib/v21_cp03/v2.1.cp03/hpgl_routines.so, not found (try using -rpath or -rpath-link)
  ld: warning: libsvml.so, needed by /rxe/source/shlib/v21_cp03/v2.1.cp03/hpgl_routines.so, not found (try using -rpath or -rpath-link)
  ld: warning: libintlc.so.5, needed by /rxe/source/shlib/v21_cp03/v2.1.cp03/hpgl_routines.so, not found (try using -rpath or -rpath-link)

The Makefile for the contempt28:

FC=/opt/intel/bin/ifort
FFLAGS=-debug -O3
SHLIB=/rxe/source/shlib/v21_cp03/v2.1.cp03
OBJS=contempt28_tu.o inp_routines.o ftb_routines.o con_try.o drxe1.o hx1.o spray1.o local_lib.o
FFLAGS=-debug -align dcommons -real-size 64 -warn nouncalled -warn nousage

Build-Order: contempt28_tu.o inp_routines.o ftb_routines.o \
        con_try.o drxe1.o hx1.o spray1.o local_lib.o  \
        $(SHLIB)/hpgl_routines.so contempt28

contempt28: $(OBJS) ${SHLIB}/hpgl_routines.so
        $(FC) $(FFLAGS) -rpath-link -o contempt28 $(OBJS) -L$(SHLIB)/hpgl_routines.so

contempt28_tu.o : contempt28_tu.f
        $(FC) $(FFLAGS) -c contempt28_tu.f

inp_routines.o : inp_routines.f
        $(FC) $(FFLAGS) -c inp_routines.f

ftb_routines.o : ftb_routines.f
        $(FC) $(FFLAGS) -c ftb_routines.f

con_try.o: con_try.f
        $(FC) $(FFLAGS) -c con_try.f

drxe1.o : drxe1.f
        $(FC) $(FFLAGS) -c drxe1.f

hx1.o : hx1.f
        $(FC) $(FFLAGS) -c hx1.f

spray1.o : spray1.f
        $(FC) $(FFLAGS) -c spray1.f

local_lib.o : local_lib.f
        $(FC) $(FFLAGS) -c local_lib.f

The Makefile for the shared library

FC=/opt/intel/bin/ifort
CC=/opt/intel/bin/icc
CFLAGS=-g -shared -fPIC
FFLAGS=-debug -shared -fPIC -align dcommons -real-size 64 -warn nousage

SHLIB_UTIL: interfaces.so hpgl_routines.so system.so datey2k.so

interfaces.so : interfaces.c
 $(CC) $(CFLAGS) -o interfaces.so interfaces.c

hpgl_routines.so : hpgl_routines.f
 $(FC) $(FFLAGS) -o hpgl_routines.so hpgl_routines.f

system.so : system.f
 $(FC) $(FFLAGS) -o system.so system.f

datey2k.so : datey2k.f
 $(FC) $(FFLAGS) -o datey2k.so datey2k.f

 

abstract class and interface problem

$
0
0

i test abstrat class an abstract interface ,ihave a problem..

how can use  abstract interface ?,i have a example,i compile it ,but it can;t run!

following is my code ,please correct my error,thank you !

 

!*------------------------------------------module employee_class ------------------*

module employee_class

type,abstract,public :: employee
  private
  character(len = 30) :: first_name
  character(len = 30) :: last_name
  character(len = 11) :: ssn
  real :: pay = 0
contains
   procedure,public :: set_employee =>set_employee_sub
   procedure,public :: set_name =>set_name_sub
   procedure,public :: set_ssn =>set_ssn_sub
   procedure,public :: set_pay =>set_pay_sub
   procedure,public :: get_first_name =>get_first_name_fn
   procedure,public :: get_last_name =>get_last_name_fn
   procedure,public :: get_ssn =>get_ssn_fn
   procedure,public :: get_pay =>get_pay_fn

   procedure(calc_payx),public,nopass,deferred :: calc_pay 

end type employee

abstract interface 
real function calc_payx(hours,rate)
   implicit none
   real,intent(in) :: hours
   real,intent(in) :: rate

end function calc_payx

!real function calc_payy(salary)
!   implicit none
!   real,intent(in) :: salary
!
!
!end function calc_payy
end interface

private :: set_employee_sub,set_name_sub,set_ssn_sub,set_pay_sub
private :: get_first_name_fn,get_last_name_fn,get_ssn_fn
private :: get_pay_fn

contains
subroutine set_employee_sub(this,first,last,ssn)
implicit none
class(employee) :: this
character(len=*) ,intent(in) :: first
character(len=*) ,intent(in) :: last
character(len=*) ,intent(in) :: ssn

this%first_name = first
this%last_name = last
this%ssn = ssn
this%pay = 0

end subroutine set_employee_sub

subroutine set_name_sub(this,first,last)
implicit none
class(employee) :: this
character(len=*),intent(in) :: first
character(len=*),intent(in) :: last

this%first_name = first
this%last_name = last

end subroutine set_name_sub

subroutine set_ssn_sub(this,ssn)
implicit none
class(employee) :: this
character(len=*),intent(in) :: ssn

this%ssn = ssn

end subroutine set_ssn_sub

subroutine set_pay_sub(this,pay)
implicit none
class(employee) :: this
real,intent(in) :: pay

this%pay = pay

end subroutine set_pay_sub

character(len = 30) function get_first_name_fn(this)
   implicit none
   class(employee) :: this
   get_first_name_fn = this%first_name
end function get_first_name_fn

character(len = 30) function get_last_name_fn(this)
   implicit none
   class(employee) :: this
   get_last_name_fn = this%last_name
end function get_last_name_fn

character(len = 11) function get_ssn_fn(this)
   implicit none
   class(employee) :: this
   get_ssn_fn = this%ssn
end function get_ssn_fn

real function get_pay_fn(this)
   implicit none
   class(employee) :: this
   get_pay_fn = this%pay
end function get_pay_fn

!real function calc_pay_fn(this,hours)
!   implicit none
!   class(employee) :: this
!   real,intent(in) :: hours
!   calc_pay_fn = 0
!end function calc_pay_fn
end module  employee_class
!*------------------------------------------module salaried_employee_class ------------------*
module salaried_employee_class
use employee_class
implicit none
type,public,extends(employee) :: salaried_employee
   private
   real :: salary = 0
   contains
   procedure,public :: set_salary => set_salary_sub
   procedure,public,nopass:: calc_payx => calc_pay
end type salaried_employee
private :: set_salary_sub,calc_payx
contains
subroutine set_salary_sub(this,salary)
implicit none
class(salaried_employee) :: this
real,intent(in) :: salary

call this%set_pay(salary)
this%salary = salary

end subroutine set_salary_sub

real function calc_pay(hours,rate)
implicit none
!class(salaried_employee) :: this
real,intent(in) :: hours
real,intent(in) :: rate

   calc_pay = hours *rate
!call this%set_pay(hours)

end function calc_pay
end module  salaried_employee_class

!*------------------------------------------module hourly_employee_class ------------------*
module hourly_employee_class
use employee_class
implicit none
type,public,extends(employee) :: hourly_employee
   private
   real :: rate = 0
   contains
   procedure,public :: set_pay_rate => set_pay_rate_sub
   procedure,public,nopass :: calc_payx => calc_pay
end type hourly_employee
private :: set_pay_rate_sub,calc_pay
contains
subroutine set_pay_rate_sub(this,rate)
implicit none
  class(hourly_employee) :: this
  real,intent(in) :: rate

this%rate = rate

end subroutine set_pay_rate_sub

real function  calc_pay(hours,rate)
implicit none
!class(hourly_employee) :: this
  real,intent(in) :: hours
  real,intent(in) :: rate
  real :: daypay

  calc_pay = hours*rate*1.5

end function calc_pay

end module  hourly_employee_class
 
program test_employee
   use hourly_employee_class
   use salaried_employee_class
   implicit none
   
   type(salaried_employee),pointer :: sal_emp
   type(hourly_employee),pointer :: hourly_emp
   integer ::istat

   allocate(sal_emp,stat = istat)

   call sal_emp%set_employee('john','jones','111-11-1111')
   call sal_emp%set_salary(3000.0)

   allocate(hourly_emp,stat = istat)
   call hourly_emp%set_employee('jane','jones','222-22-2222')
   call hourly_emp%set_pay_rate(12.50)   

   deallocate(sal_emp)
   deallocate(hourly_emp)

end program 

following is message for complier error :

employee.f90(33): error #6623: The procedure name of the INTERFACE block conflicts with a name in the encompassing scoping unit.   [CALC_PAYX]
real function calc_payx(salary)
--------------^
employee.f90: error #8322: A deferred binding is inherited by non-abstract type; It must be overridden.   [CALC_PAY]
employee.f90(191): error #7002: Error in opening the compiled module file.  Check INCLUDE paths.   [HOURLY_EMPLOYEE_CLASS]
   use hourly_employee_class
-------^
employee.f90(192): error #7002: Error in opening the compiled module file.  Check INCLUDE paths.   [SALARIED_EMPLOYEE_CLASS]
   use salaried_employee_class
-------^
employee.f90(195): error #6457: This derived type name has not been declared.   [SALARIED_EMPLOYEE]
   type(salaried_employee),pointer :: sal_emp
--------^
employee.f90(196): error #6457: This derived type name has not been declared.   [HOURLY_EMPLOYEE]
   type(hourly_employee),pointer :: hourly_emp
--------^
employee.f90(199): error #6404: This name does not have a type, and must have an explicit type.   [SAL_EMP]
   allocate(sal_emp,stat = istat)
------------^
employee.f90(201): error #6460: This is not a field name that is defined in the encompassing structure.   [SET_EMPLOYEE]
   call sal_emp%set_employee('john','jones','111-11-1111')
----------------^
employee.f90(202): error #6460: This is not a field name that is defined in the encompassing structure.   [SET_SALARY]
   call sal_emp%set_salary(3000.0)
----------------^
employee.f90(204): error #6404: This name does not have a type, and must have an explicit type.   [HOURLY_EMP]
   allocate(hourly_emp,stat = istat)
------------^
employee.f90(206): error #6460: This is not a field name that is defined in the encompassing structure.   [SET_PAY_RATE]
   call hourly_emp%set_pay_rate(12.50)
-------------------^
compilation aborted for employee.f90 (code 1)

 

 

Threadprivate allocatable performance issues

$
0
0

Hello,

I have a parrallel part of a code which uses a THREADPRIVATE ALLOCATABLE array of a derived type which, in turns, contains other ALLOCATABLE variables:

MODULE MYMOD
TYPE OBJ
  REAL, DIMENSION(:), ALLOCATABLE :: foo1
  REAL, DIMENSION(:), ALLOCATABLE :: foo2
END TYPE

TYPE(OBJ), DIMENSION(:), ALLOCATABLE ::  priv

TYPE(OBJ), DIMENSION(:), ALLOCATABLE ::  shared

!$OMP THREADPRIVATE(priv)

END MODULE

The variable "priv" is used by each thread as buffer for heavy calculations and is then copied on a shared variable.

MODULE MOD2

SUBROUTINE DOSTUFF()

!$OMP PARALLEL PRIVATE(i,n,dim)

CALL ALLOCATESTUFF()

CALL HEAVYSTUFF()

CALL COPYSUFFONSHARED()

!$OMP END PARALLEL

END SUBROUTINE DOSTUFF

SUBROUTINE ALLOCATESTUFF()
USE MYMOD, ONLY : priv

ALLOCATE(priv(n))
DO i=1,i
  ALLOCATE(priv(i)%foo1(dim))
  ALLOCATE(priv(i)%foo2(dim))
ENDDO

END SUBROUTINE ALLOCATESTUFF

SUBROUTINE COPYSTUFFONSHARED()
USE MYMOD
...
END SUBROUTINE COPYSTUFFONSHARED

SUBROUTINE HEAVYSTUFF()
USE MYMOD, ONLY : priv
...
END SUBROUTINE HEAVYSTUFF

END MODULE

I'm running this code on a machine with two CPUs, each one with 10 cores, and I'm experiencing a strong loss of performance when passing the limit of 10 threads: basically, the codes scales linearly up to 10 threads, and then the slope is strongly reduced after this barrier. I obtain a very similar behavior on a machine with 8 CPUs, each one with 4 cores but this time the loss is around 5/6 threads.

As order of magnitude "n" of priv is small (less than 10), whereas "dim" for each "foo" is of the order of some milions. 

What I guess from this behavior is that there's a sort of bottleneck in accessing the memory because of the connection between the CPUs. The strange behavior is that if I mesure separately the time required for doing HEAVYSTUFF and COPYSTUFFONSHARED, it is HEAVYSTUFF that slowes down, whereas COPYSTUFFONSHARED has an "almost linear" speed-up.

The question is: am I assured that the memory in a THREADPRIVATE derived type will be actually allocated locally on the CPU to which the thread belongs? If so, what else can be the explanation of this behavior? Otherwise, how can I force data locality?

Thank you

 

Issues with model after linking intel MKL libraries

$
0
0

I have developed  a model for application in marine biogeochemistry and have recently undertaken a task of converting some linear systems of equations solvers I wrote to using the built in MKL libraries.  This stems from moving from a 2X2 system (easy to solve) to a 4x4 system (harder to solve) and figuring that the MKL from intel would be more efficient.  After successfully linking the libraries in the makefile and compiling the code, the model began to blow up very rapidly without making any changes to the code itself.  My intuition is that by linking the MKL libraries, something changed in how certain matrices are being multipled/ divided.  I have no idea where to begin to look, or how just by linking these libraries at compilation time it would cause such a huge change in the model solution.  I have pasted the compiler line below, and I can fill in details as need be. 

 

Any information is much appreciated!
p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #5330e1}
span.s1 {color: #34bbc7}
span.s2 {color: #000000}

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo}

MKLLIB = -L/opt/intel/mkl/lib/intel64

MKLINC = -I/opt/intel/mkl/include/intel64/ilp64 -I/opt/intel/mkl/include

 

LIBS  = $(CLIB)  $(PARLIB) $(IOLIBS) $(MPILIB)  -L/opt/intel/mkl/lib/intel64/libmkl_blas95_ilp64.a -L/opt/intel/mkl/lib/intel64/libmkl_lapack95_ilp64.a $(MKLLIB) -lmkl_intel_ilp64 -lmkl_intel_thread -lmkl_core -liomp5 -lpthread -lm -ldl

 

INCS  = $(IOINCS) $(MKLINC)

p.p1 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #5330e1}
p.p2 {margin: 0.0px 0.0px 0.0px 0.0px; font: 11.0px Menlo; color: #34bbc7}
span.s1 {color: #34bbc7}
span.s2 {color: #000000}

File corrupted when writing unformatted binary

$
0
0

Hi,

I'm using ifort, and experiencing the file corruption when writing an unformatted binary.

ifort -V prints out "Intel(R) Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 17.0.4.196 Build 20170411"

Here is simple test code..

program test

real*8 :: array(20000)

array = 0d0

open(11,file='test.bin',form='unformatted')

write(11) 'string'
write(11) array

close(11)

end

 

compiling this code with compiler flag -convert big_endian and executing the program generates 'test.bin' unformatted binary file.

However, this output file seems to be corrupted.

When removing "write(11) 'string'" line in the code, the file is not corrupted.

When I compile the test code with lower version of ifort, the file is not corrupted.

Is it a compiler bug of this version of ifort, or is there any compiler flag I missed?


strange behavior while copying an array

$
0
0

Hi,

I'm experiencing strange behavior of the program while copying an array.

I made a simple test code to reproduce it.

program test

integer :: ni, nj, nk
integer, allocatable :: id(:)
real*8, allocatable :: a(:,:,:), b(:,:,:)

ni = 50
nj = 50
nk = 1

allocate(a(ni,nj,nk))
allocate(b(ni,nj,nk))
allocate(id(nk))

a = 1d0

do n = 1, nk
   id(n) = nk+1-n
enddo

call copy(a,b)

print*, sum(a), sum(b)

contains

subroutine copy(aa,bb)

real*8, intent(in)  :: aa(ni,nj,nk)
real*8, intent(out) :: bb(ni,nj,nk)

do n = 1, nk
   bb(:,:,id(n)) = aa(:,:,n)
enddo

end subroutine copy

end program test

I think the program should print out the sum value of 2500 for both array a and b.

However, the program prints out 2500 for array a, but 1250 for array b.

In this test, I used intel fortran compiler 2017 initial release.

Could you give me an advice for this problem?, or is there anything I'm doing wrong?

Thanks,

Help Intel Compiler TERRAIN and MM5 modules Oracle Linux

$
0
0

I recently moved from RocksCluster 6.2 with CentOS X86_64 machine -> Oracle Linux OS 7.3.

In RocksCluster compile correctly WRF and MM5 model code, practically without modifications in the makefiles.

Now, on Oracle Linux system I am having problems in TERRAIN and MM5 modules. I can´t understand what has changed in the machine (system level) so I don´t compile now.

a) TERRAIN makefile:

NCARG_ROOT = /export/apps/libraries/ncl
INTEL_LIB = /export/apps/libraries/intel/lib/intel64
NCARGRAPHICS = NONCARG

intel:
	echo "Compiling for Linux using INTEL compiler"
	( $(CD) src ; $(MAKE) all				\"RM		= $(RM)""RM_LIST	= $(RM_LIST)"	\"LN		= $(LN)""MACH		= SGI"		\"MAKE		= $(MAKE)""CPP		= /lib/cpp"	\"CPPFLAGS	= -I. -C -traditional -D$(NCARGRAPHICS) "	\"FC		= ifort  ""FCFLAGS	= -I. -fpp -convert big_endian "\"LDOPTIONS	= -shared-intel” 		"CFLAGS		= -I."		\"LOCAL_LIBRARIES= -L$(NCARG_ROOT)/lib -L/usr/lib64 -lcairo -L$(INTEL_LIB) -L/usr/X11R6/lib -lncarg -lncarg_gks -lncarg_c -lX11 -L/usr/lib/gcc/x86_64-redhat-linux/4.8.5 -lg2c" ) ; \
		( $(RM) terrain.exe ; $(LN) src/terrain.exe . ) ;

 

make intel end ->

ld: cannot find -cairo
ld: cannot find -lX11
ld: cannot fin -lg2c
make[1]: [terrain.exe] Error 1 (ignored)

 

b) MM5 configure.user:

#-----------------------------------------------------------------------------
#   7g2. Linux PCs.  Need INTEL and MPICH.
#-----------------------------------------------------------------------------
RUNTIME_SYSTEM = "linux"
MPP_TARGET=$(RUNTIME_SYSTEM)
### edit the following definition for your system
LINUX_MPIHOME = /export/apps/libraries/mpich
MFC = $(LINUX_MPIHOME)/bin/mpif77
MCC = $(LINUX_MPIHOME)/bin/mpicc
MLD = $(LINUX_MPIHOME)/bin/mpif77
FCFLAGS = -O2 -fpp -convert big_endian -pc32
LDOPTIONS = -O2 -convert big_endian -pc32
LOCAL_LIBRARIES = -L$(LINUX_MPIHOME)/lib -lfmpich -lmpich
MAKE = make -i -r
AWK = awk
SED = sed
CAT = cat
CUT = cut
EXPAND = /usr/bin/expand
M4 = m4
CPP = /lib/cpp -C -P -traditional
CPPFLAGS = -traditional -DMPI -Dlinux
CFLAGS = -DMPI -I/usr/local/mpi/include
ARCH_OBJS =  milliclock.o
IWORDSIZE = 4
RWORDSIZE = 4
LWORDSIZE = 4

 

make mpp end ->

.tmpobjs:1: *** missing separator. Stop.

My version of Intel compiler fortran is 17.0.4. gcc version 4.8.5. mpich 3.2.

 

Bogus run-time error with "-check all": A pointer with the CONTIGUOUS attributes is being made to a non-contiguous target

$
0
0

Dear Intel team,

I have recently tried the beta release of ifort 18 for Linux, and found one problem (which seems to be a regression wrt ifort 17). Please consider this short test case:

program fpm

   implicit none

   type t
      integer, dimension(:), contiguous , pointer :: list
   end type

   integer, dimension(:), contiguous, pointer :: l
   type(t), pointer :: n

   open(unit=99, file='xxx.dat')
   close (unit=99)

   allocate(n)

   n%list => null()

   l => n%list
end

Compiling this with "ifort -check all" (using version 18 beta) works fine, but when executing the generated binary, I see the following error:

forrtl: severe (408): fort: (32): A pointer with the CONTIGUOUS attributes is being made to a non-contiguous target.

This is obviously not very helpful. It should be legal to assign a contiguous pointer to NULL. There is no error with ifort 17. Interestingly the error goes away when removing the file operations (open/close), which are completely unrelated to the pointer assignments. I hope this can be fixed for the final release of ifort 18 (I opened support request #03029761 for it).

Best regards,

Janus Weil

 

[0] DAPL startup(): RLIMIT_MEMLOCK too small

$
0
0

We have 2 nodes, each with 44 cores/ intel cores. If we run a MPI program, in 1 node is ok, only the second node is ok too, “but” between the two it indicates that:

mpirun -n 80 -f machines ./wrf.exe

[0] DAPL startup(): RLIMIT_MEMLOCK too small
[1] DAPL startup(): RLIMIT_MEMLOCK too small
[2] DAPL startup(): RLIMIT_MEMLOCK too small
[3] DAPL startup(): RLIMIT_MEMLOCK too small
[4] DAPL startup(): RLIMIT_MEMLOCK too small
[5] DAPL startup(): RLIMIT_MEMLOCK too small
[6] DAPL startup(): RLIMIT_MEMLOCK too small
[X] DAPL startup(): RLIMIT_MEMLOCK too small




We followed the instructions that come in this topic ->

https://software.intel.com/en-us/blogs/2014/12/16/best-known-methods-for...

They do not work for us.

Intel compiler fortran is 17.0.4. gcc version 4.8.5. mpich 3.2. Oracle Linux OS 7.3.

execute_command_line crashes on nonexisting command

$
0
0

The intrinsic 'execute_command_line' instruction (F2008) crashes on Intel Fortran for Linux 17.0.4 with segmentation fault if the command cannot be found. This is a strange behaviour. I am using the instruction to test if certain executable module can be  run based on the exitstat and cmdstat parameters, but it does not work this way with ifort.

Here is the test code:

program zzz

integer :: int_1 = 0, int_2 = 0
character(len=:), allocatable :: CMD
character(len=255) :: msg_out = "unknown"
CMD="zzz_idontexist"

call execute_command_line( CMD, wait=.TRUE., exitstat=int_1,   &
                           cmdstat=int_2 ,cmdmsg=msg_out )

print *, "Report: ", CMD, int_1, int_2, trim(msg_out)

end program zzz

Here is the output comparing it with GNU gfortran:

$ gfortran test_exec_cmd.f90
$ ./a.out
sh: 1: zzz_idontexist: not found
 Report: zzz_idontexist         127           0 unknown


$ ifort test_exec_cmd.f90
$ ./a.out
sh: 1: zzz_idontexist: not found
forrtl: severe (174): SIGSEGV, segmentation fault occurred
Image              PC                Routine            Line        Source
a.out              0000000000403144  Unknown               Unknown  Unknown
libpthread-2.19.s  00007F19EECFF330  Unknown               Unknown  Unknown
libc-2.19.so       00007F19EE9B292D  memset                Unknown  Unknown
a.out              0000000000402E92  Unknown               Unknown  Unknown
a.out              0000000000402B19  Unknown               Unknown  Unknown
a.out              000000000040299E  Unknown               Unknown  Unknown
libc-2.19.so       00007F19EE947F45  __libc_start_main     Unknown  Unknown
a.out              00000000004028A9  Unknown               Unknown  Unknown

$ ifort -v
ifort version 17.0.4

Strangely, the same code works on the Windows platform:

O:\WORK>ifort -o zzz.exe test_exec_cmd.f90
Intel(R) Visual Fortran Intel(R) 64 Compiler for applications running on Intel(R) 64, Version 17.0.1.143 Build 20161005
Copyright (C) 1985-2016 Intel Corporation.  All rights reserved.

Microsoft (R) Incremental Linker Version 14.00.24215.1
Copyright (C) Microsoft Corporation.  All rights reserved.

-out:zzz.exe
-subsystem:console
test_exec_cmd.obj

O:\WORK>zzz.exe'zzz_idontexist' is not recognized as an internal or external command,
operable program or batch file.
 Report: zzz_idontexist           1           0 unknown

O:\WORK>gfortran -o zzz.exe test_exec_cmd.f90

O:\WORK>zzz.exe'zzz_idontexist' is not recognized as an internal or external command,
operable program or batch file.
 Report: zzz_idontexist           1           0 unknown

 

IPO limits for large code

$
0
0

I am trying to use the IPO while building a fairly large Fortran program (a simulation model) that has highly modular object oriented design and includes several modules and files. The -ipo (and therefore -fast) started issuing the "Access violation or stack overflow. Please contact Intel Support for assistance." error.

The -ipoN or -ipo-separate options recommended in the "IPO for Large Programs" do not help either.

I always get errors like this:

ifort -sox -parallel -O3 -static -heap-arrays -fp-model fast=2 -ipo-separate -ipo-c -xHost -finline-functions -qopt-report=3 -qopt-report-file=zzz_ipo.txt -o MODEL.exe HEDG2_DRV.f90 HEDG2_04.o BASE_UTILS.o BASE_STRINGS.o BASE_CSV_IO.o BASE_LOGGER.o BASE_RANDOM.o
** The compiler has encountered an unexpected problem.
** Segmentation violation signal raised. **
Access violation or stack overflow. Please contact Intel Support for assistance.

fortcom: Severe: **Internal compiler error: internal abort** Please report this error along with the circumstances in which it occurred in a Software Problem Report.  Note: File and line given may not be explicit cause of this error.

ifort: error #10106: Fatal error in /home/opt/intel/compilers_and_libraries_2017.4.196/linux/bin/intel64/fortcom, terminated by segmentation violation
ifort: error #10014: problem during multi-file optimization compilation (code 1)
make: *** [MODEL.exe] Error 1

Does it seem that there are strict limits on the IPO and they have been reached by the code? I am also wondering what performance bonus could be achieved by IPO with large programs (I understand this is a difficult question, and could be different for different codes: ), from the real experience. Does it make sense to dig deeper into the option combinations at all?

c++ call fortran subroutine

$
0
0

i have code ,i use C call fortran subroutine,  i send same parameter to fortran subroutine, one of parameter is c++ struct,in the struct have a float pointer ,i want use this pointer in fortran subrountine ,how can i use?

following code is  main programe (c language) 

#include <iostream>
#include <string.h>
struct header {
int head_length;
int trace_length;
int cmpline;
int cmp;
float rx;
float ry;
float *data;
};

using namespace std;
extern "C" 
{
    void fr1_(int *,int *,char * ,header *); 
}
int main()
{
int n=10,nSq;
char szCtest[20];
struct header hd;

hd.head_length=192;
hd.trace_length = 5000;
hd.cmpline = 1000;
hd.cmp =  20;
hd.rx = 1111.0;
hd.ry = 3333.0;

hd.data = new float[hd.trace_length];

for (int i=0;i<hd.trace_length;i++) {
    hd.data[i] = i;
}

for (int i=0;i<10;i++) {
    cout <<"i:"<<hd.data[i]<<endl;
}
 strcpy(szCtest,"teststring");
fr1_(&n,&nSq,szCtest,&hd);
cout << "The square is:"<< nSq << endl;
return 0;

}

and following code is  fortran :

      subroutine fr1(n,m,cstr,hd)
      use iso_C_binding
      implicit none
      integer,intent(in)::n
      integer,intent(out)::m
      integer,intent(in)::cstr(1)
      integer::l,index

!      real,pointer ::trace_data
!     here we receive the c char string in an integer array

!     could also have used a byte array

      type header  
      integer::head_length
      integer::trace_length
      integer::cmpline
      integer::cmp
      real::rx
      real::ry
      real,pointer :: data(:)
      end type 
      type(header),intent(inout):: hd

      m = n*n

      write(6,20) (cstr(l),l=1,3)
   20 format(' cstr=',3a4)

!      ALLOCATE(trace_data)

!      trace_data=>hd%data

      write(*,*) 'head_length:',hd%head_length
      write(*,*) 'trace_length:',hd%trace_length
      write(*,*) 'cmpline:',hd%cmpline
      write(*,*) 'cmp:',hd%cmp
      write(*,*) 'rx:',hd%rx
      write(*,*) 'ry:',hd%ry

      do index = 1,9,1
         write(*,*) "trace_data :",hd%data(index)

      enddo

      write(6,*) 'done'

!      deallocate(trace_data)

      return

      end

the program run  error message is following:

i:0
i:1
i:2
i:3
i:4
i:5
i:6
i:7
i:8
i:9
 cstr=teststring
 head_length:         192
 trace_length:        5000
 cmpline:        1000
 cmp:          20
 rx:   1111.000    
 ry:   3333.000    
Segmentation fault (core dumped)

compiler set:

icc -c test.cpp 
ifort -std -nofor_main -cxxlib -fexceptions -o myprog $1 test.o

please answer my question , thank  very much!

 

 


abstract class and interface problem

$
0
0

I test abstrat class and abstract interface ,ihave a problem..

how can use  abstract interface ?,i have a example,i compile it ,but it can't run!

following is my code ,please correct my error,thank you !

 

!*------------------------------------------module employee_class ------------------*

module employee_class

type,abstract,public :: employee
  private
  character(len = 30) :: first_name
  character(len = 30) :: last_name
  character(len = 11) :: ssn
  real :: pay = 0
contains
   procedure,public :: set_employee =>set_employee_sub
   procedure,public :: set_name =>set_name_sub
   procedure,public :: set_ssn =>set_ssn_sub
   procedure,public :: set_pay =>set_pay_sub
   procedure,public :: get_first_name =>get_first_name_fn
   procedure,public :: get_last_name =>get_last_name_fn
   procedure,public :: get_ssn =>get_ssn_fn
   procedure,public :: get_pay =>get_pay_fn

   procedure(calc_payx),public,nopass,deferred :: calc_pay 

end type employee

abstract interface 
real function calc_payx(hours,rate)
   implicit none
   real,intent(in) :: hours
   real,intent(in) :: rate

end function calc_payx

!real function calc_payy(salary)
!   implicit none
!   real,intent(in) :: salary
!
!
!end function calc_payy
end interface

private :: set_employee_sub,set_name_sub,set_ssn_sub,set_pay_sub
private :: get_first_name_fn,get_last_name_fn,get_ssn_fn
private :: get_pay_fn

contains
subroutine set_employee_sub(this,first,last,ssn)
implicit none
class(employee) :: this
character(len=*) ,intent(in) :: first
character(len=*) ,intent(in) :: last
character(len=*) ,intent(in) :: ssn

this%first_name = first
this%last_name = last
this%ssn = ssn
this%pay = 0

end subroutine set_employee_sub

subroutine set_name_sub(this,first,last)
implicit none
class(employee) :: this
character(len=*),intent(in) :: first
character(len=*),intent(in) :: last

this%first_name = first
this%last_name = last

end subroutine set_name_sub

subroutine set_ssn_sub(this,ssn)
implicit none
class(employee) :: this
character(len=*),intent(in) :: ssn

this%ssn = ssn

end subroutine set_ssn_sub

subroutine set_pay_sub(this,pay)
implicit none
class(employee) :: this
real,intent(in) :: pay

this%pay = pay

end subroutine set_pay_sub

character(len = 30) function get_first_name_fn(this)
   implicit none
   class(employee) :: this
   get_first_name_fn = this%first_name
end function get_first_name_fn

character(len = 30) function get_last_name_fn(this)
   implicit none
   class(employee) :: this
   get_last_name_fn = this%last_name
end function get_last_name_fn

character(len = 11) function get_ssn_fn(this)
   implicit none
   class(employee) :: this
   get_ssn_fn = this%ssn
end function get_ssn_fn

real function get_pay_fn(this)
   implicit none
   class(employee) :: this
   get_pay_fn = this%pay
end function get_pay_fn

!real function calc_pay_fn(this,hours)
!   implicit none
!   class(employee) :: this
!   real,intent(in) :: hours
!   calc_pay_fn = 0
!end function calc_pay_fn
end module  employee_class
!*------------------------------------------module salaried_employee_class ------------------*
module salaried_employee_class
use employee_class
implicit none
type,public,extends(employee) :: salaried_employee
   private
   real :: salary = 0
   contains
   procedure,public :: set_salary => set_salary_sub
   procedure,public,nopass:: calc_payx => calc_pay
end type salaried_employee
private :: set_salary_sub,calc_payx
contains
subroutine set_salary_sub(this,salary)
implicit none
class(salaried_employee) :: this
real,intent(in) :: salary

call this%set_pay(salary)
this%salary = salary

end subroutine set_salary_sub

real function calc_pay(hours,rate)
implicit none
!class(salaried_employee) :: this
real,intent(in) :: hours
real,intent(in) :: rate

   calc_pay = hours *rate
!call this%set_pay(hours)

end function calc_pay
end module  salaried_employee_class

!*------------------------------------------module hourly_employee_class ------------------*
module hourly_employee_class
use employee_class
implicit none
type,public,extends(employee) :: hourly_employee
   private
   real :: rate = 0
   contains
   procedure,public :: set_pay_rate => set_pay_rate_sub
   procedure,public,nopass :: calc_payx => calc_pay
end type hourly_employee
private :: set_pay_rate_sub,calc_pay
contains
subroutine set_pay_rate_sub(this,rate)
implicit none
  class(hourly_employee) :: this
  real,intent(in) :: rate

this%rate = rate

end subroutine set_pay_rate_sub

real function  calc_pay(hours,rate)
implicit none
!class(hourly_employee) :: this
  real,intent(in) :: hours
  real,intent(in) :: rate
  real :: daypay

  calc_pay = hours*rate*1.5

end function calc_pay

end module  hourly_employee_class
 
program test_employee
   use hourly_employee_class
   use salaried_employee_class
   implicit none
   
   type(salaried_employee),pointer :: sal_emp
   type(hourly_employee),pointer :: hourly_emp
   integer ::istat

   allocate(sal_emp,stat = istat)

   call sal_emp%set_employee('john','jones','111-11-1111')
   call sal_emp%set_salary(3000.0)

   allocate(hourly_emp,stat = istat)
   call hourly_emp%set_employee('jane','jones','222-22-2222')
   call hourly_emp%set_pay_rate(12.50)   

   deallocate(sal_emp)
   deallocate(hourly_emp)

end program 

following is message for complier error :

employee.f90(33): error #6623: The procedure name of the INTERFACE block conflicts with a name in the encompassing scoping unit.   [CALC_PAYX]
real function calc_payx(salary)
--------------^
employee.f90: error #8322: A deferred binding is inherited by non-abstract type; It must be overridden.   [CALC_PAY]
employee.f90(191): error #7002: Error in opening the compiled module file.  Check INCLUDE paths.   [HOURLY_EMPLOYEE_CLASS]
   use hourly_employee_class
-------^
employee.f90(192): error #7002: Error in opening the compiled module file.  Check INCLUDE paths.   [SALARIED_EMPLOYEE_CLASS]
   use salaried_employee_class
-------^
employee.f90(195): error #6457: This derived type name has not been declared.   [SALARIED_EMPLOYEE]
   type(salaried_employee),pointer :: sal_emp
--------^
employee.f90(196): error #6457: This derived type name has not been declared.   [HOURLY_EMPLOYEE]
   type(hourly_employee),pointer :: hourly_emp
--------^
employee.f90(199): error #6404: This name does not have a type, and must have an explicit type.   [SAL_EMP]
   allocate(sal_emp,stat = istat)
------------^
employee.f90(201): error #6460: This is not a field name that is defined in the encompassing structure.   [SET_EMPLOYEE]
   call sal_emp%set_employee('john','jones','111-11-1111')
----------------^
employee.f90(202): error #6460: This is not a field name that is defined in the encompassing structure.   [SET_SALARY]
   call sal_emp%set_salary(3000.0)
----------------^
employee.f90(204): error #6404: This name does not have a type, and must have an explicit type.   [HOURLY_EMP]
   allocate(hourly_emp,stat = istat)
------------^
employee.f90(206): error #6460: This is not a field name that is defined in the encompassing structure.   [SET_PAY_RATE]
   call hourly_emp%set_pay_rate(12.50)
-------------------^
compilation aborted for employee.f90 (code 1)

 

 

Intel® Parallel Studio XE 2018 has been released!

$
0
0

Intel® Parallel Studio XE 2018, including Intel® Fortran Compiler 18.0, is now available from the Intel Registration Center. Release notes can be found here.

The Intel® Fortran Compiler now supports all features from the Fortran 2008 standard. Additional Fortran 2008 features added in the Intel® Fortran 18.0 release are noted below:
 

  • COMPILER_OPTIONS and COMPILER_VERSION in ISO_FORTRAN_ENV
  • COMPLEX arguments to trigonometric and hyperbolic intrinsic functions
  • FINDLOC intrinsic function
  • Optional argument BACK in MAXLOC and MINLOC intrinsic functions
  • Multiple type-bound procedures in a PROCEDURE list
  • Passing a non-pointer data item to a pointer dummy argument
  • Polymorphic assignment with allocatable Left Hand Side (LHS)
  • Allocatable components of recursive type and forward reference
  • Data statement restrictions removed

Language features for task reductions from the OpenMP* Technical Report 4: Version 5.0 Preview 1 specifications are now supported.

Please see the release notes for more details.

-init=arrays segmentation fault

$
0
0

When compiling my code in debug mode, with -init=snan -init=zero -init=arrays (as advised by https://software.intel.com/en-us/articles/checking-for-unitialized-varia...) I get a segmentation fault when allocating a 'large' array (2GB) in size.

  • ulimit -s unlimited before running so that is not the problem
  • ifort (IFORT) 17.0.4 20170411
  • -init=snan -init=zero pose no problem, except when combined with -init=arrays
  • Allocating integer arrays of 5*10^8 elements (~2GB @ 4 bytes per int)
  • 536870912 is the first failing size (2^29 exactly)
  • Problem occurs on new SKL nodes with 192 GB total ram, BDW nodes

Reproduce with:

program test
  integer, dimension(:), allocatable :: x
  allocate(x(66893*8192))
end program test
ifort -O0 -g -traceback -ftrapuv -debug all -debug-parameters -align -warn all -check all,bounds,uninit -init=snan -init=zero -init=arrays -o alloc alloc.f90

 

Does -check uninit catch every use of an uninitialised array element? Because then I might not need -init=arrays at all.

how can i use pointer like C pointer?

$
0
0

i have a think ,i hope use pointer like C ,following is c code:

.........
char * data;
int *iptr;
float* fptr;
double * dbptr;

data = new char[100*4];
iptr = (int *)&data[0];
fptr = (float *)&data[0];
dbptr = (double *)&data[0];

i not't kown how can code this use fortran pointer?

please tell me answer, thanks.

Threadprivate variables in equivalence statements

$
0
0

Hello,

I just upgraded to Intel Fortran Compiler which comes with Parallel Studio XE 2018 (Initial Release). This version of ifort no longer compiles this piece of code:

      SUBROUTINE MOO
      COMMON /BLOCK/ FOO
!$OMP THREADPRIVATE (/BLOCK/)
      REAL BAR
      EQUIVALENCE ( FOO, BAR )
      RETURN
      END

$ ifort --version

ifort (IFORT) 18.0.0 20170811
Copyright (C) 1985-2017 Intel Corporation.  All rights reserved.
 

$ ifort -qopenmp -o foo -c foo.f

foo.f(2): error #7903: A variable in a THREADPRIVATE directive must not be an element of a common block or be declared in an equivalence statement.   [FOO]
     COMMON /BLOCK/ FOO  
---------------------^
compilation aborted for foo.f (code 1)
 

Now I realize that use of threadprivate variables in equivalence statements is forbidden by the OpenMP standard. It is also true that gfortran also does not compile this piece of code. However, ifort versions 17.0.4 and before did compile the above fine so it appears that ifort has gotten more strict when it comes to enforcing the standard. So apparently the only way forward is to fix the code.

But given that the real code which shows this problem in our application was written by a third party and is enormous, where the interleaving of threadprivate and equivalenced variables runs very deep this option is not really feasible, so here comes my question:

Is there a flag for ifort which makes the compiler accept the above piece of code, or is there really no way around fixing the code?

Cheers, Bastian

Viewing all 2746 articles
Browse latest View live


<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>