Poor performance of implied-DO loop with Intel Fortran
From: Aidan (aidan_at_alghieri.rsc.anu.edu.au)
Date: 05/03/04
- Previous message: Tim Prince: "Re: precedence of operations"
- Next in thread: glen herrmannsfeldt: "Re: Poor performance of implied-DO loop with Intel Fortran"
- Reply: glen herrmannsfeldt: "Re: Poor performance of implied-DO loop with Intel Fortran"
- Reply: Steve Lionel: "Re: Poor performance of implied-DO loop with Intel Fortran"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Date: 3 May 2004 15:02:47 +1000
This is something of a "heads-up" to others who might be using the
Intel fortran compliers.
I get very poor performance when using implied-DO loops to initialise
arrays when the loop counter of the implied-DO is greater than one
million. The performance is fine with loops up to one hundred
thousand.
For example. A simple program that just initialises an integer array
with an implied-DO construct, e.g. array = (/ (1, i=1,n) /). For
n=100000 the execution time is 20 milliseconds. For n=1000000 execution
time is > 10 seconds.
This has been tested under linux with Intel(R) Fortran Compiler for
32-bit applications, Version 7.1 Build 20040309Z
I wasn't able to time v8.0 of the Intel compiler because it segfaulted
(Version 8.0 Build 20040412Z and Build 20031211Z both exhibited the
same behaviour -- I don't use v8.0 because it is flakey).
As a comparison a Tru64 UNIX fortran compiler (HP Fortran Compiler
V5.5A-3548-48D88) ran fine up to n=10000000 with no speed degredation.
Do other compilers fare better?
Cheerio
Aidan
P.S. Here are some test programs if people want to try them on their
compilers. Note that one uses a loop and one an implied-DO to achieve
the same result. Also note that convoluted way this is implemented.
I was attempting to overcome the optimising of the compiler which
seemed to put simple initialisations like this into the executable
unless I hid them in a subroutine.
program packtest3
call sub(1000000)
contains
subroutine sub(n)
integer, intent(in) :: n
integer :: trues(n)
trues = (/ (i, i=1,n) /)
end subroutine sub
end program packtest3
program packtest4
call sub(1000000)
contains
subroutine sub(n)
integer, intent(in) :: n
integer :: trues(n)
do i = 1, n
trues(i) = i
end do
end subroutine sub
end program packtest4
- Previous message: Tim Prince: "Re: precedence of operations"
- Next in thread: glen herrmannsfeldt: "Re: Poor performance of implied-DO loop with Intel Fortran"
- Reply: glen herrmannsfeldt: "Re: Poor performance of implied-DO loop with Intel Fortran"
- Reply: Steve Lionel: "Re: Poor performance of implied-DO loop with Intel Fortran"
- Messages sorted by: [ date ] [ thread ] [ subject ] [ author ]
Relevant Pages
|