|
@@ -152,12 +152,14 @@ static void scan_reg_model(FILE *f, struct starpu_perfmodel_regression_model *re
|
|
|
|
|
|
_starpu_drop_comments(f);
|
|
_starpu_drop_comments(f);
|
|
|
|
|
|
- res = fscanf(f, "%le\t%le\t%le\t%le\t%le\t%le\t%u\t%lu\t%lu\n",
|
|
|
|
- ®_model->sumlnx, ®_model->sumlnx2, ®_model->sumlny,
|
|
|
|
- ®_model->sumlnxlny, ®_model->alpha, ®_model->beta,
|
|
|
|
- ®_model->nsample,
|
|
|
|
- ®_model->minx, ®_model->maxx);
|
|
|
|
- STARPU_ASSERT_MSG(res == 9, "Incorrect performance model file");
|
|
|
|
|
|
+ res = fscanf(f, "%le\t%le\t%le\t%le", ®_model->sumlnx, ®_model->sumlnx2, ®_model->sumlny, ®_model->sumlnxlny);
|
|
|
|
+ STARPU_ASSERT_MSG(res == 4, "Incorrect performance model file");
|
|
|
|
+ res = _starpu_read_double(f, "\t%le", ®_model->alpha);
|
|
|
|
+ STARPU_ASSERT_MSG(res == 1, "Incorrect performance model file");
|
|
|
|
+ res = _starpu_read_double(f, "\t%le", ®_model->beta);
|
|
|
|
+ STARPU_ASSERT_MSG(res == 1, "Incorrect performance model file");
|
|
|
|
+ res = fscanf(f, "\t%u\t%lu\t%lu\n", ®_model->nsample, ®_model->minx, ®_model->maxx);
|
|
|
|
+ STARPU_ASSERT_MSG(res == 3, "Incorrect performance model file");
|
|
|
|
|
|
/* If any of the parameters describing the linear regression model is NaN, the model is invalid */
|
|
/* If any of the parameters describing the linear regression model is NaN, the model is invalid */
|
|
unsigned invalid = (isnan(reg_model->alpha)||isnan(reg_model->beta));
|
|
unsigned invalid = (isnan(reg_model->alpha)||isnan(reg_model->beta));
|
|
@@ -169,8 +171,12 @@ static void scan_reg_model(FILE *f, struct starpu_perfmodel_regression_model *re
|
|
|
|
|
|
_starpu_drop_comments(f);
|
|
_starpu_drop_comments(f);
|
|
|
|
|
|
- res = fscanf(f, "%le\t%le\t%le\n", ®_model->a, ®_model->b, ®_model->c);
|
|
|
|
- STARPU_ASSERT_MSG(res == 3, "Incorrect performance model file");
|
|
|
|
|
|
+ res = _starpu_read_double(f, "%le\t", ®_model->a);
|
|
|
|
+ STARPU_ASSERT_MSG(res == 1, "Incorrect performance model file");
|
|
|
|
+ res = _starpu_read_double(f, "%le\t", ®_model->b);
|
|
|
|
+ STARPU_ASSERT_MSG(res == 1, "Incorrect performance model file");
|
|
|
|
+ res = _starpu_read_double(f, "%le\n", ®_model->c);
|
|
|
|
+ STARPU_ASSERT_MSG(res == 1, "Incorrect performance model file");
|
|
|
|
|
|
/* If any of the parameters describing the non-linear regression model is NaN, the model is invalid */
|
|
/* If any of the parameters describing the non-linear regression model is NaN, the model is invalid */
|
|
unsigned nl_invalid = (isnan(reg_model->a)||isnan(reg_model->b)||isnan(reg_model->c));
|
|
unsigned nl_invalid = (isnan(reg_model->a)||isnan(reg_model->b)||isnan(reg_model->c));
|