with MPI, in C, how can I execute a function if and only if I received all data from N processors, in my master process ID 0?
edit: Is there a way of receiving also all data in the same order than they have been sent?
Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.
Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.
Lost your password? Please enter your email address. You will receive a link and will create a new password via email.
Please briefly explain why you feel this question should be reported.
Please briefly explain why you feel this answer should be reported.
Please briefly explain why you feel this user should be reported.
If I get your question correctly MPI_Reduce is what you need.
EDIT: so I did not get your question correctly. What you do need is MPI_Gather. And in this document you see that:
Each process (root process included) sends the contents of its send buffer to the root process. The root process receives the messages and stores them in rank order.Hope this answers your question.