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 #28174 is a reply to message #28130] Tue, 27 November 2001 09:24 Go to previous messageGo to previous message
Pavel A. Romashkin is currently offline  Pavel A. Romashkin
Messages: 531
Registered: November 2000
Senior Member
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.
Cheers,
Pavel
[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 15:43:55 PDT 2025

Total time taken to generate the page: 0.00423 seconds