Bladeren bron

Type renaming:

     s/\bstarpu_machine_topology_s\b/starpu_machine_topology/g
Nathalie Furmento 13 jaren geleden
bovenliggende
commit
87ad636148

+ 2 - 2
examples/scheduler/dummy_sched.c

@@ -26,7 +26,7 @@ struct starpu_task_list sched_list;
 static pthread_cond_t sched_cond;
 static pthread_mutex_t sched_mutex;
 
-static void init_dummy_sched(struct starpu_machine_topology_s *topology,
+static void init_dummy_sched(struct starpu_machine_topology *topology,
 			struct starpu_sched_policy *policy)
 {
 	/* Create a linked-list of tasks and a condition variable to protect it */
@@ -42,7 +42,7 @@ static void init_dummy_sched(struct starpu_machine_topology_s *topology,
 	FPRINTF(stderr, "Initialising Dummy scheduler\n");
 }
 
-static void deinit_dummy_sched(struct starpu_machine_topology_s *topology,
+static void deinit_dummy_sched(struct starpu_machine_topology *topology,
 				struct starpu_sched_policy *policy)
 {
 	STARPU_ASSERT(starpu_task_list_empty(&sched_list));

+ 3 - 3
include/starpu_scheduler.h

@@ -36,7 +36,7 @@ extern "C" {
 
 struct starpu_task;
 
-struct starpu_machine_topology_s {
+struct starpu_machine_topology {
 	unsigned nworkers;
 
 	unsigned ncombinedworkers;
@@ -72,10 +72,10 @@ struct starpu_machine_topology_s {
  * field of the starpu_conf structure passed to the starpu_init function. */
 struct starpu_sched_policy {
 	/* Initialize the scheduling policy. */
-	void (*init_sched)(struct starpu_machine_topology_s *, struct starpu_sched_policy *);
+	void (*init_sched)(struct starpu_machine_topology *, struct starpu_sched_policy *);
 
 	/* Cleanup the scheduling policy. */
-	void (*deinit_sched)(struct starpu_machine_topology_s *, struct starpu_sched_policy *);
+	void (*deinit_sched)(struct starpu_machine_topology *, struct starpu_sched_policy *);
 
 	/* Insert a task into the scheduler. */
 	int (*push_task)(struct starpu_task *);

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

@@ -1203,7 +1203,7 @@ double _starpu_predict_transfer_time(unsigned src_node, unsigned dst_node, size_
 {
 	double bandwidth = bandwidth_matrix[src_node][dst_node];
 	double latency = latency_matrix[src_node][dst_node];
-	struct starpu_machine_topology_s *topology = &_starpu_get_machine_config()->topology;
+	struct starpu_machine_topology *topology = &_starpu_get_machine_config()->topology;
 
 	return latency + (size/bandwidth)*2*(topology->ncudagpus+topology->nopenclgpus);
 }

+ 6 - 6
src/core/topology.c

@@ -67,7 +67,7 @@ static unsigned may_bind_automatically = 0;
 #ifdef STARPU_USE_CUDA
 static void _starpu_initialize_workers_cuda_gpuid(struct starpu_machine_config_s *config)
 {
-	struct starpu_machine_topology_s *topology = &config->topology;
+	struct starpu_machine_topology *topology = &config->topology;
 
         _starpu_initialize_workers_gpuid(config->user_conf==NULL?0:config->user_conf->use_explicit_workers_cuda_gpuid,
                                          config->user_conf==NULL?NULL:(int *)config->user_conf->workers_cuda_gpuid,
@@ -79,7 +79,7 @@ static void _starpu_initialize_workers_cuda_gpuid(struct starpu_machine_config_s
 #ifdef STARPU_USE_OPENCL
 static void _starpu_initialize_workers_opencl_gpuid(struct starpu_machine_config_s *config)
 {
-	struct starpu_machine_topology_s *topology = &config->topology;
+	struct starpu_machine_topology *topology = &config->topology;
 
         _starpu_initialize_workers_gpuid(config->user_conf==NULL?0:config->user_conf->use_explicit_workers_opencl_gpuid,
                                          config->user_conf==NULL?NULL:(int *)config->user_conf->workers_opencl_gpuid,
@@ -218,7 +218,7 @@ static inline int _starpu_get_next_opencl_gpuid(struct starpu_machine_config_s *
 
 static void _starpu_init_topology(struct starpu_machine_config_s *config)
 {
-	struct starpu_machine_topology_s *topology = &config->topology;
+	struct starpu_machine_topology *topology = &config->topology;
 
 	if (!topology_is_initialized)
 	{
@@ -276,7 +276,7 @@ static int _starpu_init_machine_config(struct starpu_machine_config_s *config,
 	for (i = 0; i < STARPU_NMAXWORKERS; i++)
 		config->workers[i].workerid = i;
 
-	struct starpu_machine_topology_s *topology = &config->topology;
+	struct starpu_machine_topology *topology = &config->topology;
 
 	topology->nworkers = 0;
 	topology->ncombinedworkers = 0;
@@ -486,7 +486,7 @@ static void _starpu_initialize_workers_bindid(struct starpu_machine_config_s *co
 	char *strval;
 	unsigned i;
 
-	struct starpu_machine_topology_s *topology = &config->topology;
+	struct starpu_machine_topology *topology = &config->topology;
 
 	config->current_bindid = 0;
 
@@ -556,7 +556,7 @@ static void _starpu_initialize_workers_bindid(struct starpu_machine_config_s *co
 static inline int _starpu_get_next_bindid(struct starpu_machine_config_s *config,
 				int *preferred_binding, int npreferred)
 {
-	struct starpu_machine_topology_s *topology = &config->topology;
+	struct starpu_machine_topology *topology = &config->topology;
 
 	unsigned found = 0;
 	int current_preferred;

+ 1 - 1
src/core/workers.h

@@ -119,7 +119,7 @@ struct starpu_worker_set_s {
 
 struct starpu_machine_config_s {
 
-	struct starpu_machine_topology_s topology;
+	struct starpu_machine_topology topology;
 
 #ifdef STARPU_HAVE_HWLOC
 	int cpu_depth;

+ 3 - 3
src/sched_policies/deque_modeling_policy_data_aware.c

@@ -569,7 +569,7 @@ static int dmda_push_task(struct starpu_task *task)
 	return _dmda_push_task(task, 0);
 }
 
-static void initialize_dmda_policy(struct starpu_machine_topology_s *topology, 
+static void initialize_dmda_policy(struct starpu_machine_topology *topology, 
 	 __attribute__ ((unused)) struct starpu_sched_policy *_policy) 
 {
 	nworkers = topology->nworkers;
@@ -602,7 +602,7 @@ static void initialize_dmda_policy(struct starpu_machine_topology_s *topology,
 	}
 }
 
-static void initialize_dmda_sorted_policy(struct starpu_machine_topology_s *topology,
+static void initialize_dmda_sorted_policy(struct starpu_machine_topology *topology,
 					struct starpu_sched_policy *_policy)
 {
 	initialize_dmda_policy(topology, _policy);
@@ -612,7 +612,7 @@ static void initialize_dmda_sorted_policy(struct starpu_machine_topology_s *topo
 	starpu_sched_set_max_priority(INT_MAX);
 }
 
-static void deinitialize_dmda_policy(struct starpu_machine_topology_s *topology, 
+static void deinitialize_dmda_policy(struct starpu_machine_topology *topology, 
 	 __attribute__ ((unused)) struct starpu_sched_policy *_policy) 
 {
 	unsigned workerid;

+ 5 - 5
src/sched_policies/detect_combined_workers.c

@@ -319,7 +319,7 @@ static unsigned find_and_assign_combinations_with_hwloc_recursive(tree_t *tree,
  *			Topology of the machine : used to know the number of cpus.
  */
 
-static void get_min_max_sizes(int *min_size, int *max_size, struct starpu_machine_topology_s *topology)
+static void get_min_max_sizes(int *min_size, int *max_size, struct starpu_machine_topology *topology)
 {
     int _min_size, _max_size;
 
@@ -375,7 +375,7 @@ static void get_min_max_sizes(int *min_size, int *max_size, struct starpu_machin
  *			to get the hwloc tree.
  */
 
-static void find_and_assign_combinations_with_hwloc(struct starpu_machine_topology_s *topology)
+static void find_and_assign_combinations_with_hwloc(struct starpu_machine_topology *topology)
 {
     unsigned nb_workers;
     int min_size, max_size;
@@ -412,7 +412,7 @@ static void find_and_assign_combinations_with_hwloc(struct starpu_machine_topolo
 
 #else /* STARPU_HAVE_HWLOC */
 
-static void find_and_assign_combinations_without_hwloc(struct starpu_machine_topology_s *topology)
+static void find_and_assign_combinations_without_hwloc(struct starpu_machine_topology *topology)
 {
     struct starpu_machine_config_s *config = _starpu_get_machine_config();
 
@@ -451,7 +451,7 @@ static void find_and_assign_combinations_without_hwloc(struct starpu_machine_top
 
 #endif /* STARPU_HAVE_HWLOC */
 
-static void combine_all_cpu_workers(struct starpu_machine_topology_s *topology)
+static void combine_all_cpu_workers(struct starpu_machine_topology *topology)
 {
     struct starpu_machine_config_s *config = _starpu_get_machine_config();
 
@@ -473,7 +473,7 @@ static void combine_all_cpu_workers(struct starpu_machine_topology_s *topology)
     }
 }
 
-void _starpu_sched_find_worker_combinations(struct starpu_machine_topology_s *topology)
+void _starpu_sched_find_worker_combinations(struct starpu_machine_topology *topology)
 {
     struct starpu_machine_config_s *config = _starpu_get_machine_config();
 

+ 1 - 1
src/sched_policies/detect_combined_workers.h

@@ -17,5 +17,5 @@
 #include <starpu.h>
 
 /* Initialize combined workers */
-void _starpu_sched_find_worker_combinations(struct starpu_machine_topology_s *topology);
+void _starpu_sched_find_worker_combinations(struct starpu_machine_topology *topology);
 

+ 2 - 2
src/sched_policies/eager_central_policy.c

@@ -29,7 +29,7 @@ static struct starpu_fifo_taskq_s *fifo;
 static pthread_cond_t sched_cond;
 static pthread_mutex_t sched_mutex;
 
-static void initialize_eager_center_policy(struct starpu_machine_topology_s *topology, 
+static void initialize_eager_center_policy(struct starpu_machine_topology *topology, 
 		   __attribute__ ((unused)) struct starpu_sched_policy *_policy) 
 {
 	/* there is only a single queue in that trivial design */
@@ -43,7 +43,7 @@ static void initialize_eager_center_policy(struct starpu_machine_topology_s *top
 		starpu_worker_set_sched_condition(workerid, &sched_cond, &sched_mutex);
 }
 
-static void deinitialize_eager_center_policy(__attribute__ ((unused)) struct starpu_machine_topology_s *topology, 
+static void deinitialize_eager_center_policy(__attribute__ ((unused)) struct starpu_machine_topology *topology, 
 		   __attribute__ ((unused)) struct starpu_sched_policy *_policy) 
 {
 	/* TODO check that there is no task left in the queue */

+ 2 - 2
src/sched_policies/eager_central_priority_policy.c

@@ -74,7 +74,7 @@ static void _starpu_destroy_priority_taskq(struct starpu_priority_taskq_s *prior
 	free(priority_queue);
 }
 
-static void initialize_eager_center_priority_policy(struct starpu_machine_topology_s *topology, 
+static void initialize_eager_center_priority_policy(struct starpu_machine_topology *topology, 
 			__attribute__ ((unused))	struct starpu_sched_policy *_policy) 
 {
 	/* In this policy, we support more than two levels of priority. */
@@ -92,7 +92,7 @@ static void initialize_eager_center_priority_policy(struct starpu_machine_topolo
 		starpu_worker_set_sched_condition(workerid, &global_sched_cond, &global_sched_mutex);
 }
 
-static void deinitialize_eager_center_priority_policy(struct starpu_machine_topology_s *topology __attribute__ ((unused)),
+static void deinitialize_eager_center_priority_policy(struct starpu_machine_topology *topology __attribute__ ((unused)),
 		   __attribute__ ((unused)) struct starpu_sched_policy *_policy) 
 {
 	/* TODO check that there is no task left in the queue */

+ 2 - 2
src/sched_policies/heft.c

@@ -57,7 +57,7 @@ static void param_modified(struct starpu_top_param_t* d){
 		d->name, alpha,beta,_gamma,idle_power);
 }
 
-static void heft_init(struct starpu_machine_topology_s *topology, 
+static void heft_init(struct starpu_machine_topology *topology, 
 	 __attribute__ ((unused)) struct starpu_sched_policy *_policy) 
 {
 	nworkers = topology->nworkers;
@@ -438,7 +438,7 @@ static int heft_push_task(struct starpu_task *task)
 	return _heft_push_task(task, 0);
 }
 
-static void heft_deinit(__attribute__ ((unused)) struct starpu_machine_topology_s *topology, 
+static void heft_deinit(__attribute__ ((unused)) struct starpu_machine_topology *topology, 
                         __attribute__ ((unused)) struct starpu_sched_policy *_policy) 
 {
 	unsigned workerid;

+ 2 - 2
src/sched_policies/parallel_greedy.c

@@ -37,7 +37,7 @@ static int possible_combinations_cnt[STARPU_NMAXWORKERS];
 static int possible_combinations[STARPU_NMAXWORKERS][10];
 static int possible_combinations_size[STARPU_NMAXWORKERS][10];
 
-static void initialize_pgreedy_policy(struct starpu_machine_topology_s *topology, 
+static void initialize_pgreedy_policy(struct starpu_machine_topology *topology, 
 		   __attribute__ ((unused)) struct starpu_sched_policy *_policy) 
 {
 	/* masters pick tasks from that queue */
@@ -128,7 +128,7 @@ static void initialize_pgreedy_policy(struct starpu_machine_topology_s *topology
 #endif
 }
 
-static void deinitialize_pgreedy_policy(__attribute__ ((unused)) struct starpu_machine_topology_s *topology, 
+static void deinitialize_pgreedy_policy(__attribute__ ((unused)) struct starpu_machine_topology *topology, 
 		   __attribute__ ((unused)) struct starpu_sched_policy *_policy) 
 {
 	/* TODO check that there is no task left in the queue */

+ 1 - 1
src/sched_policies/parallel_heft.c

@@ -373,7 +373,7 @@ static int parallel_heft_push_task(struct starpu_task *task)
 	return _parallel_heft_push_task(task, 0);
 }
 
-static void initialize_parallel_heft_policy(struct starpu_machine_topology_s *topology, 
+static void initialize_parallel_heft_policy(struct starpu_machine_topology *topology, 
 	 __attribute__ ((unused)) struct starpu_sched_policy *_policy) 
 {
 	nworkers = topology->nworkers;

+ 1 - 1
src/sched_policies/random_policy.c

@@ -67,7 +67,7 @@ static int random_push_task(struct starpu_task *task)
 	return _random_push_task(task, !!task->priority);
 }
 
-static void initialize_random_policy(struct starpu_machine_topology_s *topology, 
+static void initialize_random_policy(struct starpu_machine_topology *topology, 
 	 __attribute__ ((unused)) struct starpu_sched_policy *_policy) 
 {
 	starpu_srand48(time(NULL));

+ 1 - 1
src/sched_policies/work_stealing_policy.c

@@ -194,7 +194,7 @@ static int ws_push_task(struct starpu_task *task)
         return 0;
 }
 
-static void initialize_ws_policy(struct starpu_machine_topology_s *topology, 
+static void initialize_ws_policy(struct starpu_machine_topology *topology, 
 				__attribute__ ((unused)) struct starpu_sched_policy *_policy) 
 {
 	nworkers = topology->nworkers;

+ 1 - 0
tools/dev/rename.sed

@@ -14,6 +14,7 @@
 #
 # See the GNU Lesser General Public License in COPYING.LGPL for more details.
 
+s/\bstarpu_machine_topology_s\b/starpu_machine_topology/g
 s/\bstarpu_htbl32_node_s\b/starpu_htbl32_node/g
 s/\bstarpu_history_list_t\b/starpu_history_list/g
 s/\bstarpu_buffer_descr_t\b/starpu_buffer_descr/g