4949#define METH_JACOBI 2
5050#define FUNC_F0 1
5151#define FUNC_FPISIN 2
52- #define TERM_PREC 1
52+ #define TERM_ACC 1
5353#define TERM_ITER 2
5454
5555struct calculation_arguments
@@ -64,7 +64,7 @@ struct calculation_results
6464{
6565 uint64_t m ;
6666 uint64_t stat_iteration ; /* number of current iteration */
67- double stat_precision ; /* actual precision of all slaves in iteration */
67+ double stat_accuracy ; /* actual stat_accuracy of all slaves in iteration */
6868};
6969
7070struct options
@@ -75,7 +75,7 @@ struct options
7575 uint64_t inf_func ; /* inference function */
7676 uint64_t termination ; /* termination condition */
7777 uint64_t term_iteration ; /* terminate if iteration number reached */
78- double term_precision ; /* terminate if precision reached */
78+ double term_accuracy ; /* terminate if accuracy reached */
7979};
8080
8181/* ************************************************************************ */
@@ -89,7 +89,7 @@ struct timeval comp_time; /* time when calculation completed */
8989static void
9090usage (char * name )
9191{
92- printf ("Usage: %s [num] [method] [lines] [func] [term] [prec /iter]\n" , name );
92+ printf ("Usage: %s [num] [method] [lines] [func] [term] [acc /iter]\n" , name );
9393 printf ("\n" );
9494 printf (" - num: number of threads (1 .. %d)\n" , MAX_THREADS );
9595 printf (" - method: calculation method (1 .. 2)\n" );
@@ -101,10 +101,10 @@ usage(char* name)
101101 printf (" %1d: f(x,y) = 0\n" , FUNC_F0 );
102102 printf (" %1d: f(x,y) = 2 * pi^2 * sin(pi * x) * sin(pi * y)\n" , FUNC_FPISIN );
103103 printf (" - term: termination condition ( 1.. 2)\n" );
104- printf (" %1d: sufficient precision \n" , TERM_PREC );
104+ printf (" %1d: sufficient accuracy \n" , TERM_ACC );
105105 printf (" %1d: number of iterations\n" , TERM_ITER );
106- printf (" - prec /iter: depending on term:\n" );
107- printf (" precision: 1e-4 .. 1e-20\n" );
106+ printf (" - acc /iter: depending on term:\n" );
107+ printf (" accuracy: 1e-4 .. 1e-20\n" );
108108 printf (" iterations: 1 .. %d\n" , MAX_ITERATION );
109109 printf ("\n" );
110110 printf ("Example: %s 1 2 100 1 2 100 \n" , name );
@@ -155,19 +155,19 @@ askParams(struct options* options, int argc, char** argv)
155155
156156 ret = sscanf (argv [5 ], "%" SCNu64 , & (options -> termination ));
157157
158- if (ret != 1 || !(options -> termination == TERM_PREC || options -> termination == TERM_ITER ))
158+ if (ret != 1 || !(options -> termination == TERM_ACC || options -> termination == TERM_ITER ))
159159 {
160160 usage (argv [0 ]);
161161 exit (1 );
162162 }
163163
164- if (options -> termination == TERM_PREC )
164+ if (options -> termination == TERM_ACC )
165165 {
166- ret = sscanf (argv [6 ], "%lf" , & (options -> term_precision ));
166+ ret = sscanf (argv [6 ], "%lf" , & (options -> term_accuracy ));
167167
168168 options -> term_iteration = MAX_ITERATION ;
169169
170- if (ret != 1 || !(options -> term_precision >= 1e-20 && options -> term_precision <= 1e-4 ))
170+ if (ret != 1 || !(options -> term_accuracy >= 1e-20 && options -> term_accuracy <= 1e-4 ))
171171 {
172172 usage (argv [0 ]);
173173 exit (1 );
@@ -177,7 +177,7 @@ askParams(struct options* options, int argc, char** argv)
177177 {
178178 ret = sscanf (argv [6 ], "%" SCNu64 , & (options -> term_iteration ));
179179
180- options -> term_precision = 0 ;
180+ options -> term_accuracy = 0 ;
181181
182182 if (ret != 1 || !(options -> term_iteration >= 1 && options -> term_iteration <= MAX_ITERATION ))
183183 {
@@ -199,7 +199,7 @@ initVariables(struct calculation_arguments* arguments, struct calculation_result
199199
200200 results -> m = 0 ;
201201 results -> stat_iteration = 0 ;
202- results -> stat_precision = 0 ;
202+ results -> stat_accuracy = 0 ;
203203}
204204
205205/* ************************************************************************ */
@@ -352,7 +352,7 @@ calculate(struct calculation_arguments const* arguments, struct calculation_resu
352352 star += fpisin_i * sin (pih * (double )j );
353353 }
354354
355- if (options -> termination == TERM_PREC || term_iteration == 1 )
355+ if (options -> termination == TERM_ACC || term_iteration == 1 )
356356 {
357357 residuum = Matrix [m2 ][i ][j ] - star ;
358358 residuum = fabs (residuum );
@@ -364,17 +364,17 @@ calculate(struct calculation_arguments const* arguments, struct calculation_resu
364364 }
365365
366366 results -> stat_iteration ++ ;
367- results -> stat_precision = maxresiduum ;
367+ results -> stat_accuracy = maxresiduum ;
368368
369369 /* exchange m1 and m2 */
370370 i = m1 ;
371371 m1 = m2 ;
372372 m2 = i ;
373373
374374 /* check for stopping calculation depending on termination method */
375- if (options -> termination == TERM_PREC )
375+ if (options -> termination == TERM_ACC )
376376 {
377- if (maxresiduum < options -> term_precision )
377+ if (maxresiduum < options -> term_accuracy )
378378 {
379379 term_iteration = 0 ;
380380 }
@@ -426,7 +426,7 @@ displayStatistics(struct calculation_arguments const* arguments, struct calculat
426426 printf ("\n" );
427427 printf ("Terminierung: " );
428428
429- if (options -> termination == TERM_PREC )
429+ if (options -> termination == TERM_ACC )
430430 {
431431 printf ("Hinreichende Genaugkeit" );
432432 }
@@ -437,7 +437,7 @@ displayStatistics(struct calculation_arguments const* arguments, struct calculat
437437
438438 printf ("\n" );
439439 printf ("Anzahl Iterationen: %" PRIu64 "\n" , results -> stat_iteration );
440- printf ("Norm des Fehlers: %e\n" , results -> stat_precision );
440+ printf ("Norm des Fehlers: %e\n" , results -> stat_accuracy );
441441 printf ("\n" );
442442}
443443
0 commit comments