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.
In-Reply-To: 9704231933.AA27051@arachnophobia.MIT.EDU