
204 CHAPTER 8. MESSAGE PASSING
If the receive call is within a loop, the overhead of repeatedly setting up
buffer space may be substantial. This of course would be remedied by
moving the statement
b <− double (100000)
to a position preceding the loop.
4
With mpi.recv.Robj(), this memory allocation overhead occurs “invisi-
bly.” If the function is called from within a loop, there is potentially a
reallocation at every iteration. So, while this type of receive call is more
convenient, you should not be fooled into thinking there are no memory
issues. Thus we may attain better efficiency from mpi.recv() than from
mpi.recv.Robj(). As mentioned, the latter also ...