Newsgroups: comp.os.parix
From: jankees@dutepp7.et.tudelft.nl (Jan Kees Joosse)
Subject: Re: Sending C Strcutures in Parix
Organization: Delft University of Technology
Date: 27 Jun 1996 10:34:22 GMT
Message-ID: <4qto3e$on8@mo6.rc.tudelft.nl>

In article <4qr4hu$n4s@hickory.soton.ac.uk>,
	Kenji Takeda <ktakeda@soton.ac.uk> writes:
>I am parallelising a discrete vortex method Navier Stokes solver which has a
>fast multipole method in it. I need to send a user-defined C structure across
>processors, and am not sure whether Parix will allow me to do it. (Actually 
>I'm pretty sure it won't!). I know that in MPI you can pre-define new
>MPI-datatypes. Is there a similar function in Parix.
>
>The structure I nesed to send is:
>
>typedef struct
>  {
>    int level;
>    int size;
>    int start;
>    int offset;
>    double radius;
>    double re_zbar, im_zbar;
>    double coeff[coeff_bit];   -> where coeff-bit is about 100
>  } zone_type
>
>My code actually uses an array of these structures with up to 5000 members, 
>so I need to keep my message passing of this structure as efficient as 
>possible (don't we all).
>

Send the structure or array of structures as a char array. 

On a Parsytec PowerTram system with Power Tools it goes in this way:


ChanOut(ToOther,(char *) StrucArray, count * sizeof(Structure));

where:

ToOther is the channel to an other node

Structure StrucArray[count];

and count is the number of structures in the array.

This should work when the same compiler is used for al nodes and when
the structure is packed the same in the programs. Moto: just try it, it
works even between the transputer on a PowerTram and the PowerPC-chip.
Which use different compilers.



Jan Kees Joosse


