[Beowulf] Liinpack benchmark

balamurugan rbala at hclinsys.com
Thu Nov 10 22:42:25 PST 2005


Jakob Oestergaard wrote:

>On Tue, Nov 01, 2005 at 07:09:39PM +0300, Mikhail Kuzminsky wrote:
>  
>
>>In message from balamurugan <rbala at hclinsys.com> (Mon, 31 Oct 2005 
>>15:06:11 +0530):
>>    
>>
>>>Dear all,
>>>Iam trying to benchmark a Xeon processor (Dual core) machine with 
>>>linpack (n=100) fortran code on Red Hat linux AS 4. The result gives 
>>>zero values for some calls. The details in the internet say that it 
>>>may be due to low resolution of the timing function. Can you help me 
>>>tuning the resolution of second function.
>>>      
>>>
>>You should use gettimeofday()- based or RDTSC-based timer.
>>    
>>
>
>Is the TSC synced between the cores on the Xeon?  If not, then simple
>rdtsc based timing is going to be unreliable.  (It's possible of course,
>with many repeated tests and outlier elimination to disregard the tests
>where the thread switched core).
>
>I know the TSC isn't synced between cores on dual core Opteron, it's not
>synced on plain SMP (multiple sigle-core processors) and given that the
>dual core Xeon is pretty much just two Xeons shoe-horned into one
>package, I doubt it would be synced there.  (But, as always, would love
>to be corrected, should I be wrong :)
>
>gettimeofday() is definitely a very good suggestion.
>
>  
>
I had used the gettimeofday() function for the benchmark and is working 
well with a C code where in the gettimeofday() function and its calling 
function are in the same file or gettimeofday() function is included as 
a preprocessor directive. But when i tried to link the same C code with 
the fortran code, i was not successful. I am not sure what is wrong with 
the steps that i follow.

1. I have written a "C" code mysecond.c

# include <stdio.h>
# include <sys/time.h>
# include <math.h>
extern double end;
double mysecond_()
{
struct timeval tv;
double times[2];
gettimeofday(&tv, NULL);
times[0] = tv.tv_sec;
times[1] = tv.tv_usec;
end=((times[0]*1.e6) + times[1]);
end=(double)end/1.e6;
return end;
}

2. I have compiled it to create a "mysecond.o" file.
3. I have changed all the second call in the fortran file to mysecond
4. I compiled the fortran file (double100.f) with the c object file to 
create an executable
f77 -O3 double100.f mysecond.o
5. There was no errors or warnings during compilation and the executable 
ran successfully, but the result was not the one expected to be produced 
and had negative values. I understand from analysis that the there could 
be a problem in linking the c file and the fortran code.
6. Is there any way to get around this problem.


Balamurugan.R




More information about the Beowulf mailing list