Re: Speed penalty for using allocatable arrays?
- From: glen herrmannsfeldt <gah@xxxxxxxxxxxxxxxx>
- Date: Mon, 13 Nov 2006 00:27:49 -0800
jomarbueyes@xxxxxxxxxxx wrote:
(snip on slow execution using ALLOCATABLE arrays)
I might expect one or two more instructions to do the calculation
per dimension of the array, but not more. For matrix multiplication,
which does more array access than multiply or add, that could be
a significant part of the time.
You might have a point here. The bottleneck of our algorithms
are fast Fourier transforms (FFTs) which do multiply-add
operations between memory locations that are not close to
each other. However, I'd expect the same limitatation to apply
to programs with static memory allocation.
Usually FFT would be done in a subroutine, and that subroutine
would be the same: allocatable, automatic, or static.
One thing that does happen sometimes is that the compiler copies
a possibly non-contiguous array into contiguous space
before passing to to an assumed size dummy argument. It
is possible that that change would happen in changing to
ALLOCATABLE arrays.
It would be nice if you had a nice small program that showed
this effect. Maybe load data into an array, call FFT, show
the result.
On x86 machines, my favorite way to do timing is with the RDTSC
(read time stamp counter) instruction. It takes a two instruction
assembly program on most 32 bit x86 machines that allow for a 64 bit
INTEGER type.
If you can get a nice small program, though, it should be possible
to look at the generated code and see what is so different.
(snip of other suggestions and answers)
-- glen
.
- Follow-Ups:
- Re: Speed penalty for using allocatable arrays?
- From: Richard Maine
- Re: Speed penalty for using allocatable arrays?
- References:
- Speed penalty for using allocatable arrays?
- From: jomarbueyes
- Re: Speed penalty for using allocatable arrays?
- From: glen herrmannsfeldt
- Re: Speed penalty for using allocatable arrays?
- From: jomarbueyes
- Speed penalty for using allocatable arrays?
- Prev by Date: Re: Speed penalty for using allocatable arrays?
- Next by Date: Re: Speed penalty for using allocatable arrays?
- Previous by thread: Re: Speed penalty for using allocatable arrays?
- Next by thread: Re: Speed penalty for using allocatable arrays?
- Index(es):
Relevant Pages
|