comp.lang.idl-pvwave archive
Messages from Usenet group comp.lang.idl-pvwave, compiled by Paulo Penteado

Home » Public Forums » archive » Use of Temporary( ) vs an Optimised Compiler
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
Re: Use of Temporary( ) vs an Optimised Compiler [message #28270 is a reply to message #28174] Tue, 27 November 2001 10:46 Go to previous messageGo to previous message
Paul van Delst is currently offline  Paul van Delst
Messages: 364
Registered: March 1997
Senior Member
"Pavel A. Romashkin" wrote:
>
> Craig Markwardt wrote:
>>
>>> a = 2*a + b/TEMPORARY(a)
>>
>> Since A appears twice on the right hand side, the compiler would need
>> to be smart enough to not overwrite A after its first appearance. In
>> fact, I am not sure that IDL makes any guarantees about order of
>> evaluation and side effects. Isn't it possible that the TEMPORARY()
>> gets called before the first A is evaluated?
>
> I recently had to think about memory allocation in IDL for the first
> time as I had to use large arays (well, some 4E+7 points, astronomy guys
> don't laugh).
> In my case it appeared faster (and sometimes the only way possible to
> avoid infufficient memory errors) to split the above expression
>
> a = 2*a +b/temporary(a)
>
> into
>
> a = 2*temporary(a)
> a = 2*b/temporary(a)
>
> It takes a while even to do math on xE+7 points, and allocating arrays
> further slows things down.
> In this simple case, this is easy to do, but some expressions were quite
> hard to split like this. There are probably better ways.

How about,

a = SQRT( 2*TEMPORARY(a)^2 + b )

Would the use of the exponentiation operator and SQRT() function be slower than the two step
process above for supa-big arrays?

paulv

--
Paul van Delst Religious and cultural
CIMSS @ NOAA/NCEP purity is a fundamentalist
Ph: (301)763-8000 x7274 fantasy
Fax:(301)763-8545 V.S.Naipaul
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Re: removing old IDL versions
Next Topic: Automatic truncation of trailing dimension.....

-=] Back to Top [=-
[ Syndicate this forum (XML) ] [ RSS ] [ PDF ]

Current Time: Wed Oct 08 20:06:11 PDT 2025

Total time taken to generate the page: 0.00419 seconds