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

Home » Public Forums » archive » IDL_IDLBridge: No gain?
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Return to the default flat view Create a new topic Submit Reply
IDL_IDLBridge: No gain? [message #85465] Sat, 10 August 2013 13:05 Go to previous message
dg86 is currently offline  dg86
Messages: 118
Registered: September 2012
Senior Member
Dear Folks,

I'd like to run multiple instances of a computationally expensive routine in
separate threads to improve performance. I tried to achieve this by running
each instance in a separate IDL_IDLBridge with the NOWAIT flag set.
Disappointingly, two instances require roughly twice as long to run as one.
There seems to be no benefit! What am I doing wrong?

I'm running IDL 8.2.3 64-bit on a MacBook Pro with 8 cores.

Many thanks,

David

Here's a sketch of my attempt using just two IDL_IDLBridge objects:

a = fltarr(640,480) + 1. ; in practice, this would be data
cmd = 'p = lmfeature(a, 0.447, 0.135)' ; the expensive routine

bridge1 = IDL_IDLBridge()
bridge2 = IDL_IDLBridge()
bridge1.setvar, 'A', a
bridge2.setvar, 'A', a ; use same data for demo

tic
bridge1.execute, cmd, /nowait
bridge2.execute, cmd, /nowait

while 1 do $
if (bridge1.status() eq 1) or (bridge2.status() eq 1) then $
wait, 0.1 $
else $
break
toc

p1 = bridge1.getvar('P')
p2 = bridge2.getvar('P')
[Message index]
 
Read Message
Read Message
Read Message
Read Message
Read Message
Previous Topic: Why Output Keywords Fail in cgWindow
Next Topic: Recalibration of observed spectrum

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

Current Time: Wed Oct 08 19:09:44 PDT 2025

Total time taken to generate the page: 0.00508 seconds