Thread: Capturing Message Time

Hybrid View

Previous Post Previous Post   Next Post Next Post
  1. #1
    PhysicistTurnedProgrammer Cell's Avatar
    Join Date
    Jan 2009
    Location
    New Jersey
    Posts
    72
    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?

  2. #2
    PhysicistTurnedProgrammer Cell's Avatar
    Join Date
    Jan 2009
    Location
    New Jersey
    Posts
    72
    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!

Popular pages Recent additions subscribe to a feed

Similar Threads

  1. Desperate Over Ecs!
    By cookie in forum C Programming
    Replies: 17
    Last Post: 07-16-2008, 01:25 PM
  2. Making a script language?
    By Blackroot in forum Game Programming
    Replies: 10
    Last Post: 02-16-2006, 02:22 AM
  3. Read and set\change system time
    By Hexxx in forum C++ Programming
    Replies: 9
    Last Post: 01-02-2006, 07:11 AM
  4. Killing someones grandparents
    By nickname_changed in forum A Brief History of Cprogramming.com
    Replies: 37
    Last Post: 09-07-2003, 07:56 AM
  5. The Timing is incorret
    By Drew in forum C++ Programming
    Replies: 5
    Last Post: 08-28-2003, 04:57 PM