Racy Puppy Linux 5.3 is such a great programming eco-system that i am instantly converted from Windows XP-pro SP3
Among other things i love with computers is HPC (High Performance Computing)
One achievement i am proud of (found saturday 5 november 2005) :
These are 11 levels Absolute Difference triangles
For HPC purpose high precision benchmark is a must have. On windows i have always used printtsc so my benchmarks have cpu-clock accuracy. Because at this performance level almost no cpu-cycle can be wasted.
So one thing i miss is TSC
However i am sure this lack can be eliminated because you will cool guys at murga-linux
Of course if you provide me a TSC console command then i will reward you with more amazing Absolute Difference triangles.
How to rdtsc ? [SOLVED]
How to rdtsc ? [SOLVED]
Last edited by SpiceGuid on Mon 18 Feb 2013, 02:15, edited 2 times in total.
Ok, thanks to you.
Unfortunately the story is not over :
It seems to me you overlook the HPC problems.
The time is a MHz-dependant information. Moreover cpu frequency can scale up or down. So time is just an inaccurate performance measurement.
The TSC is a MHz-independant information.
More importantly, i have a need to access clock information while the program is progressing, not only when it is terminated. The motivation is the program is so loooooooong hence it displays certain progress information. The time when a certain computation step occurs really matters.
I need to know if the program will terminate after the sun explodes or before i turn 50 It makes a huge difference, isn't it ? The time command will not tell me that information. Or it will tell it long after i am died
Conclusion : i still have a need to display the cpu TSC.
Edit: i finally wrote the code myself, just have to test it
Unfortunately the story is not over :
It seems to me you overlook the HPC problems.
The time is a MHz-dependant information. Moreover cpu frequency can scale up or down. So time is just an inaccurate performance measurement.
The TSC is a MHz-independant information.
More importantly, i have a need to access clock information while the program is progressing, not only when it is terminated. The motivation is the program is so loooooooong hence it displays certain progress information. The time when a certain computation step occurs really matters.
I need to know if the program will terminate after the sun explodes or before i turn 50 It makes a huge difference, isn't it ? The time command will not tell me that information. Or it will tell it long after i am died
Conclusion : i still have a need to display the cpu TSC.
Edit: i finally wrote the code myself, just have to test it
Code: Select all
// gcc -o rdtsc rdtsc.c
#include <inttypes.h>
#include <stdint.h>
#include <stdio.h>
static __inline__ uint64_t rdtsc(void)
{
uint32_t a, d;
asm("cpuid");
asm volatile("rdtsc" : "=a" (a), "=d" (d));
return (((uint64_t)a) | (((uint64_t)d) << 32));
}
int main()
{
uint64_t clock;
clock = rdtsc();
printf("%llu\n",clock);
return 0;
}