Quantcast
Channel: Intel® Software - Intel® Visual Fortran Compiler for Windows*
Viewing all 5691 articles
Browse latest View live

Memory leak in FORTRAN format with variable string length

$
0
0

Hi,

I am experiencing a memory leak of ~1MB in a subroutine if I am using the following write like statement inside:

    write(*,10)(line(j),j=1,var)
10  format(1x,<var>a1)

where var is variable computed at runtime. Is this a known issue?

I am using ifort 13.1.3.198 Build 20130607 under Windows.

Rak


attempt to compare Qparallel vs. Qopenmp compilation (15.0.2)

$
0
0

I thought I remembered that it used to be possible to compile an OpenMP source file with /Qparallel, omitting /Qopenmp.   Now I get an immediate ICE when I try it.  I don't recall seeing any advice about new procedures needed, e.g. to prevent the compiler from seeing OpenMP specific stuff.

I would have kept quiet here and simply submitted it to premier.intel.com if that site were accepting submissions.

Optional OpenMP-Directives

$
0
0

Hi

I want to put OpenMP-directives and OpenACC-directives in one program.

In the OpenACC-program some OpenMP-directives shall be ignored (when there is an equivalent OpenACC-directive) but others shall be used (when the code has to run on CPU)

In the non-OpenAcc-program all OpenMP-directives shall be used.

I tried to opt out OpenMP by a define. The following example is minimalist:

#ifndef _OPENACC
#define MYOMP !$OMP
#else
#define MYOMP C
#endif
      PROGRAM MAIN
      OPTION EXPLICIT
      INTEGER a(1000),i

MYOMP PARALLEL DO
      DO I=1,1000
        a(i) = 0
      END DO
MYOMP END PARALLEL DO
      END
Compile with ifort 15 on Windows: ifort test.for /openmp /fpp

The compiler/preprocessor removes the !$OMP-directive. Obviously its treats as a comment.
Any Advice?
Benedikt

Output of compiler:
Intel(R) Visual Fortran Compiler XE for applications running on IA-32, Version 15.0.0.108 Build 20140726
Copyright (C) 1985-2014 Intel Corporation.  All rights reserved.

test.for(10): error #5082: Syntax error, found END-OF-STATEMENT when expecting one of: ( % [ : . = =>
      PARALLEL DO
-----------------^
test.for(14): error #5082: Syntax error, found IDENTIFIER 'PARALLELDO' when expecting one of: <END-OF-STATEMENT> ; BLOCK PROGRAM BLOCKDATA MODULE TYPE FUNCTION SUBROUTINE ...
      END PARALLEL DO
----------^
test.for(14): error #8731: An END BLOCK occurred without a corresponding BLOCK statement.
      END PARALLEL DO
------^
test.for(10): error #6218: This statement is positioned incorrectly and/or has syntax errors.
      PARALLEL DO
-----------------^
compilation aborted for test.for (code 1)

 

Support for passing internal procedures fails in parallel environment (not thread safe)

$
0
0

Fortran 2008 allows passing internal procedures as actual arguments and Intel Fortran supports this. A passed internal procedure can see host data so it makes it easier to write generic functions like a function integrator. In this test the host data is an element of an allocatable array. I passed the host data to my function integrator so that I could compare to see if it was the same data that could be seen by host association.

The test shows the data often does not match when using OpenMP. Try a break point on the continue statement.

Also note the access violation at the end which I don't understand.

module someFairlyOrdinaryCode
   implicit none
   contains

subroutine integrator(k, answer)
   use omp_lib
   real, intent(in) :: k
   real, intent(out) :: answer
  
   !Normally host association would be used to obtain additional data required by f(x)
   !Passing k for test purposes
   call integrateAnyFunction(f, k, 0.0, 1.0, answer)
  
contains
   real function f(x, kPassedValue)
      real, intent(in) :: x, kPassedValue
        
      !k is not visible in debugger so copy to local
      real hostK
      hostK = k
        
      !Put break point on continue
      if (hostK /= kPassedValue) then
         continue
      end if
      f = k*x
   end function
end subroutine

subroutine integrateAnyFunction(f, k, a, b, answer)
   interface
      real function f(x, k)
         real, intent(in) :: x, k
      end function
   end interface
   real, intent(in) :: a, b, k
   real, intent(out) :: answer
  
   real h, x1, x2
   integer i
   answer = 0.0
   h = (b - a)/9
   do i = 1, 10
      x1 = a + h*(i-1)
      x2 = x1 + h
      answer = answer + (f(x1, k) + f(x2, k))*h/2
   end do
end subroutine

end module

program TestOpenMPThatTookAYearToFind
   use ifport
   use someFairlyOrdinaryCode
   integer numTimes
   real, allocatable :: k(:), answer(:)
   integer i, j

   do j = 1, 2000
      numTimes = int(rand(0)*20.0) + 1
      allocate(k(numTimes), answer(numTimes))
      do i = 1, numTimes
         k(i) = i
      end do
      !$OMP PARALLEL DO
      do i = 1, numTimes
         call integrator(k(i), answer(i))
      end do
      !$OMP END PARALLEL DO
      deallocate(k, answer)
   end do
end program

 

Compatibility VS2008 and IMSL7

$
0
0

Hello everybody,

I'm using intel visual fortran implemented in the visual studio software VS2008 (specifications' details are joined below). My problem is that I need some mathematical functions which are not supported by the MKL library. So I would like to have access to IMSL library.

My questions are:

1. Is VS2008 compatible with IMSL7 library?

2. If YES, how can I upload it and install it? Is it free of charge?

3. If NOT, what shall I do? Do I have to upgrade VS version?

I can provide, if necessary, my login ID or my serial code.

Thank you by advance.

*******************************************************************************

Microsoft Visual Studio 2008

Version 9.0.21022.8 RTM

Microsoft .NET Framework

Version 3.5 SP1

Installed Edition: IDE Standard

Intel(R) Visual Fortran Compiler Integration     Package ID: w_cprof_p_11.1.072

Intel(R) Visual Fortran Compiler Integration for Microsoft Visual Studio* 2008, 11.1.3471.2008, Copyright (C) 2002-2010 Intel Corporation

*******************************************************************************

Pause program to wait for external signal

$
0
0

For a fortran program are there any extensions (or even possible with Fortran standard) that can pause a program during execution and wait for a signal from an external source to resume execution.

 

My assumption is that the EXECUTE_COMMAND_LINE could work for running a separate program, but I would ideally like to have two separate programs that run in parallel and pause to communicate with each other when there is a needed information exchange. I could do binary files that one program waits for the other to update, but is there any way to send an electronic signal or even pass arrays within memory (RAM) or does that only work with subordinate programs compiled as dll?

Unresolved externals

$
0
0

I'm using the 30-day trial of the Intel Visual Studio 2015 with C++ and FORTRAN compilers. I'm evaluating for purchase and need some help please.

When trying to build a simple mixed language project with a C++ main calling a FORTRAN subroutine I get LNK2019, unresolved external symbol for "_sqrtf in function _G6".  The code is as follows:

--- C++ code ---

#included <cstdlib>

extern "C" void _cdecl G6();

using namespace std;

int main( void )

{

    G6();

    return 0;

}

--- FORTRAN code ---

       SUBROUTINE G6

       IMPLICIT NONE

       REAL SUM

       REAL ROOTSUM

       SUM = 1 + 2.5

       ROOTSUM = SQRT(SUM)

       END

---------------------------------------------

The FORTRAN code is compiled as a static library and linked into the C++ project.

Relevant information:

1. When compiled as a Release version the code compiles and executes properly.  When compiled as a Debug version the unresolved error occurs.

2. I think I'm linking in the Intel libraries correctly in the project settings - the ones in the compiler\lib\ia32 and intel64 directories.

3. The above applies to a 32 bit project.  When I switch to a 64 bit project I get error #10310: "Failed to enable trusted storage check for licensing."  I will also need to correct this because we will need to compile 64 bit code.  If possible, please let me know how to resolve this when responding to the above problem - If necessary I can make this a separate question.

Thanks

Ken W.

 

Can't access GetMenuInfo function from USER32.f90

$
0
0

 

I'm using Intel Visual Fortran 2013, with MSVS 2010.  I want to access the GetMenuInfo function which is in the USER32.f90 library.

However I'm not able to access this function.   I've tried to create a minimal test case:

 

SUBROUTINE updatemenu(hWnd)
  USE IFWINTY
  USE USER32
IMPLICIT NONE
  INTEGER(HANDLE)  :: hWnd
  INTEGER(HANDLE)  :: ghMenu
  INTEGER(HANDLE)  :: submenu
  INTEGER(DWORD)   :: ignor
  TYPE(T_MENUINFO) :: minfo

  ghMenu  = GetMenu(hWnd)
  submenu = GetSubMenu(ghMenu, 1)
  ignor   = getMenuInfo(submenu, minfo)
     
END SUBROUTINE updatemenu

 

When I attempt to compile this, I get the following error:

error #6404: This name does not have a type, and must have an explicit type.   [GETMENUINFO]

What's going on here?

 

Thanks


Random reading of an unformatted file?

$
0
0

Hi All,

I have a large file of geographic information created thus:

open(1,file=trim(shapefile),status='replace',form='unformatted',iostat=ios, &
   err=1000,recl=128,recordtype='stream')

I read the whole file and display its information on screen. The user clicks somewhere on screen and from that I know I have to re-sample a small part of the file starting at some byte N. Is there some Fortran way I can get at that byte number immediately without having to start from the beginning of the file?

Many thanks

Mike

 

Is this is bug? Error: Invalid signal or error

$
0
0

Program Test
    implicit none
  INTEGER, PARAMETER :: dble = SELECTED_REAL_KIND(P=10,R=50)
  INTEGER, PARAMETER :: sngl = SELECTED_REAL_KIND(P=5)
  REAL (KIND = dble), ALLOCATABLE, DIMENSION(:), TARGET  ::  wk3 , wk10,rsb0
  REAL (KIND = dble), DIMENSION(:), POINTER :: cpmu,rhocp,rsn
   INTEGER  err
   INTEGER  mswk10,mswk3,mst,ncomp,mstart
   integer m221,mrrb,msn,m
    REAL (KIND=dble)::result11

      mswk10=20352600
      mswk3=70480200
      mst=6784000
      ncomp=2
      mstart=1
     ALLOCATE(wk10(mswk10),wk3 (mswk3 ), STAT = err )
     ALLOCATE (rsb0(mst*ncomp), STAT = err )
    
       rhocp    => wk10(1:mst) 
       cpmu     => wk3(1:mst) 
       rsn      => rsb0( mstart:mst*ncomp )

       m221=37
       mrrb=mst-200
       msn=0
       cpmu=10104414.9170140
       rsn=1.138435243319734D-003

       rhocp(m221:mrrb) = rhocp(m221:mrrb) + cpmu(m221:mrrb)*rsn(m221+msn:mrrb+msn)
       !DO m = m221, mrrb
       !    rhocp(m) = rhocp(m) + cpmu(m)*rsn(m+msn)
       !ENDDO
       !  DO m = m221, mrrb
       !ENDDO
       DO m = m221, mrrb
           result11 =result11+ rhocp(m)
       ENDDO
       write(*,*)result11
end program Test

 

when mst =67840 or 678400  the calculation is correct.

if  mst =678400  there was an error :Program Exception - stack overflow

But if I use gfortran compile and run, there was no error

 

AttachmentSize
DownloadSource1.f901.17 KB

Problem with an unresolved symbol _for__rtc_uninit_src

$
0
0

Hello,

for one of our program suites I keep getting a bizarre link error, which my colleagues do not experience. The message is:

error LNK2001: unresolved external symbol _for__rtc_uninit_use_src   

By the looks of it and from checking the sources (we do not have a routine of that name) I guess that this is a routine that should be in the runtime libraries. So, my question is: how can I solve this?

For your information:

  • I am using Visual Studio 2010
  • The version of the Intel Fortran compiler is Intel® Parallel Studio XE 2015 Composer Edition for Fortran Windows* Update 1 Integration for Microsoft Visual Studio* 2010, Version 15.0.0115.2010

 

 

 

ICE in select type with class(*)

$
0
0

The code below produces an internal compiler error, if the /debug:full option is enabled.

program main
  implicit none

    real :: foo(2,2)
    foo = 1.0

    call testSub(foo)

  contains

  subroutine testSub(matrix)
    class(*), intent(inout) :: matrix(:,:)  ! << This works
!    class(*), intent(inout) :: matrix(2,2)  ! << This fails
    select type(local => matrix)
      type is (real)
    end select
  end subroutine testSub

end program

 

Compiler: Intel(R) Visual Fortran Compiler XE 15.0 Update 2 for Windows

Multiple versions of fortran and MS visual studio

$
0
0

Hi,

I'm writing some fortran subroutines and linking them to a commercial code. The code is in the form of a library, and it was compiled with intel fortran  parallel studio XE 2013, with MS Visual Studio 2010.

I set up MS Visual Studio 2013 (with the added SDK) and I got an evaluation version of Intel Parallel Studio XE 2015 Composer Edition for Fortran Windows.  I got that to install and compiled the fortran files, and when I try to link everything up into an executable (using a makefile and MS incremental linker version 12.00.21005.1) ) I get the following:

LINK : Fatal error LNK1104: cannot open file 'LIBCMT.lib'

NMAKE :  Fatal error U1077:  'ifort' : return code '0x450'

I've tried tracking down the directories for the libraries and adding them to the LIB environment variable, but wound up with conflicts. The vendor of the commercial code is not inclined to re-compile with the newer versions, so I've re-installed MS Visual Studio 2010 and I want to install the 2013 version of the intel fortran compiler.

Questions:
a) is there a fix I can apply to my current set-up to resolve the library references in the older (2013) version of intel fortran (which is how the vendor-supplied code was compiled) ?

b) I'm planning to install the older version of fortran - MS visual studio 2010 and intel fortran 2013. Will the versions coexist on the same windows box?  That is, can I have the intel fortran compiler 2013 and the Microsoft visual studio 2010 linked up, and also have the intel fortran 2015 compiler and the Microsoft visual studio 2013 linked up, on the same machine?  or do I need to uninstall the newer versions before I install the older versions?

Thanks for any wisdom you can supply,

Tim

 

 

 

First Derivative

$
0
0

Hi,

I have some data (z,h) which reprents sinusoidal curve. Now, I would like to calculate first derivative dh/dz at each point (z,h).

I am using Intel Fortran Compiler with IMSL.

Can you please help me in this regard?

Cheers

Fortran source pretty printer/refactoring tool

$
0
0

When I switched to IVF/F90/F95 many years ago I used the plusFORT tool from Polyhedron to modernize the hundreds of source files in my Fortran projects saving me a lot of time and effort.Today I tried to use plusFORT again, but the program told me that my license is no longer valid. I wonder if there is free pretty printer/refactoring tool for Fortran available which might include support for the more recent standards. Any suggestions?


Mixing redistributables from multiple compiler versions on same machine

$
0
0

Hello,

I have an application that was built with Intel Fortran 14.0 and I'm trying to run it on client workstation where Intel Fortran is not installed. So I've installed Intel Fortran 14.0 redistributable package there but application doesn't work. After research with Dependency Walker I found that this workstation also have Intel Fortran 11.1 redistributables installed, and my application is trying to use the wrong library from old version.

Of course the simple solution is to uninstall 11.1 redistributables, but what if the user needs them for some other apps? Is it possible to make my application use correct libraries from new paths?

The library in question is LIBIFCOREMD.DLL

11.1 libs are here: C:\Program Files (x86)\Common Files\Intel\shared files\fortran\Bin\ia32

14.0 libs are here:  C:\Program Files (x86)\Common Files\Intel\Shared Libraries\redist\ia32\compiler

I also have 2 environment variables:

INTEL_DEV_REDIST = C:\Program Files (x86)\Common Files\Intel\Shared Libraries\
F_IA32_REDIST11 = C:\Program Files (x86)\Common Files\Intel\Shared Files\fortran\

Thank you.

Internal compiler error with nested ASSOCIATE constructs

$
0
0
program p

   implicit none

   integer :: i(1)

   asc_1: associate ( j => i )

      asc_2: associate ( k => j )

      end associate asc_2

   end associate asc_1

   stop

end program p
------ Build started: Project: p, Configuration: Debug|x64 ------

Compiling with Intel(R) Visual Fortran Compiler XE 15.0.2.179 [Intel(R) 64]...
p.f90
fortcom: Fatal: There has been an internal compiler error (C0000005).
compilation aborted for C:\..\p.f90 (code 1)

 

implicit class

$
0
0

Intel Visual Fortran falis to compile implicit class statements such as:

implicit class(foo) (a-b)
implicit class(*) (c)

gfortran had the same bug which was fixed in gfortran 4.9: https://gcc.gnu.org/bugzilla/show_bug.cgi?id=56500

Trying to compile the code from the gfortran bug report gives:

Compiling with Intel(R) Visual Fortran Compiler XE 15.0.2.179 [IA-32]...
ifort /nologo /debug:full /Od /warn:interfaces /module:"Debug\\" /object:"Debug\\" /Fd"Debug\vc120.pdb" /traceback /check:bounds /check:stack /libs:dll /threads /dbglibs /c /Qvc12 /Qlocation,link,"C:\Program Files (x86)\Microsoft Visual Studio 12.0\VC\\bin""C:\Users\Nicholas\Documents\imp_bug\implicitclass\Source1.f90"
C:\Users\Nicholas\Documents\imp_bug\implicitclass\Source1.f90(8): error #5082: Syntax error, found '(' when expecting one of: (
  implicit class(foo) (a-b)
----------------------^
C:\Users\Nicholas\Documents\imp_bug\implicitclass\Source1.f90(9): error #5082: Syntax error, found '(' when expecting one of: (
  implicit class(*) (c)
--------------------^
(trimmed)

Is this a known bug?

This usage is relevant for people trying to simulate generic programming (templates) using a combination of implict, include and renaming in use statements.

Nick

 

 

Access violation reading location 0x00000000

$
0
0

The full error i'm getting is Unhandled exception at 0x0162EF4C in MAIN.exe: 0xC0000005: Access violation reading location 0x00000000

I think this is just a symptom of an underlying problem.  I've been struggling with these types of issues off and on for many years and have never figured out for sure why they happen.

I get this error only with a release build with the following settings:

/nologo /debug:full /O3 /Qipo /fpp /I"C:\Program Files (x86)\Intel\Composer XE\mkl\include\ia32" /I"C:\Program Files (x86)\MATLAB\R2010b\extern\include" /warn:all /debug-parameters:all /fp:fast=2 /Qfp-stack-check /module:"Release\INTERMEDIATE\\" /object:"Release\INTERMEDIATE\\" /Fd"Release\INTERMEDIATE\vc110.pdb" /check:uninit /libs:static /threads /Qmkl:sequential /c

When i run the debug build the program seems to run correctly.

If i throw a simple write statement:

write(*,*) 'hello'

before the line that this error occurred on, the program will run without throwing the error.  If i change the build settings to /O2 I can get it to run but produce incorrect results.

I ran the program in inspector, and i get a critical item "Unhandled application exception" and a "Invalid memory access" on the same line, but i don't see anything obvious that points to a cause for this error.

In my experience with these issues, i've seen lots of strange behavior for example a simple assignment statement where after execution the left hand side doesn't equal the right hand side, but then if the same statement is repeated the value will "stick".

I have no c functions being called (i had thought these were the problem previously).

Has anyone else run into this before?

 

rob

Character string allocation in elemental subroutine

$
0
0

If I build and run the attached program I get

Method 1:
   {Monday   }
   {Tuesday  }
   {Wednesday}
   {Thursday }
   {Friday   }
   {Saturday }
   {Sunday   }

but I don't understand why. I'd have thought that it should be

Method 1:
   {Monday}
   {Tuesday}
   {Wednesday}
   {Thursday}
   {Friday}
   {Saturday}
   {Sunday}

which I can get by using trim(n) on line 22. Could someone please explain to me why I get the first result. Thanks.

AttachmentSize
Downloaddaytime2_f.f902.74 KB
Viewing all 5691 articles
Browse latest View live


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