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

Home » Public Forums » archive » Parallelise FOR loop in IDL
Show: Today's Messages :: Show Polls :: Message Navigator
E-mail to friend 
Switch to threaded view of this topic Create a new topic Submit Reply
Parallelise FOR loop in IDL [message #77680] Mon, 19 September 2011 05:55 Go to next message
Robin Wilson is currently offline  Robin Wilson
Messages: 40
Registered: August 2010
Member
Hi,

I have some IDL code like the following, which implements a Monte Carlo
ray-tracing model:


FOR i = 0, 1000 DO BEGIN
; Start a new ray from source
; Do all sorts of complicated processing on it
; Record where it lands
ENDFOR

I want to be able to run it for more iterations while still keeping it
fairly fast. If I was writing this in C I'd use OpenMP to split the
iterations of the loop between the available cores (as they are
independent) and then use a reduction to join all of the records of
where the rays end up together.

Is there any way to do anything like this in IDL? I've seen FastDL but
that seems to use MPI instead (not quite what I want...) and
unfortunately doesn't appear to be available free for academics.

Any ideas?

Robin

------------------
Robin Wilson
A PhD student studying complexity in remote sensing
www.rtwilson.com/academic
Re: Parallelise FOR loop in IDL [message #77756 is a reply to message #77680] Tue, 20 September 2011 07:21 Go to previous message
Kenneth P. Bowman is currently offline  Kenneth P. Bowman
Messages: 585
Registered: May 2000
Senior Member
In article <j57e3h$9sv$1@speranza.aioe.org>,
Robin Wilson <robin@rtwilson.com> wrote:

> Hi,
>
> I have some IDL code like the following, which implements a Monte Carlo
> ray-tracing model:
>
>
> FOR i = 0, 1000 DO BEGIN
> ; Start a new ray from source
> ; Do all sorts of complicated processing on it
> ; Record where it lands
> ENDFOR
>
> I want to be able to run it for more iterations while still keeping it
> fairly fast. If I was writing this in C I'd use OpenMP to split the
> iterations of the loop between the available cores (as they are
> independent) and then use a reduction to join all of the records of
> where the rays end up together.

If it is trivially parallel, why not run, for example, ten separate IDL
jobs with

FOR i = 0, 99 DO BEGIN ...

Simple minded, but probably much easier to implement than a true
parallel solution.

Ken Bowman
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: Onion Interview
Next Topic: West is Where!?

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

Current Time: Wed Oct 08 19:19:10 PDT 2025

Total time taken to generate the page: 0.00591 seconds