MPI中的等级和流程有什么区别? [英] What is the difference between ranks and processes in MPI?
问题描述
MPI中的等级和流程有什么区别?
What is the difference between ranks and processes in MPI?
推荐答案
Here is the resource I learned all my MPI from, you might find it useful.
关于您的问题:进程是正在运行的程序的实际实例. MPI允许您创建流程的逻辑组,并且在每个组中,流程均通过其等级进行标识.这是[0,N-1]范围内的整数,其中N是组的大小. 通信器是处理进程之间通信的对象. 内部沟通者处理单个组中的流程,而内部沟通者处理两个不同组之间的通信.
As to your question: processes are the actual instances of the program that are running. MPI allows you to create logical groups of processes, and in each group, a process is identified by its rank. This is an integer in the range [0, N-1] where N is the size of the group. Communicators are objects that handle communication between processes. An intra-communicator handles processes within a single group, while an inter-communicator handles communication between two distinct groups.
默认情况下,您有一个包含所有进程的组,而内部通信器MPI_COMM_WORLD
处理它们之间的通信.这对于大多数应用程序已经足够了,并且确实使过程和等级之间的区别变得模糊.要记住的主要事情是,进程的排名始终是相对于组而言的.如果要将流程分为两组(例如,一组用于读取输入,另一组用于处理数据),则每个进程现在将具有两个等级:它最初在MPI_COMM_WORLD
中具有的等级,而在其新组中具有一个等级.
By default, you have a single group that contains all your processes, and the intra-communicator MPI_COMM_WORLD
that handles communication between them. This is sufficient for most applications, and does blur the distinction between process and rank a bit. The main thing to remember is that the rank of a process is always relative to a group. If you were to split your processes into two groups (e.g. one group to read input and another group to process data), then each process would now have two ranks: the one it originally had in MPI_COMM_WORLD
, and one in its new group.
这篇关于MPI中的等级和流程有什么区别?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!