Hi,
->1. When I pack data whit MPI_TYPE_STRUCT and send it
->to the nodes, how i access the variables inside this
->new type at the nodes? What i must do when the nodes
->receive the message(via BCAST or MPI_RECV)?
If MPI datatype that you build and the data structure that is being
built are accessible (or are present) on the receiving end, you should be
able to access the contents of the structure in the usual way on the
receiving side.
->
->2. When I make a MPI_SCATTER and the size of data is
->not divisible by the numbers of nodes, what this
->MPI_SCATTER do? exemple: sizedata=100; nodes=6;
->local_n = sizedata/nodes. Whats happen if i call
->MPI_SCATTER in this case?
One of the arguments to MPI_Scatter is 'sendcount', which specifies the
number of elements to be sent to *each* node. So if you have 100 elements
and 6 nodes, you would not be able to distribute the elements *evenly*
across all the nodes, using a single MPI_Scatter call.
Hope this helps.
Prashanth Charapalli,
LAM/MPI Team.
|