Commit 73f78a16064f590e258b0e2040e1bc2e6465e04a

Authored by Alexander Smirnov
1 parent fca93aa9
Exists in master

corrected SECOND_PART

Showing 3 changed files with 5 additions and 4 deletions   Show diff stats
f.cpp
... ... @@ -11,8 +11,8 @@ void wait ( int time )
11 11 float c;
12 12 for (long int i=0;i!=(HHERZ/3)*seconds;++i) c=a*b;
13 13 */
14   - struct timespec reqtime; reqtime.tv_sec = time/10000;
15   - reqtime.tv_nsec = 1000000 * (time%10000);
  14 + struct timespec reqtime; reqtime.tv_sec = time/SECOND_PART;
  15 + reqtime.tv_nsec = (1000000000/SECOND_PART) * (time%SECOND_PART);
16 16 nanosleep(&reqtime, NULL);
17 17 }
18 18  
... ...
1 1 #ifndef fhh
2 2 #define fhh
  3 +#define SECOND_PART 10000
3 4  
4 5 #define HHERZ 1000000000
5 6 double f(double* x,int time);
... ...
main.cpp
... ... @@ -75,7 +75,7 @@ void evaluate(int64_t M, int time) {
75 75  
76 76  
77 77 if(k==0) {
78   - printf("%d %ld %f %f %f %f %f\n",step,M_corrected,(float)M_corrected/(ttime),(float)M_corrected*time/(ttime*step*1000),(float) ttime,1-total,(float)time/10000);
  78 + printf("%d %ld %f %f %f %f %f\n",step,M_corrected,(float)M_corrected/(ttime),(float)M_corrected*time/(ttime*step*SECOND_PART),(float) ttime,1-total,(float)time/SECOND_PART);
79 79 // processes, points, performance (calculations per second), effectiveness, time, error, time for single point
80 80 fflush(stdout);
81 81 }
... ... @@ -88,7 +88,7 @@ int main(int argc, char *argv[])
88 88 {
89 89  
90 90 if (argc<2) {
91   - printf("Usage: num_test <number of points> (can be mupltiple, time is fixed at 0.1 seconds) or num_test N <number of points> <time> measured in 0.0001 sec, can be multiple\n");
  91 + printf("Usage: num_test <number of points> (can be mupltiple, time is fixed at 1/%d seconds) or num_test N <number of points> <time> measured in 0.0001 sec, can be multiple\n",SECOND_PART);
92 92 return -1;
93 93 }
94 94  
... ...