What is the difference between ranks and processes in MPI?

前端 未结 3 2045
你的背包
你的背包 2021-02-05 23:46

What is the difference between ranks and processes in MPI?

3条回答
  •  礼貌的吻别
    2021-02-06 00:05

    Every process that belongs to a communicator is uniquely identified by its rank. The rank of a process is an integer that ranges from zero up to the size of the communicator minus one. A process can determine its rank in a communicator by using the MPI_Comm_rank function that takes two arguments: the communicator and an integer variable rank:

    int MPI_Comm_rank(MPI_Comm comm, int *rank) 
    

    The parameter rank will store the rank of the process.

    Note that each process that calls either one of these functions must belong in the supplied communicator, otherwise an error will occur.

提交回复
热议问题