I guess the issue I'm trying to work out is the concurrency of the situation.
The idea I've been using is essentially:
Code:
if(myrank == 0){
start_time = MPI_WTIME
SEND_MSG
}
if(myrank != 0){
RECEIVE_MSG
}
if(myrank == 0){
end_time = MPI_WTIME
}
And the idea I had was that once I arrived at the third 'if' statement, the message must have been received and I'd log the time. However, I do not believe this is correct. I don't think I am considering the concurrency of the code here.
So, my question is, on a high level - how do I log the communication time between these processors when I am using different processes, different architectures, and MPI for communication.
One idea I had was to do the MPI send and receive in a separate function and then wrap the MPI_WTIMEs around that function. However, I do not believe that is correct either.
Any ideas?