Hi,
There is no way the compiler can know that this is the same as "y = x", but
the LAM runtime libraries do know if the ranks of the source and destination
are the same and optimise this (i.e. dont use TCP/IP or Shared-Mem to do the
copy). The routines can't simply copy "x" to "y" willy-nilly though (what if
another node sent a message earlier? then "y" would be in use and you would
overwrite it!).
Also, if you use the "sysv" or "usysv" RPIs, the routines will optimise the
send/recv if the MPI processes are on the same server, using shared-memory
instead of TCP/IP.
Regards
Neil
x z wrote:
> Does LAM-MPI optimize a Send whose destination is the local node (and
> the corresponding Recv whose source is the local node)? How?
> That is, if I have:
> if (myID==0)
> for (i=1;i<100;i++)
> MPI_Send(&x, ..., tag, dest, ...)
> else
> for (i=1;i<100;i++)
> MPI_Recv(&y, ..., ANY_TAG,source, ...)
> and in some cases, the send is to the local node, the recv is from local
> node.
> This may happen if the data distribution is irregular and the source and
> destination is not known until run time. If it is local, there is no
> need to copy x to the buffer and then copy the buffer to y. But can the
> LAM-MPI compiler/runtime detect that, and make approopriate action, like
> converting the Send/Recv to simply y=x?>
> _______________________________________________
> This list is archived at http://www.lam-mpi.org/MailArchives/lam/
--
+-----------------+---------------------------------+------------------+
| Neil Storer | Head: Systems S/W Section | Operations Dept. |
+-----------------+---------------------------------+------------------+
| ECMWF, | email: neil.storer_at_[hidden] | //=\\ //=\\ |
| Shinfield Park, | Tel: (+44 118) 9499353 | // \\// \\ |
| Reading, | (+44 118) 9499000 x 2353 | ECMWF |
| Berkshire, | Fax: (+44 118) 9869450 | ECMWF |
| RG2 9AX, | | \\ //\\ // |
| UK | URL: http://www.ecmwf.int/ | \\=// \\=// |
+--+--------------+---------------------------------+----------------+-+
| ECMWF is the European Centre for Medium-Range Weather Forecasts |
+-----------------------------------------------------------------+
|