Browse Source

Prefixing of src/core/perfmodel/perfmodel.h

find . -type f -not -name "*svn*"|xargs sed -i s/"\bhistory_based_job_expected_length\b"/_starpu_history_based_job_expected_length/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bregister_model\b"/_starpu_register_model/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bdump_registered_models\b"/_starpu_dump_registered_models/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bjob_expected_length\b"/_starpu_job_expected_length/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bregression_based_job_expected_length\b"/_starpu_regression_based_job_expected_length/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bdata_expected_penalty\b"/_starpu_data_expected_penalty/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bcreate_sampling_directory_if_needed\b"/_starpu_create_sampling_directory_if_needed/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bload_bus_performance_files\b"/_starpu_load_bus_performance_files/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bpredict_transfer_time\b"/_starpu_predict_transfer_time/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bget_gpu_affinity_vector\b"/_starpu_get_gpu_affinity_vector/g
Nathalie Furmento 15 years ago
parent
commit
0133a6d5c2

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

@@ -42,7 +42,7 @@ static double per_arch_task_expected_length(struct starpu_perfmodel_t *model, en
 			model->benchmarking = 0;
 		}
 		
-		register_model(model);
+		_starpu_register_model(model);
 		model->is_loaded = 1;
 	}
 
@@ -86,7 +86,7 @@ static double common_task_expected_length(struct starpu_perfmodel_t *model, uint
 	return -1.0;
 }
 
-double job_expected_length(uint32_t who, struct starpu_job_s *j, enum starpu_perf_archtype arch)
+double _starpu_job_expected_length(uint32_t who, struct starpu_job_s *j, enum starpu_perf_archtype arch)
 {
 	struct starpu_task *task = j->task;
 	struct starpu_perfmodel_t *model = task->cl->model;
@@ -100,10 +100,10 @@ double job_expected_length(uint32_t who, struct starpu_job_s *j, enum starpu_per
 				return common_task_expected_length(model, who, task);
 
 			case STARPU_HISTORY_BASED:
-				return history_based_job_expected_length(model, arch, j);
+				return _starpu_history_based_job_expected_length(model, arch, j);
 
 			case STARPU_REGRESSION_BASED:
-				return regression_based_job_expected_length(model, arch, j);
+				return _starpu_regression_based_job_expected_length(model, arch, j);
 
 			default:
 				STARPU_ABORT();
@@ -115,7 +115,7 @@ double job_expected_length(uint32_t who, struct starpu_job_s *j, enum starpu_per
 }
 
 /* Data transfer performance modeling */
-double data_expected_penalty(struct jobq_s *q, struct starpu_task *task)
+double _starpu_data_expected_penalty(struct jobq_s *q, struct starpu_task *task)
 {
 	uint32_t memory_node = q->memory_node;
 	unsigned nbuffers = task->cl->nbuffers;
@@ -136,7 +136,7 @@ double data_expected_penalty(struct jobq_s *q, struct starpu_task *task)
 
 			uint32_t src_node = _starpu_select_src_node(handle);
 
-			penalty += predict_transfer_time(src_node, memory_node, size);
+			penalty += _starpu_predict_transfer_time(src_node, memory_node, size);
 		}
 	}
 
@@ -181,7 +181,7 @@ void _starpu_get_perf_model_dir_debug(char *path, size_t maxlen)
 	strncat(path, "debug/", maxlen);
 }
 
-void create_sampling_directory_if_needed(void)
+void _starpu_create_sampling_directory_if_needed(void)
 {
 	if (!directory_existence_was_tested)
 	{

+ 10 - 10
src/core/perfmodel/perfmodel.h

@@ -86,25 +86,25 @@ void _starpu_get_perf_model_dir_codelets(char *path, size_t maxlen);
 void _starpu_get_perf_model_dir_bus(char *path, size_t maxlen);
 void _starpu_get_perf_model_dir_debug(char *path, size_t maxlen);
 
-double history_based_job_expected_length(struct starpu_perfmodel_t *model, enum starpu_perf_archtype arch, struct starpu_job_s *j);
-void register_model(struct starpu_perfmodel_t *model);
-void dump_registered_models(void);
+double _starpu_history_based_job_expected_length(struct starpu_perfmodel_t *model, enum starpu_perf_archtype arch, struct starpu_job_s *j);
+void _starpu_register_model(struct starpu_perfmodel_t *model);
+void _starpu_dump_registered_models(void);
 
-double job_expected_length(uint32_t who, struct starpu_job_s *j, enum starpu_perf_archtype arch);
-double regression_based_job_expected_length(struct starpu_perfmodel_t *model,
+double _starpu_job_expected_length(uint32_t who, struct starpu_job_s *j, enum starpu_perf_archtype arch);
+double _starpu_regression_based_job_expected_length(struct starpu_perfmodel_t *model,
 		uint32_t who, struct starpu_job_s *j);
 void _starpu_update_perfmodel_history(struct starpu_job_s *j, enum starpu_perf_archtype arch,
 				unsigned cpuid, double measured);
 
-double data_expected_penalty(struct jobq_s *q, struct starpu_task *task);
+double _starpu_data_expected_penalty(struct jobq_s *q, struct starpu_task *task);
 
-void create_sampling_directory_if_needed(void);
+void _starpu_create_sampling_directory_if_needed(void);
 
-void load_bus_performance_files(void);
-double predict_transfer_time(unsigned src_node, unsigned dst_node, size_t size);
+void _starpu_load_bus_performance_files(void);
+double _starpu_predict_transfer_time(unsigned src_node, unsigned dst_node, size_t size);
 
 #ifdef STARPU_USE_CUDA
-int *get_gpu_affinity_vector(unsigned gpuid);
+int *_starpu_get_gpu_affinity_vector(unsigned gpuid);
 #endif
  
 #endif // __PERFMODEL_H__

+ 5 - 5
src/core/perfmodel/perfmodel_bus.c

@@ -372,7 +372,7 @@ static void load_bus_affinity_file(void)
 	load_bus_affinity_file_content();
 }
 
-int *get_gpu_affinity_vector(unsigned gpuid)
+int *_starpu_get_gpu_affinity_vector(unsigned gpuid)
 {
 	return affinity_matrix[gpuid];
 }
@@ -623,23 +623,23 @@ static void load_bus_bandwith_file(void)
 
 void starpu_force_bus_sampling(void)
 {
-	create_sampling_directory_if_needed();
+	_starpu_create_sampling_directory_if_needed();
 
 	generate_bus_affinity_file();
 	generate_bus_latency_file();
 	generate_bus_bandwith_file();
 }
 
-void load_bus_performance_files(void)
+void _starpu_load_bus_performance_files(void)
 {
-	create_sampling_directory_if_needed();
+	_starpu_create_sampling_directory_if_needed();
 
 	load_bus_affinity_file();
 	load_bus_latency_file();
 	load_bus_bandwith_file();
 }
 
-double predict_transfer_time(unsigned src_node, unsigned dst_node, size_t size)
+double _starpu_predict_transfer_time(unsigned src_node, unsigned dst_node, size_t size)
 {
 	double bandwith = bandwith_matrix[src_node][dst_node];
 	double latency = latency_matrix[src_node][dst_node];

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

@@ -208,7 +208,7 @@ static void get_model_debug_path(struct starpu_perfmodel_t *model, const char *a
 	strncat(path, ".debug", maxlen);
 }
 
-void register_model(struct starpu_perfmodel_t *model)
+void _starpu_register_model(struct starpu_perfmodel_t *model)
 {
 	/* add the model to a linked list */
 	struct starpu_model_list_t *node = malloc(sizeof(struct starpu_model_list_t));
@@ -221,7 +221,7 @@ void register_model(struct starpu_perfmodel_t *model)
 	registered_models = node;
 
 #ifdef STARPU_MODEL_DEBUG
-	create_sampling_directory_if_needed();
+	_starpu_create_sampling_directory_if_needed();
 
 	unsigned arch;
 	for (arch = 0; arch < NARCH_VARIATIONS; arch++)
@@ -278,7 +278,7 @@ static void save_history_based_model(struct starpu_perfmodel_t *model)
 #endif
 }
 
-void dump_registered_models(void)
+void _starpu_dump_registered_models(void)
 {
 	struct starpu_model_list_t *node;
 	node = registered_models;
@@ -331,13 +331,13 @@ static void load_history_based_model(struct starpu_perfmodel_t *model, unsigned
 	}
 
 	/* make sure the performance model directory exists (or create it) */
-	create_sampling_directory_if_needed();
+	_starpu_create_sampling_directory_if_needed();
 
 	/*
 	 * We need to keep track of all the model that were opened so that we can 
 	 * possibly update them at runtime termination ...
 	 */
-	register_model(model);
+	_starpu_register_model(model);
 
 	char path[256];
 	get_model_path(model, path, 256);
@@ -482,7 +482,7 @@ void starpu_perfmodel_debugfilepath(struct starpu_perfmodel_t *model,
 	get_model_debug_path(model, archname, path, maxlen);
 }
 
-double regression_based_job_expected_length(struct starpu_perfmodel_t *model, enum starpu_perf_archtype arch, struct starpu_job_s *j)
+double _starpu_regression_based_job_expected_length(struct starpu_perfmodel_t *model, enum starpu_perf_archtype arch, struct starpu_job_s *j)
 {
 	double exp = -1.0;
 	size_t size = _starpu_job_get_data_size(j);
@@ -499,7 +499,7 @@ double regression_based_job_expected_length(struct starpu_perfmodel_t *model, en
 	return exp;
 }
 
-double history_based_job_expected_length(struct starpu_perfmodel_t *model, enum starpu_perf_archtype arch, struct starpu_job_s *j)
+double _starpu_history_based_job_expected_length(struct starpu_perfmodel_t *model, enum starpu_perf_archtype arch, struct starpu_job_s *j)
 {
 	double exp;
 	struct starpu_per_arch_perfmodel_t *per_arch_model;

+ 2 - 2
src/core/policies/deque-modeling-policy-data-aware.c

@@ -91,11 +91,11 @@ static int _dmda_push_task(struct jobq_s *q __attribute__ ((unused)) , starpu_jo
 			continue;
 		}
 
-		local_task_length[worker] = job_expected_length(queue_array[worker]->who,
+		local_task_length[worker] = _starpu_job_expected_length(queue_array[worker]->who,
 							j, queue_array[worker]->arch);
 
 		//local_data_penalty[worker] = 0;
-		local_data_penalty[worker] = data_expected_penalty(queue_array[worker], task);
+		local_data_penalty[worker] = _starpu_data_expected_penalty(queue_array[worker], task);
 
 		if (local_task_length[worker] == -1.0)
 		{

+ 1 - 1
src/core/policies/deque-modeling-policy.c

@@ -91,7 +91,7 @@ static int _dm_push_task(struct jobq_s *q __attribute__ ((unused)), starpu_job_t
 			continue;
 		}
 
-		double local_length = job_expected_length(queue_array[worker]->who, j, queue_array[worker]->arch);
+		double local_length = _starpu_job_expected_length(queue_array[worker]->who, j, queue_array[worker]->arch);
 
 		if (local_length == -1.0) 
 		{

+ 1 - 1
src/core/topology.c

@@ -497,7 +497,7 @@ static void _starpu_init_workers_binding(struct starpu_machine_config_s *config)
 				if (may_bind_automatically)
 				{
 					/* StarPU is allowed to bind threads automatically */
-					preferred_binding = get_gpu_affinity_vector(workerarg->id);
+					preferred_binding = _starpu_get_gpu_affinity_vector(workerarg->id);
 					npreferred = config->nhwcpus;
 				}
 				is_a_set_of_accelerators = 0;

+ 2 - 2
src/core/workers.c

@@ -231,7 +231,7 @@ int starpu_init(struct starpu_conf *user_conf)
 
 	timing_init();
 
-	load_bus_performance_files();
+	_starpu_load_bus_performance_files();
 
 	/* store the pointer to the user explicit configuration during the
 	 * initialization */
@@ -440,7 +440,7 @@ void starpu_shutdown(void)
 #endif
 
 	if (starpu_get_env_number("STARPU_CALIBRATE") != -1)
-		dump_registered_models();
+		_starpu_dump_registered_models();
 
 	/* wait for their termination */
 	_starpu_terminate_workers(&config);