Dear all,
I am all set with your suggestions and my program is working quite well without any "unexpected message" since then, thanks again.
However now I am facing a small problem I describe next.
My receiver process receives actually 2 types of messages (2 different tags):
- the basic tag means that the message is a "data message" ("data" tag) that should be processed.
- the second one means that the worker process is done and it will send no more messages ("end_of_processing" tag).
Once all worker processes send their end_of_processing tag, the receiver process finishes its execution.
The problem I noticed is that some of the last messages sent by the worker processes were not being processed. I think the problem is related with the logic I am using with MPI_WAITANY in the receiver process. I am simply counting the number of end_of_processing messages received and if it reaches the number of worker processes, I finish the execution without checking if there are more messages to be received at the MPI_WAITANY queue.
As the order that messages arrive is not relevant for MPI_WAITANY I think that my logic forgets some of the messages at the end of the queue. Is this right?
Is there any way to check if there is any pending request to be processed?
Best regards,
Luiz