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

Home » Public Forums » archive » Passing an array from IDL to MPI
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
Passing an array from IDL to MPI [message #28858] Sun, 13 January 2002 23:47 Go to next message
Miska Le Louarn is currently offline  Miska Le Louarn
Messages: 8
Registered: December 1995
Junior Member
Hi all IDL / parallel computing experts !

I am trying to integrate a piece of MPI-code written in C into my IDL
program.
I have a cube of data produced in the IDL code, which needs to be
Fourier transformed. So I want to write a little MPI program (in C)
which uses several CPUs to compute the FFT of each plane in the cube.
My problem is that I need to pass the data cube to the MPI program. This
would not a problem with a plain C program (a simple call_external would
do the trick), but MPI likes to be lauched with the "mpirun" command
which initializes all the parallel stuff.

Any ideas ?
Of course I could write the data cube to a file from IDL. I could then
spawn the mpirun process from IDL and have the MPI code read the file.
But I think there is a significant loss of time doing that. Plus it's
not very elegant...

I hope someone has an idea...

Thanks in advance !

Miska


PS: I am using MPICH under Linux. The C code uses FFTW.

--
* Miska Le Louarn Phone: (49) 89 320 06 908 *
* European Southern Observatory FAX : (49) 89 320 23 62 *
* Karl Schwarzschild Str. 2 e-mail: lelouarn@eso.org *
* D-85748 Garching http://www.eso.org/~lelouarn *
* Germany
*
Re: Passing an array from IDL to MPI [message #28957 is a reply to message #28858] Mon, 21 January 2002 15:05 Go to previous messageGo to next message
ronn is currently offline  ronn
Messages: 123
Registered: April 1999
Senior Member
in article 3C4C369A.5070807@eso.org, Miska Le Louarn at lelouarn@eso.org
wrote on 1/21/02 10:41 AM:

>> I have written an IDL interface to PVM (another parallel processing system)
>> so it is possible to do. PVM must also be initialized with a function call
>> that returns some parameters. You then spawn off the child processes with
>> these parameters as part of the call.
>>
>> What this means is that you have to write a multi-function dll that contains
>> all the interface routines that you need.
>
>
> Hmm, this looks interesting...
> Could you give a 2 line example on how to do this ? :-)
> For the moment, I know how to use call externals and spawns. What is, in
> this case, the big advantage of using DLLs ?
>
2 lines! I wrote a 75 page book on how to do this! The advantage of DLL's
is that they become "built in" IDL routines so that you get maximum speed
without the hassle of Call_external.

Ronn


--
Ronn Kling
KRS, inc.
email: ronn@rlkling.com
"Application Development with IDL"� programming book updated for IDL5.5!
"Calling C from IDL, Using DLM's to extend your IDL code" NEW BOOK!
http://www.rlkling.com/
Re: Passing an array from IDL to MPI [message #29065 is a reply to message #28858] Sun, 27 January 2002 20:03 Go to previous message
bruhwile is currently offline  bruhwile
Messages: 4
Registered: July 2001
Junior Member
Hi Miska,

At Tech-X, we have developed prototype software that enables
parallel computing with IDL, using MPI. You can find a little
information at URL http://www.techxhome.com/products/mpidl

In our approach, you launch a light-weight application using
mpirun (or whatever script your MPI implementation uses).
Then each instance of your application brings in IDL as a
shared object, via the "callable IDL" mechanism. Processor
0 gives you an interactive IDL prompt, while the other
processors invoke IDL in a background mode.

The multiple IDL instances can now invoke IDL scripts
that call out to the MPI library of your choice, using
IDL-friendly routines that wrap the usual MPI functions
through a dynamically loadable module. We've used MPICH
under Linux and also Compaq's native MPI implementation
under Tru64 Unix.

This is perhaps a bit more than you were asking for, but
our approach will allow you to write a fully parallel
application entirely in IDL.

We have prototyped this approach under a short-term gov't
grant and shown that it works. We're now looking at
parallelizing some IDL visualization features. A supported
product won't be available for a year or so -- and then
only if we get the second phase of funding. However, if
you are interested in beta testing, then you can send a
message to mpidl-users@txcorp.com and we'll discuss it.

Cheers,
David

Miska Le Louarn <lelouarn@eso.org> wrote in message news:<3C428D26.1080405@eso.org>...
> Hi all IDL / parallel computing experts !
>
> I am trying to integrate a piece of MPI-code written in C into my IDL
> program.
> I have a cube of data produced in the IDL code, which needs to be
> Fourier transformed. So I want to write a little MPI program (in C)
> which uses several CPUs to compute the FFT of each plane in the cube.
> My problem is that I need to pass the data cube to the MPI program. This
> would not a problem with a plain C program (a simple call_external would
> do the trick), but MPI likes to be lauched with the "mpirun" command
> which initializes all the parallel stuff.
>
> Any ideas ?
> Of course I could write the data cube to a file from IDL. I could then
> spawn the mpirun process from IDL and have the MPI code read the file.
> But I think there is a significant loss of time doing that. Plus it's
> not very elegant...
>
> I hope someone has an idea...
>
> Thanks in advance !
>
> Miska
>
>
> PS: I am using MPICH under Linux. The C code uses FFTW.
  Switch to threaded view of this topic Create a new topic Submit Reply
Previous Topic: Re: trired/triql and EOF/PCA
Next Topic: Segmentation of Multiple ROIs

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

Current Time: Wed Oct 08 15:26:29 PDT 2025

Total time taken to generate the page: 0.01115 seconds