locked
MPI and head node RRS feed

  • Question

  •  

    Hi, there,

     

      I am program an MPI program under VS 2005. I am wondering if one of process on the head node will set to be rank 0 when the program is running on a cluster. If it is not ture, how can I find a process running on head node among so many parallel processses?

     

      Thanks


    Wei

    Tuesday, May 13, 2008 8:37 AM

Answers

  • Suggest you use a combination of these MPI functions: MPI_Get_processor_name, MPI_Comm_rank, MPI_Bcast

    Have each rank execute MPI_Get_processor_name() which will return the computer name of the node upon which the rank is running.  Then have each rank compare its computer name with the CCP_CLUSTER_NAME environment variable (or CCP_SCHEDULER in CCSv1) which is set by the HPC system to the computer name of the head node.  If the two match, then the rank(s) use MPI_Comm_rank() to get their rank number(s) followed by MPI_BCAST to broadcast the head node rank(s) to the other ranks.  Note there could be more than one rank running on the head node if that node has multiple processor cores (a fairly common occurance) so make sure you account for that in your logic. 

    Eric

    (Microsoft)
    Tuesday, June 24, 2008 1:14 AM

All replies

  •  

    I don't believe there is any guarantee that the Rank 0 process will be on the HN.

     

    Can you tell us: Why do you need to find the Rank 0 process?

     

    -J

    Tuesday, May 13, 2008 9:11 PM
    Moderator
  • I will open a pot on head node and recieve the data from clients, then broadcast to all processes and solve the problem. So, I need find a process on head node and let all other processes know the rank of the process.

     

    Thanks

     

    Wei

    Wednesday, May 14, 2008 4:09 AM
  • Suggest you use a combination of these MPI functions: MPI_Get_processor_name, MPI_Comm_rank, MPI_Bcast

    Have each rank execute MPI_Get_processor_name() which will return the computer name of the node upon which the rank is running.  Then have each rank compare its computer name with the CCP_CLUSTER_NAME environment variable (or CCP_SCHEDULER in CCSv1) which is set by the HPC system to the computer name of the head node.  If the two match, then the rank(s) use MPI_Comm_rank() to get their rank number(s) followed by MPI_BCAST to broadcast the head node rank(s) to the other ranks.  Note there could be more than one rank running on the head node if that node has multiple processor cores (a fairly common occurance) so make sure you account for that in your logic. 

    Eric

    (Microsoft)
    Tuesday, June 24, 2008 1:14 AM