-
Capturing Message Time
I am having difficulty finding the time is takes to send a message via MPI from one processor to another. The difficult step here is that these processors are of different architectures. They are connected via a network.
I am looking just for the time it takes to send a message. I've tried a few different things, but I'm just getting bad results.
Any ideas for how this can be done? Whenever I Google it, I get a bunch of sites that just have information on the function MPI_Wtime(), which is what I have been using.
-
MPI_Wtime
Is your 'time' synchronised?
-
-
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?
-
You know, I'm wondering if it is enough to measure just the time it takes to send a message?
Perhaps I am making this problem out to be more difficult than it is.
For example:
Code:
start_time = MPI_WTIME
SEND_MSG
end_time = MPI_WTIME
Would this give me the communication time for a message sent between two processors?
I am assuming that when the SEND_MSG function is finished the message is sent. So instead of trying to start the measuring timer on the sending processor and ending the message timer on the receiving processor, I can just measure around the send function and that is how long it took to send - or communicate - the message.
Is this logic sound? If so, my problem has become much, much easier!