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

performance when running one compiled app vs. multiple ones simultaneously

$
0
0

So, this confused the daylights out of me.

I'm running on an Intel Core i7-3770 @ 3.4 GHz, 4 cores x hyperthreaded = 8 cores.

For case 1, I compiled on ifort 2013 SP1 Update 4, as:

      <Tool Name="VFFortranCompilerTool" SuppressStartupBanner="true" MultiProcessorCompilation="true" GenAlternateCodePaths="codeForAVX" IntegerKIND="integerKIND8" RealKIND="realKIND8" LocalSavedScalarsZero="true" FloatingPointExceptionHandling="fpe0" FloatingPointModel="source" FlushDenormalResultsToZero="true" Traceback="true" />

Case 2 is not important, other than the fact that it ran and consumed CPU cycles.  It was done using 2015 Update 3.

For Case 3, I ran ifort 2015 Update 4, and I added  GenAlternateCodePaths="codeForCommonAVX512"

I ran all 3 cases at the same time on the same machine, and the run times are as follows:

Case 1 239.852 s

Case 2 267.979 s

Case 3 260.182 s

Naturally, I wonder what is wrong with the 2015 Update 4 compiler, the running time went up!  So, my first question is, why did the running time with 2015U4 go up?

Then I tried running Case 3 with nothing else running on my computer, and the running time was 198.092 seconds.  So, there is a huge improvement using this compiler?

The last test I did was to compile the same code, using 2013SP1U4, but I compiled it to have AVX2 instructions (instead of AVX512), and I also added O3.  Then I ran this in standalone, and the running time was 228.417 seconds, or about 5% faster than Case 1.

I would attribute the standalone vs. 3 simultaneous cases running speed improvement of 5% to adding O3 optimization.

However, with 2015U4, if I'm running only 1 case, the running speed is much, much faster, and if I'm running 3 simultaneously (on an 8-core CPU!) the speed is much, much slower.

-I'm seeing the same performance degradation of Case 3 vs Case 1 on Xeon E5-2699v3 and also on E5-1650 v3, but it's almost negligible on Xeon X5690.  Why is there this performance degradation when running more than one case at the same time on what seems like any newer CPUs?

-Why are the 2015U4 results so much slower when the compiled executable isn't the only thing running? 

-Or, am I the only person who has seen this?

I am tempted to use 2015U4 for the running speed I get when I run just one case ... but that means I need to buy a new CPU for each case I want to run.


Confusion re placement of INPUT files

$
0
0

When I first open a project, how do I know where to put whatever input files are needed?

Of course I could use GETCWD to find out, but is there some rule that says where that would be by default?

I used to think its where the EXE is, but apparently that is not always the case.

 

Need advice re: parallelisable code

$
0
0

I have some number-crunching code which contains the following type of nested pair of do-loops:

DO I=1,NPHASE
CP=CPHASE(I)
SP=SPHASE(I)
SUMR=0.0D+00
SUMI=0.0D+00
DO J= I,NMAX, NPHASE
SUMR=SUMR+QUANTITY(J)*CP
SUMI=SUMI+QUANTITY(J)*SP
ENDDO
TOTAL(I,1)=SUMR
TOTAL(I,2)=SUMI

As you can see, the inner loop progresses through the array QUANTITY with stride length NPHASE
each time starting at an array location set by the index of the outer loop, So the inner loop accesses a completely
different set of array values per each time the outer loop index changes. NPHASE may be 24 or 48 for example and
NMAX will be several tens of thousands and not exactly divisible by NPHASE.

Will this code be parallelised if the appropriate additional parallel directives are added?
If so,please can you suggest what directives are required, as I have never written parallel code before.

 

Specific Old Version Required

$
0
0

Hello,

I require a particular older version of Intel Fortran. I have a latest student version of Parallel Studio XE Composer 2015 and I tried to download a specific older version i.e. Intel Fortran Composer XE 2011 SP1 Update-4, however this version is not available in the drop down menu for download. Please help!

Thanks,

Aditya 

Getting error when invoking dummy function when it returns an array

$
0
0

I am trying to invoke an external function through a dummy function name. The error is:

Error    1     error #6634: The shape matching rules of actual arguments and dummy arguments have been violated.   [G]   

the code is:

Module DummyFG

contains
    function DF(DummyF, x,n)
    
      implicit none
      integer :: n
      real(kind=8) ,intent(in):: x(n)
      real(kind=8) :: DF
      real (kind=8) :: DummyF
      
      
      DF = DummyF(x,n)
    end function DF

    function DG(DummyG, x, n)
      implicit none
      integer :: n
      real(kind=8) , intent(in):: x(n)
      real(kind=8) :: dG(n)
      real (kind=8), external :: DummyG 
      dg= DummyG(x,n)
    end function DG

end Module DummyFG

!    
   function f(x,n)  !result(f1)
        implicit none
        real(kind=8) :: f
        real(kind=8) ,intent(in) :: x(n)
        integer :: n
        f=(1.0-x(1))**2+100.0*((x(2)-x(1)**2))**2;
    end function f
    
   function G(x,n)  result(g1)
        implicit none
        integer :: n        
        real(kind=8) ,intent(in) :: x(n)
        real(kind=8) :: g1(n)
        g1(1)=-2.0*(1.0-x(1))-400.0*x(1)*(x(2)-x(1)**2)
        g1(2)= 200.0*(x(2)-x(1)**2)
    end function g

The driver routine is:

 program Test
    
    implicit none
   

    ! Variables
    integer, parameter :: n=2
   real(kind=8) :: x(n)=(/2.0,1.0/)
   call check(x,n)

   contains

   subroutine check(x,n)
   use dummyfg
   implicit none

    interface
    function f(x,n)  
        implicit none
        integer :: n
        real(kind=8) :: f
        real(kind=8) ,intent(in) :: x(:)
        end function f

     function g(x,n) result(g1)
        implicit none
        integer :: n
        real(kind=8) ,intent(in) :: x(n)
        real(kind=8) :: g1(n)
     end function g
    end interface
   
   
   integer :: n
   real(kind=8) :: x(n),fc, gc(size(x))
   
  
   fc=df(f,x,n)
   gc=dg(g,x,n)

   end subroutine check

    end program Test

Any help is appreciated very much!!!

 

Intel release of IMSL Ver 7.1 ?

$
0
0

I recently found that version 7.1 of the IMSL libraries from Rogue Wave provided support for use of Nvidia GPU's,  Does anyone know when the Intel ver of IMSL 7.1 will be available and if it will support use of a GPU?  

Thanks! 

Unable to decide what to download

$
0
0

Hi and Good Day!

I have an academic serial and I am interested to download some environment where I can make fortran applications. Now when I try to download, I am given four choices of softwares i.e. MPI Library, Integrated Performance Primitives, Math Kernal Library and Thereading Building Block.

Please help me by pointing out which software to download so that I can make applications in Fortran without buying Visual Studio.

Thanks

Not getting exact output

$
0
0

 

Hi,

I am Gaurav & just started using fortran. I tried to run following code for which output should be 10.5 but instead I am getting 16.5. Why is it so? please tell

PROGRAM try

    REAL (KIND=8):: x,y,z
    x=0.5;y=0.25434678E9;z=0.25434677E9
    w=x+y-z
    PRINT*,w
    END PROGRAM try

Regards,

Gaurav K.


Want tips on Porting Fortran developed on Intel WIndows IDE to Gfortran on Linux

$
0
0

I have a straightforward 64-bit Windows console program .EXE that reads input from formatted files, crunches numbers and outputs to other formatted files. It consists of two  .F90 free-format files, one is a Fortran Module and the other contains the main program + subprogram code.
My standard of Fortran familiarity is F95. A requirement to speed it up can be met locally by porting the code to a much faster server which uses Linux and which has GFortran installed (but not Intel Linux composer - yet!).

The code uses no special directives or special functions, but it does invoke the  IFWIN module directly (for DOUBLE and DWORD) but no other special libraries or modules (AFAIK) so I hope it should port easily. I know that will have to change file names to match the Linux file naming and directory syntax, otherwise should this code therefore compile + link straightforwardly in GFortran to create a Linux executable?

Is it likely that the GFortran code will not be significantly slower than the optimised Intel Fortran-generated windows code so hopefully not compromising the hoped for increase in speed offered by the faster Linux-machine's multi-core processor?

Thanks in advance for advice on any tips re: porting to Linux.

Internal compiler error (C0000005)

$
0
0

Dear Fortran Masters, 

The code below is given an internal compiler error (C0000005). It seems valid Fortran 2003 to me. The idea of the code is to know the dimensions of the internal arrays of the "stream" data type when the function Solve is called by data types extending taUoO.

The error is obtained using the XE 2015 Composer Edition (latest update). 

Thank you in advance, Javier

 

module mod_UoOAbstract

    implicit none

    public  :: taUoO, stream

    private

    type, abstract  :: taUoO
        integer     :: isReady = .false.
    contains
        procedure(Solve), nopass, deferred  :: Solve
    end type taUoO

    type :: stream(nc)
        integer, len    :: nc
        real(8)         :: T
        real(8)         :: P
        real(8)         :: nF(nc)
        real(8)         :: zn(nc)
        real(8)         :: beta
        real(8)         :: h
    end type stream

    ! Define calling function prototypes. Concrete subroutines must
    ! be implemented for the extending types
    abstract interface

        ! Stream type is not visible inside the interface, hence it has to be imported
        subroutine Solve(nc, nFeeds, nProds, nExtns, nParms, feeds, prods, extns, parms)
            Import stream
            integer, intent(in)             :: nc
            integer, intent(in)             :: nFeeds
            integer, intent(in)             :: nProds
            integer, intent(in)             :: nExtns
            integer, intent(in)             :: nParms
            type(stream(nc)), intent(inout) :: feeds(nFeeds)
            type(stream(nc)), intent(inout) :: prods(nProds)
            type(stream(nc)), intent(inout) :: extns(nExtns)
            real(8), intent(in)             :: parms(nParms)
        end subroutine Solve

    end interface

end module mod_UoOAbstract

 

IA-32 build Thread model Free in HKEY_CLASSES_ROOT\Wow6432NODE\

$
0
0

Hi,

I have Windows 7 professional service pack version 1

Intel Core TM i72760 QM CPU 2.40GHZ

Visual Studio 2005

Visual Fortran version 10 for windows

IA-32 Build

 

I have an application that works just fine when the Threading model is Apartment.

The application is called from a c++ interface. 

 

The interface transfers the name and path of the source data file, and some other

simple run paramaters into the target fortran dll.  

The target fortran dll performs long and complicated calculations, also calling other fortran dlls, and c++ dlls, and then passes a simple set of results back to the calling interface.

 

Now the user wants to go with a registry setting of Free for the threading model

as shown below:

 

 

HKEY_CLASSES_ROOT\Wow6432Node\CLSID\{834EE1F7-94F0-4946-8759-BDECED57CC3E}\InprocServer32

Change the "ThreadingModel" value to "Free".

 

This does not work at all.

It looks the Fortran dll is attempting to start the first 4 source

data files, but is jumping into the 5th data file without doing preliminary initializations.

There is no orderly flow in the debugger to follow.

 

Is there a simple way to get this working multithreaded  set to  Free in the registry as above??

 

Or does the application have to be rewritten to provide special 'thread safe' memory allocations??

 

Are there any textbooks that can be ordered from amazon that would show a multithread application

that opens a file, reads it, performs calculations, and then passes the results of the calculations??

 

Thanks for your help

Bill

How to output a matrix without changing to a new line?

$
0
0

For example

program main
integer m
complex cjj
complex matrix(3, 5)

cjj=(0.0, 1.0)
matrix(1, :)=2*cjj
matrix(2, :)=2+1*cjj
matrix(3, :)=5*cjj+6

open(16, file='data.txt')
do m=1, 3
write(16, *)matrix(m, :)
enddo
close(16)
end

The above code does not work well. What I want is that the data in the output file is the same as the dimension of the matrix.

For this case, the size of the matrix is 3*5. What I want is also there are 3 lines ,and each line has 5 values.

Different results in debug and release

$
0
0

Running my program in ivf release mode returns other results than ivf debug mode, cvf debug mode and cvf release mode (their results are all the same). After a long search I found that the compiler option /check:all makes the difference.

As I read in several other topics the at least only reason for different results is an coding error. Though my program ist realy long, I would like to try to get these errors out. But compiling and linking it gives me no warning and no error message at all. Is there an option to get more feedback?

Is there a possibility to say which results are the right ones?

Passing multi-dimensional arrays from VB.net 2013 to IVF

$
0
0

Hi,

though I expect the subject has been discussed many time, I couldn't find a reference in the forum.

I am looking for documentation or (working) examples on how to pass 2d arrays from VB.net 2013 to IVF and back.

I have seached the internet, but most (all?) examples (seem to) give only partial answers. 

Many thanks for your help.

Gerrit V.

 

calling .Net methods from FORTRAN

$
0
0

 

Hi,

I did come across lot of examples showing how FORTRAN procedures can be called from .NET platform. Is the other way round is possible?

That is, can we call .NET methods from FORTRAN, are there any pointers in this aspect? I did hear about FORTRAN wizard module, but the examples seem to be more complex to be understood. Is there any simple and straight forward examples/documentation available?

Regards,

Dhana

 


Signed zero values

$
0
0

Dear Fortran experts,

I have found a rather strange behavior in one of our dlls generated with Intel Fortran compiler (Intel(R) Visual Fortran Compiler XE 14.0.0.103 [IA-32]). I have a routine in which the following code is written.

          if (INDIC == 4 .or. INDIC == INDIC_ALL) CJOULE = -DHP*RCONST/CP

The variables DHP, RCONST and CP are of type real (double precison) and RCONST and CP are positive values. Some lines above, the following code is setting the value of DHP to zero.

          DHP   = 0.D0

When I look at the value of the variable CJOULE in the debugger it displays 0.0000000D+00, however in hexadecimal display it shows #80000000 meaning that the bit of sign is set to 1.

The dll is used into Excel through the COM layer and what I found is that in an previous version of the dll the value displayed in Excel was 0 and now Excel displays -0 ! The only changes I did between the two versions was simply to perform a rebuild instead of a simple build to generate the dll (the build was necessary because of a change in a source code which as nothing to do with the source code above). 

Do you have any comment about that ?

Thanks and best regards.

Phil.

Transferring license to a new machine

$
0
0

Hi,

My company purchased a Intel Fortran license for a workstation (one user only) and now we are retiring that machine and using a new workstation. Please let me know how I can transfer the license to the new machine? Does copying the license file work or I should request for a new license (and how)?

Regards,

Hamidreza,

 

Parameterized derived type: unexpected run-time error with arrays of non-default bounds

$
0
0

The following simple code encounters an unexpected run-time error:

module m

   type, public :: t( m, n )
      private
      integer, len :: m
      integer, len :: n
      real         :: m_a( m:n )
   contains
      private
      procedure, pass(this), public :: init => init_a_t
   end type t

contains

   subroutine init_a_t( this )

      class(t(*,*)), intent(inout) :: this

      print *, " lbound of this%m_a = ", lbound(this%m_a, dim=1)
      print *, " ubound of this%m_a = ", ubound(this%m_a, dim=1)

      this%m_a = 0.0

      return

   end subroutine init_a_t

end module m

program p

   use m, only : t

   implicit none

   type(t(-1,1)) :: foo

   call foo%init()

   stop

end program p

Upon execution with Intel Fortran compiler version 2015, update 4:

  lbound of this%m_a =  -1
  ubound of this%m_a =  1
forrtl: severe (408): fort: (11): Subscript #1 of the array M_A has value -1 whi
ch is less than the lower bound of 0

Image              PC                Routine            Line        Source

p64.exe            000000013FF3BAD0  Unknown               Unknown  Unknown
p64.exe            000000013FF316EE  M_mp_INIT_A_T              22  m.f90
p64.exe            000000013FF31931  MAIN__                      9  p.f90
p64.exe            000000013FFBDE6E  Unknown               Unknown  Unknown
p64.exe            000000013FFBE93C  Unknown               Unknown  Unknown
p64.exe            000000013FFBEA7E  Unknown               Unknown  Unknown
kernel32.dll       00000000776159DD  Unknown               Unknown  Unknown
ntdll.dll          00000000779AA551  Unknown               Unknown  Unknown
Press any key to continue . . .

 

Trouble installing Parallell Studio XE with MSVS Pro 2013

$
0
0

Hello,

I am working with my IT admin to install Parallel Studio XE Composer Edition for Fortran Windows with Microsoft Visual Studio Pro 2013.  My IT admin downloaded w_fcompxe_2015.4.221 and tried to install it but during the install process the install splash screen would come up for about 20 seconds the then disappear without any warning or errors.  When I would try to create a new project, I did not see an option for Fortran.  From another forum post on this site, I thought it might be a problem with the security certificates so my IT admin downloaded sfsroot.cer and installed it.  This time the installation would get further along approximately 1 to 2 minutes but again the splash screen would disappear without any errors and no warning.  Again, when I try to create a new project, there is not option for Fortran, only Visual Basic, Visual C#, Visual C++ and Visual F#.   My computer is running Windows 7 SP1, 64 bit.  Any thoughts on what we might try? 

Thanks in advance

 

Stack overflow issue

$
0
0

The following line in my code creates a stack overflow:

J(1:N,1:M) = J_COARRAY[IMG]%VALUES

VALUES is a rank 2 array with dimensions smaller than those of J. The compiler is set so that warnings are issued when temporary arguments are created (which I suppose, is not really the case here since no warnings were issued). Does the transfer of data from one image to an other requires the creation of a temporary buffer (which would cause the stack overflow)?

I suppose the work around is to allocate arrays on the heap then?
 

Viewing all 5691 articles
Browse latest View live


Latest Images

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