how to send a structure with a pointer variable as one of its members..
for eg, i've to send the following structure
struct sample *l,*r;
can u pls tell me how to send the atructure like one above,in MPI.
On MPI the recepient, unless sending to self, runs as a different process whether it be on the same computer or different computer, and therefore the pointers would be to data located within the virtual address of one process (presumably the sending process). That address, though may be a valid address on the receiving process, would not point to the data contained within the sending process (unless the processes had sharable memory and the sharable memory appears at the same virtual address within both (all) processes sharaing the memory). This pointer would be useless in the receiving process. However, you could save the address (pointer) then return the pointer to originator for its use.
If you intend to use the data pointed to by the pointers within the struct, then you will have to send the data itself to a proceedure which re-constitutes the struct on the recipient's system using the sent data. i.e. The remote system will have a struct s containing pointers to local copies of the senders struct s data.
thank u for the reply..
but,i need to know the syntax for sending the above structure..
for eg, shall i use MPI_Pack or MPI_Type_struct, things like these... what shall i use ?
if possible pls mention the syntax to send the above structure.