Changes between Version 1 and Version 2 of mpich/point_to_point/demo4


Ignore:
Timestamp:
Jun 25, 2008, 4:52:47 PM (16 years ago)
Author:
wade
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • mpich/point_to_point/demo4

    v1 v2  
    22{{{
    33/* Program:
    4  *   讓 node 0 可以接受來自任何 node 的訊息
     4 *   讓 node 0 可以接受來自任何 node 的訊息,每個 node 將訊息標上不同 tag 後傳給 node 0
    55 * History:
    66 *   2008-06-24 BETA
     
    1818  MPI_Comm_rank(MPI_COMM_WORLD, &myrank);
    1919
     20  /* 除了 Node 0 以外的所有 node 都要送 5 個訊息給 node 0 , 將 i 當成 tag 送出 */
    2021  if (myrank > 0)
    2122  {
     
    3031    for (i = 0; i < 5*(numprocs-1); i++)
    3132    {
     33
     34      /* MPI_ANY_SOURCE 接收來自任何 node , MPI_ANY_TAG 接收來自任何 tag */
    3235      MPI_Recv(&buf, 1, MPI_INT, MPI_ANY_SOURCE, MPI_ANY_TAG, MPI_COMM_WORLD, &status);
    3336      printf("[Node %d][Tag %d] => %d\n", status.MPI_SOURCE, status.MPI_TAG, buf);