-
- 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.
-
- 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.
-
- 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.
-
- 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 !