18.337 WebMeeting


Message from: Steven G. Johnson (stevenj@MIT.EDU)
About: Rules Clarifications: Timing

Wed, 23 Apr 97 15:33:09 EDT

  • Next message: Xiangwei Liu: "Rules Clarifications"
    The MFLOPS you are to output is the total MFLOPS of your
    program. i.e. this is # operations / wall-clock time in
    microseconds, where the number of operations is defined as
    2.0 * n1*n2*n3.

    Basically, I want to reward people who are able to make use
    of more processors. So, if you can use 8 processors and get
    linear speedup, you could theoretically get 8 times the
    MFLOPS of someone using only 1 processor.

    The best way I knew of when I wrote the rules was to get the
    wall-clock time used by the program was to take clock() and
    divide it by the number of processes. Not dividing it by
    the number of processes will give you the total CPU time,
    i.e. the wall-clock time multiplied by the number of
    processes.

    gethrtime() is Sun's nanosecond virtual timer. I wasn't
    sure if it reported the wall-clock time or the total CPU
    time, so I didn't mention it earlier. If, as you say, it is
    the wall-clock time, then I recommend using it instead of
    clock().

    CONCLUSIONS:

    So, the official recommendation at this point is to use
    gethrtime() instead of clock(). Note that gethrtime()
    returns the time in nanoseconds, so you will have to divide
    it by 1.0e9 instead of CLOCKS_PER_SEC as you did for
    clock().

    Note also that if gethrtime() returns the wall-clock time as
    Russell said, you should NOT divide it by the number of
    processes.

    Let me know if this doesn't work.

    Calling gethrtime():

    #include <sys/time.h>

    hrtime_t start_t,end_t;
    double secs; /* wall clock time in seconds */

    start_t = gethrtime();

    ...do stuff here...

    end_t = gethrtime();

    secs = (end_t - start_t) * 1.0e-9;

    Cordially,
    Steven G. Johnson

    ----
    NOTE: This message was sent using a WWW form. The address stevenj@mit.edu
    was typed manually, and may easily be incorrect.



    You may post a follow-up message or a new message. To send a reply directly to the author, you may click on the email address above.

    If you would like to submit a message using your own mail program, send it to: 18.337-wm@webmeet.mit.edu

    If you are following up this article, please include the following line at the beginning of your message:
    In-Reply-To: 9704231933.AA27051@arachnophobia.MIT.EDU