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

Home » Public Forums » archive » Re: Scope_Varfetch "IDL workbench" train wreck
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: Scope_Varfetch "IDL workbench" train wreck [message #68693 is a reply to message #68691] Wed, 18 November 2009 11:01 Go to previous messageGo to previous message
Foldy Lajos is currently offline  Foldy Lajos
Messages: 268
Registered: October 2001
Senior Member
On Wed, 18 Nov 2009, wlandsman wrote:

> Of course, when I tested this, a run that took under 1 second from the
> command prompt completely hung my Mac (x86_64 darwin unix Mac OS X
> 7.1 Apr 21 2009 64 64) when run from the Workbench. My Linux box
> was not quite as bad but also eventually hung with messages such as
>
> java.lang.OutOFMemoryError: unable to create new native thread
> java.lang.ArrayIndexOutOfBoundsException: 2601
>
> The culprit apparently is my use of SCOPE_VARFETCH. readcol.pro
> calls SCOPE_VARFETCH thousands of time for a large file, since it
> writes data directly into the output variables, and uses a
> SCOPE_VARFETCH call for each item written.
>
>
> Below is a little test program to be called with
> IDL> test, x1,x2,x3,x4,x5,x6,x7,x8,x9
>
> I find it runs instantly from the IDL command line but takes very long
> or hangs the IDL workbench. --Wayne
>
>
> pro test,a,b,c,d,e,f,g,h,j
>
> vv = ['a','b','c','d','e','f','g','h','j']
> for k=0,8 do begin ;Create output variables
> res = execute(vv[k] + '=fltarr(5000)' )
> endfor
> for jj=0,4999 do for k=0,8 do (scope_varfetch(vv[k],Level=0))[jj]=float(jj)
> return
> end

There is no time difference between the CLI and GUI runs in IDL 7.0 on 64
bit linux. (It's a fresh openSUSE 11.2 machine with the OpenJDK 1.6 java
environment.)

Temporary buffers will solve your problem:

pro test,a,b,c,d,e,f,g,h,j

vv = ['a','b','c','d','e','f','g','h','j']

ptmp=ptrarr(9)
for k=0,8 do begin ;Create output variables
ptmp[k] = ptr_new(fltarr(5000))
endfor

for jj=0l,4999 do for k=0,8 do (*(ptmp[k]))[jj]=float(jj)

for k=0,8 do begin
(scope_varfetch(vv[k],Level=0))=temporary(*(ptmp[k]))
endfor

ptr_free, ptmp

return
end

(Even the EXECUTEs have vanished :-)

regards,
lajos
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: widget confusion
Next Topic: Re: widget confusion

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

Current Time: Fri Oct 10 03:37:24 PDT 2025

Total time taken to generate the page: 0.88368 seconds