next up previous
Next: 4 Global Operations Up: Course on Parallelization Previous: 2 Your first parallel

3 Synchronized Communication




\fbox{{\large E5}}
Write a routine

Send_ProcD(to,nin,xin,icomm)

which sends nin Double Precision numbers of the array xin to the process to . Note that the receiving process to does in general not have any information about the length of the data-package to be received.
\fbox{{\large E6}}
Write a routine

Recv_ProcD(from,nout,xout,maxbuf,icomm)

corresponding to E5, which receives nout Double Precision numbers of the array xout from the process from . A-priori, the receiving process does not have any information about the length of the data to be received, i.e., nout is an output-parameter ! maxbuf stands for the maximum length of the array xout.
\fbox{{\large E7}}
Test the routines from E5 and E6 first, with two processes. Let process 1 send data and process 0 receive them. Extend the test to several processes.
\fbox{{\large E8}}
Combine E5 and E6 to a routine

ExchangeD(yourid,nin,xin,nout,xout,maxbuf,icomm),

which exchanges double precision data between the own process and another process yourid. The remaining parameters are the same as in E5, E6. Test your routines with 2 and more processes !

next up previous
Next: 4 Global Operations Up: Course on Parallelization Previous: 2 Your first parallel
Gundolf Haase 2003-05-19