ソースを参照

fixing name, working on dumping

Luka Stanisic 9 年 前
コミット
c0d891b8fc
共有5 個のファイルを変更した27 個の追加7 個の削除を含む
  1. 1 1
      include/starpu_perfmodel.h
  2. 2 2
      src/core/perfmodel/perfmodel.c
  3. 11 4
      src/core/perfmodel/perfmodel_history.c
  4. 12 0
      src/core/perfmodel/regression.c
  5. 1 0
      src/core/perfmodel/regression.h

+ 1 - 1
include/starpu_perfmodel.h

@@ -121,7 +121,7 @@ enum starpu_perfmodel_type
 	STARPU_HISTORY_BASED,
 	STARPU_REGRESSION_BASED,
 	STARPU_NL_REGRESSION_BASED,
-	STARPU_MULITPLE_REGRESSION_BASED
+	STARPU_MULTIPLE_REGRESSION_BASED
 };
 
 struct _starpu_perfmodel_state;

+ 2 - 2
src/core/perfmodel/perfmodel.c

@@ -155,7 +155,7 @@ void _starpu_init_and_load_perfmodel(struct starpu_perfmodel *model)
 			_starpu_load_history_based_model(model, 1);
 			break;
 		case STARPU_REGRESSION_BASED:
-		case STARPU_MULITPLE_REGRESSION_BASED:
+		case STARPU_MULTIPLE_REGRESSION_BASED:
 			_starpu_load_history_based_model(model, 0);
 			break;
 
@@ -186,7 +186,7 @@ static double starpu_model_expected_perf(struct starpu_task *task, struct starpu
 				return _starpu_regression_based_job_expected_perf(model, arch, j, nimpl);
 			case STARPU_NL_REGRESSION_BASED:
 				return _starpu_non_linear_regression_based_job_expected_perf(model, arch, j,nimpl);
-			case STARPU_MULITPLE_REGRESSION_BASED:
+			case STARPU_MULTIPLE_REGRESSION_BASED:
 				return _starpu_multiple_regression_based_job_expected_perf(model, arch, j, nimpl);
 			default:
 				STARPU_ABORT();

+ 11 - 4
src/core/perfmodel/perfmodel_history.c

@@ -288,13 +288,20 @@ static void dump_reg_model(FILE *f, struct starpu_perfmodel *model, int comb, in
 	 * Multiple Regression Model
 	 */
 
-	fprintf(f, "# n \t\tintercept");
-	for (int i=0; i < reg_model->ncoeff; i++){
-		fprintf(f, " \t\tc%d", i);
+	if (reg_model->ncoeff==0)
+		reg_model->ncoeff = model->ncombinations + 1;
+
+	reg_model->coeff = (double *) malloc(reg_model->ncoeff*sizeof(double));
+	if (model->type == STARPU_MULTIPLE_REGRESSION_BASED)
+		_starpu_multiple_regression(per_arch_model->list, reg_model->coeff);
+
+	fprintf(f, "# n\tintercept");
+	for (int i=1; i < reg_model->ncoeff; i++){
+		fprintf(f, "\tc%d", i);
 	}
 	fprintf(f, "\n%u", reg_model->ncoeff);
 	for (int i=0; i < reg_model->ncoeff; i++){
-		fprintf(f, "%-15e\t\t", reg_model->coeff[i]);
+		fprintf(f, "\t%-15e", reg_model->coeff[i]);
 	}
 }
 #endif

+ 12 - 0
src/core/perfmodel/regression.c

@@ -222,3 +222,15 @@ int _starpu_regression_non_linear_power(struct starpu_perfmodel_history_list *pt
 
 	return 0;
 }
+
+// TODO
+int _starpu_multiple_regression(struct starpu_perfmodel_history_list *ptr, double *coefficients)
+{
+
+	coefficients[0]=0.664437;
+	coefficients[1]=0.0032;
+	coefficients[2]=0.0041;
+	coefficients[3]=0.0044;
+
+	return 0;
+}

+ 1 - 0
src/core/perfmodel/regression.h

@@ -25,5 +25,6 @@
 #include <starpu.h>
 
 int _starpu_regression_non_linear_power(struct starpu_perfmodel_history_list *ptr, double *a, double *b, double *c);
+int _starpu_multiple_regression(struct starpu_perfmodel_history_list *ptr, double *coefficients);
 
 #endif // __REGRESSION_H__