ソースを参照

perfmodel: rename struct starpu_history_entry to struct starpu_perfmodel_history_entry

Nathalie Furmento 13 年 前
コミット
cdfd9e855f
共有5 個のファイルを変更した14 個の追加13 個の削除を含む
  1. 2 2
      include/starpu_perfmodel.h
  2. 9 9
      src/core/perfmodel/perfmodel_history.c
  3. 1 1
      src/core/perfmodel/perfmodel_print.c
  4. 1 0
      tools/dev/rename.sed
  5. 1 1
      tools/starpu_perfmodel_plot.c

+ 2 - 2
include/starpu_perfmodel.h

@@ -72,7 +72,7 @@ _Static_assert(STARPU_CUDA_DEFAULT < STARPU_OPENCL_DEFAULT,
 
 #define STARPU_NARCH_VARIATIONS	(STARPU_GORDON_DEFAULT+1)
 
-struct starpu_history_entry
+struct starpu_perfmodel_history_entry
 {
 	//double measured;
 
@@ -111,7 +111,7 @@ struct starpu_history_entry
 struct starpu_perfmodel_history_list
 {
 	struct starpu_perfmodel_history_list *next;
-	struct starpu_history_entry *entry;
+	struct starpu_perfmodel_history_entry *entry;
 };
 
 struct starpu_regression_model

+ 9 - 9
src/core/perfmodel/perfmodel_history.c

@@ -43,7 +43,7 @@ struct starpu_history_table
 {
 	UT_hash_handle hh;
 	uint32_t footprint;
-	struct starpu_history_entry *history_entry;
+	struct starpu_perfmodel_history_entry *history_entry;
 };
 
 /* We want more than 10% variance on X to trust regression */
@@ -56,7 +56,7 @@ static struct _starpu_perfmodel_list *registered_models = NULL;
 /*
  * History based model
  */
-static void insert_history_entry(struct starpu_history_entry *entry, struct starpu_perfmodel_history_list **list, struct starpu_history_table **history_ptr)
+static void insert_history_entry(struct starpu_perfmodel_history_entry *entry, struct starpu_perfmodel_history_list **list, struct starpu_history_table **history_ptr)
 {
 	struct starpu_perfmodel_history_list *link;
 	struct starpu_history_table *table;
@@ -151,12 +151,12 @@ static void scan_reg_model(FILE *f, struct starpu_regression_model *reg_model)
 	reg_model->nl_valid = !nl_invalid && VALID_REGRESSION(reg_model);
 }
 
-static void dump_history_entry(FILE *f, struct starpu_history_entry *entry)
+static void dump_history_entry(FILE *f, struct starpu_perfmodel_history_entry *entry)
 {
 	fprintf(f, "%08x\t%-15lu\t%-15le\t%-15le\t%-15le\t%-15le\t%u\n", entry->footprint, (unsigned long) entry->size, entry->mean, entry->deviation, entry->sum, entry->sum2, entry->nsample);
 }
 
-static void scan_history_entry(FILE *f, struct starpu_history_entry *entry)
+static void scan_history_entry(FILE *f, struct starpu_perfmodel_history_entry *entry)
 {
 	int res;
 
@@ -210,10 +210,10 @@ static void parse_per_arch_model_file(FILE *f, struct starpu_per_arch_perfmodel
 	unsigned i;
 	for (i = 0; i < nentries; i++)
 	{
-		struct starpu_history_entry *entry = NULL;
+		struct starpu_perfmodel_history_entry *entry = NULL;
 		if (scan_history)
 		{
-			entry = (struct starpu_history_entry *) malloc(sizeof(struct starpu_history_entry));
+			entry = (struct starpu_perfmodel_history_entry *) malloc(sizeof(struct starpu_perfmodel_history_entry));
 			STARPU_ASSERT(entry);
 		}
 
@@ -1019,7 +1019,7 @@ double _starpu_history_based_job_expected_perf(struct starpu_perfmodel *model, e
 {
 	double exp;
 	struct starpu_per_arch_perfmodel *per_arch_model;
-	struct starpu_history_entry *entry;
+	struct starpu_perfmodel_history_entry *entry;
 	struct starpu_history_table *history, *elt;
 
 	uint32_t key = _starpu_compute_buffers_footprint(model, arch, nimpl, j);
@@ -1068,7 +1068,7 @@ void _starpu_update_perfmodel_history(struct _starpu_job *j, struct starpu_perfm
 
 		if (model->type == STARPU_HISTORY_BASED || model->type == STARPU_NL_REGRESSION_BASED)
 		{
-			struct starpu_history_entry *entry;
+			struct starpu_perfmodel_history_entry *entry;
 			struct starpu_history_table *elt;
 			struct starpu_perfmodel_history_list **list;
 			uint32_t key = _starpu_compute_buffers_footprint(model, arch, nimpl, j);
@@ -1081,7 +1081,7 @@ void _starpu_update_perfmodel_history(struct _starpu_job *j, struct starpu_perfm
 			if (!entry)
 			{
 				/* this is the first entry with such a footprint */
-				entry = (struct starpu_history_entry *) malloc(sizeof(struct starpu_history_entry));
+				entry = (struct starpu_perfmodel_history_entry *) malloc(sizeof(struct starpu_perfmodel_history_entry));
 				STARPU_ASSERT(entry);
 				entry->mean = measured;
 				entry->sum = measured;

+ 1 - 1
src/core/perfmodel/perfmodel_print.c

@@ -32,7 +32,7 @@ void _starpu_perfmodel_print_history_based(struct starpu_per_arch_perfmodel *per
 
 	while (ptr)
 	{
-		struct starpu_history_entry *entry = ptr->entry;
+		struct starpu_perfmodel_history_entry *entry = ptr->entry;
 		if (!footprint || entry->footprint == *footprint)
 		{
 			if (!parameter)

+ 1 - 0
tools/dev/rename.sed

@@ -14,6 +14,7 @@
 #
 # See the GNU Lesser General Public License in COPYING.LGPL for more details.
 
+s/\bstruct starpu_history_entry\b/struct starpu_perfmodel_history_entry/g
 s/\bstruct starpu_history_list\b/struct starpu_perfmodel_history_list/g
 s/\bstarpu_list_models\b/starpu_perfmodel_list/g
 s/\bstruct starpu_model_list\b/struct _starpu_perfmodel_list/g

+ 1 - 1
tools/starpu_perfmodel_plot.c

@@ -271,7 +271,7 @@ static void display_history_based_perf_models(FILE *gnuplot_file, struct starpu_
 			for (implid = 0; implid < STARPU_MAXIMPLEMENTATIONS; implid++) {
 				struct starpu_per_arch_perfmodel *arch_model = &model->per_arch[arch][implid];
 				for (ptr = arch_model->list; ptr; ptr = ptr->next) {
-					struct starpu_history_entry *entry = ptr->entry;
+					struct starpu_perfmodel_history_entry *entry = ptr->entry;
 					if (entry->size == minimum) {
 						fprintf(datafile, "\t%-15le\t%-15le", 0.001*entry->mean, 0.001*entry->deviation);
 						break;