what is the difference between MPI_Probe and MPI_Get_count in mpi

佐手、 提交于 2021-02-11 15:17:58

问题


I've found that MPI_Probe is used to find the message size, and MPI_Get_count to find the message length. What's the difference between message length and message size? Aren't they both same? Moreover what's the count parameter in the MPI_Send or MPI_Recv signifies? Does it implies the no of times the same message will be sent/recieve from Process x to process y?


回答1:


While MPI_Probe may be used to find the size of a message you have to use MPI_Get_count to get that size. MPI_Probe returns a status which is a data structure providing information about the message, including its source, tag and size. But to get that size you call MPI_Get_count with the status as an argument.

I'm not sure where you've got the terms 'message size' and 'message length' from or how you have come to the idea that they are different. For me the message size is simply the number (usually called count) of instances of one of the MPI datatypes; so one message might carry 6 MPI_Integers, another might carry 1024 MPI_Reals, and so forth.

When used as an argument in MPI_Send or MPI_Recv the count is the number of instances of a datatype in the message -- that datatype is in both procedures the next argument after the count.



来源:https://stackoverflow.com/questions/12111232/what-is-the-difference-between-mpi-probe-and-mpi-get-count-in-mpi

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!