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

Home » Public Forums » archive » Re: idl_idlbridge weirdness on unix systems
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: idl_idlbridge weirdness on unix systems [message #79425 is a reply to message #79424] Tue, 28 February 2012 11:08 Go to previous messageGo to previous message
Yngvar Larsen is currently offline  Yngvar Larsen
Messages: 134
Registered: January 2010
Senior Member
On Feb 28, 6:49 pm, Yngvar Larsen <larsen.yng...@gmail.com> wrote:
> I encountered a strange problem today while working with IDL child
> processes instantiated using the IDL_IDLBridge class. Specifically, I
> want to be able to use a lot of subprocesses on a 4 CPU x 12-kernel
> server, so I tried using 48 IDL_IDLBridge objects to test the system.
> But no cigar. IDL hangs apparently at random. I narrowed down the
> problem to the following.
>
> The simple code below just instantiates an array of objects, and then
> tries to destroy them one by one. What happens (for me) is that when
> it encounters index ii=16, the entire IDL process hangs.
>
> N = 17
> b = objarr(N)
> for ii=0, N-1 do b[ii]=obj_new('idl_idlbridge')
>
> for ii=0, N-1 do begin
>   status = b[ii]->status() ; Just to make sure the object is idle
> (status = 0)
>   print, ii, status
>   obj_destroy, b[ii]
> endfor
>
> Now comes the weird part; the following almost identical code, where I
> just destroy the objects in the opposite order, works fine always!
>
> N = 17
> b = objarr(N)
> for ii=0, N-1 do b[ii]=obj_new('idl_idlbridge')
>
> for ii=N-1,0,-1 do begin
>   status = b[ii]->status() ; Just to make sure the object is idle
> (status = 0)
>   print, ii, status
>   obj_destroy, b[ii]
> endfor

Errata: it fails for ii=15, not 16.

Just to add to the weirdness: I tested this also for larger N. It
turns out it does not matter which order the objects b[0:14] are
destroyed.

But for any N>15, you must kill the objects in descending order:

for ii=N-1,15,-1 do obj_destroy, b[ii]

You can also kill any b[ii] for ii<15 at anytime, as long as the high
index objects are destroyed in descending order, e.g. this is ok:

N = 25
b = objarr(N)
for ii=0, N-1 do b[ii]=obj_new('idl_idlbridge')

p = [5,24,12,7,23,14,3,22,21,4,8,9,2,20,10,19,18,11,17,1,6,16,0, 13,15]
for ii=0,N-1 do obj_destroy, b[p[ii]]

My solution is to wait for all child processes to finish, and then
destroying the idl_idlbridge objects in descending index order.
Destroying the objects whenever they finish their respective part of
the full computation will not work. (Unless the child processes by
chance finish in descending order by array index for indices larger
than 14...)

Over and out. Thank you, Exelis. (I want half a day of my life back.)

--
Yngvar
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Further adventures in POLAR_CONTOUR
Next Topic: Re: Further adventures in POLAR_CONTOUR

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

Current Time: Fri Oct 10 00:39:59 PDT 2025

Total time taken to generate the page: 0.88400 seconds