Browse Source

src: rename internal types following coding conventions

Nathalie Furmento 13 years ago
parent
commit
1c637eff5f

+ 5 - 5
src/common/htable32.c

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -26,7 +26,7 @@ void *_starpu_htbl_search_32(struct starpu_htbl32_node *htbl, uint32_t key)
 	unsigned currentbit;
 	unsigned keysize = 32;
 
-	starpu_htbl32_node_t *current_htbl = htbl;
+	struct starpu_htbl32_node *current_htbl = htbl;
 
 	/* 000000000001111 with HTBL_NODE_SIZE 1's */
 	uint32_t mask = (1<<STARPU_HTBL32_NODE_SIZE)-1;
@@ -65,7 +65,7 @@ void *_starpu_htbl_insert_32(struct starpu_htbl32_node **htbl, uint32_t key, voi
 	unsigned currentbit;
 	unsigned keysize = 32;
 
-	starpu_htbl32_node_t **current_htbl_ptr = htbl;
+	struct starpu_htbl32_node **current_htbl_ptr = htbl;
 
 	/* 000000000001111 with HTBL_NODE_SIZE 1's */
 	uint32_t mask = (1<<STARPU_HTBL32_NODE_SIZE)-1;
@@ -75,7 +75,7 @@ void *_starpu_htbl_insert_32(struct starpu_htbl32_node **htbl, uint32_t key, voi
 		//printf("insert : current bit = %d \n", currentbit);
 		if (*current_htbl_ptr == NULL) {
 			/* TODO pad to change that 1 into 16 ? */
-			*current_htbl_ptr = (starpu_htbl32_node_t*)calloc(sizeof(starpu_htbl32_node_t), 1);
+			*current_htbl_ptr = (struct starpu_htbl32_node*)calloc(sizeof(struct starpu_htbl32_node), 1);
 			assert(*current_htbl_ptr);
 		}
 
@@ -98,7 +98,7 @@ void *_starpu_htbl_insert_32(struct starpu_htbl32_node **htbl, uint32_t key, voi
 	/* current_htbl either contains NULL or a previous entry 
 	 * we overwrite it anyway */
 	void *old_entry = *current_htbl_ptr;
-	*current_htbl_ptr = (starpu_htbl32_node_t *) entry;
+	*current_htbl_ptr = (struct starpu_htbl32_node *) entry;
 
 	return old_entry;
 }

+ 4 - 3
src/common/htable32.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -26,10 +26,11 @@
 #define STARPU_HTBL32_NODE_SIZE	16
 
 /* Hierarchical table: all nodes have a 2^16 arity . */
-typedef struct starpu_htbl32_node {
+/* Note: this struct is used in include/starpu_perfmodel.h */
+struct starpu_htbl32_node {
 	unsigned nentries;
 	struct starpu_htbl32_node *children[1<<STARPU_HTBL32_NODE_SIZE];
-} starpu_htbl32_node_t;
+};
 
 /* Look for a 32bit key into the hierchical table. Returns the entry if
  * something is found, NULL otherwise. */

+ 6 - 6
src/common/timing.c

@@ -40,7 +40,7 @@ static struct timespec reference_start_time_ts;
  * to have consistent timing measurements. The CLOCK_MONOTONIC_RAW clock is not
  * subject to NTP adjustments, but is not available on all systems (in that
  * case we use the CLOCK_MONOTONIC clock instead). */
-static void _starpu_clock_gettime(struct timespec *ts) {
+static void _starpu_clock_readtime(struct timespec *ts) {
 #ifdef CLOCK_MONOTONIC_RAW
 	static int raw_supported = 0;
 	switch (raw_supported) {
@@ -67,12 +67,12 @@ void _starpu_timing_init(void)
 	_starpu_clock_gettime(&reference_start_time_ts);
 }
 
-void starpu_clock_gettime(struct timespec *ts)
+void _starpu_clock_gettime(struct timespec *ts)
 {
 	struct timespec absolute_ts;
 
 	/* Read the current time */
-	_starpu_clock_gettime(&absolute_ts);
+	_starpu_clock_readtime(&absolute_ts);
 
 	/* Compute the relative time since initialization */
 	starpu_timespec_sub(&absolute_ts, &reference_start_time_ts, ts);
@@ -137,7 +137,7 @@ void _starpu_timing_init(void)
   inited = 1;
 }
 
-void starpu_clock_gettime(struct timespec *ts)
+void _starpu_clock_gettime(struct timespec *ts)
 {
 	starpu_tick_t tick_now;
 
@@ -162,7 +162,7 @@ void _starpu_timing_init(void)
 {
 }
 
-void starpu_clock_gettime(struct timespec *ts)
+void _starpu_clock_gettime(struct timespec *ts)
 {
 	timerclear(ts);
 }
@@ -189,7 +189,7 @@ double starpu_timing_timespec_to_us(struct timespec *ts)
 double starpu_timing_now(void)
 {
 	struct timespec now;
-	starpu_clock_gettime(&now);
+	_starpu_clock_gettime(&now);
 
 	return starpu_timing_timespec_to_us(&now);
 }

+ 2 - 3
src/common/timing.h

@@ -1,7 +1,7 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
  * Copyright (C) 2009, 2010  Université de Bordeaux 1
- * Copyright (C) 2010  Centre National de la Recherche Scientifique
+ * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
  * it under the terms of the GNU Lesser General Public License as published by
@@ -30,8 +30,7 @@
 #include <starpu.h>
 
 void _starpu_timing_init(void);
-void starpu_clock_gettime(struct timespec *ts);
-double starpu_timing_now(void);
+void _starpu_clock_gettime(struct timespec *ts);
 
 #endif /* TIMING_H */
 

+ 2 - 2
src/core/jobs.c

@@ -163,7 +163,7 @@ void _starpu_handle_job_termination(starpu_job_t j, unsigned job_is_already_lock
 	{
 		int profiling = starpu_profiling_status_get();
 		if (profiling && task->profiling_info)
-			starpu_clock_gettime(&task->profiling_info->callback_start_time);
+			_starpu_clock_gettime(&task->profiling_info->callback_start_time);
 
 		/* so that we can check whether we are doing blocking calls
 		 * within the callback */
@@ -186,7 +186,7 @@ void _starpu_handle_job_termination(starpu_job_t j, unsigned job_is_already_lock
 		_starpu_set_local_worker_status(STATUS_UNKNOWN);
 
 		if (profiling && task->profiling_info)
-			starpu_clock_gettime(&task->profiling_info->callback_end_time);
+			_starpu_clock_gettime(&task->profiling_info->callback_end_time);
 	}
 
 	_starpu_sched_post_exec_hook(task);

+ 2 - 2
src/core/sched_policy.c

@@ -312,7 +312,7 @@ struct starpu_task *_starpu_pop_task(struct _starpu_worker *worker)
 	int profiling = starpu_profiling_status_get();
 	struct timespec pop_start_time;
 	if (profiling)
-		starpu_clock_gettime(&pop_start_time);
+		_starpu_clock_gettime(&pop_start_time);
 
 	/* perhaps there is some local task to be executed first */
 	task = _starpu_pop_local_task(worker);
@@ -334,7 +334,7 @@ struct starpu_task *_starpu_pop_task(struct _starpu_worker *worker)
 		{
 			memcpy(&profiling_info->pop_start_time,
 				&pop_start_time, sizeof(struct timespec));
-			starpu_clock_gettime(&profiling_info->pop_end_time);
+			_starpu_clock_gettime(&profiling_info->pop_end_time);
 		}
 	}
 

+ 1 - 1
src/core/task.c

@@ -288,7 +288,7 @@ int starpu_task_submit(struct starpu_task *task)
 
 
 	if (profiling)
-		starpu_clock_gettime(&info->submit_time);
+		_starpu_clock_gettime(&info->submit_time);
 
 	/* internally, StarPU manipulates a starpu_job_t which is a wrapper around a
 	* task structure, it is possible that this job structure was already

+ 4 - 4
src/datawizard/coherency.c

@@ -591,7 +591,7 @@ int _starpu_fetch_task_input(struct starpu_task *task, uint32_t mask)
 
 	int profiling = starpu_profiling_status_get();
 	if (profiling && task->profiling_info)
-		starpu_clock_gettime(&task->profiling_info->acquire_data_start_time);
+		_starpu_clock_gettime(&task->profiling_info->acquire_data_start_time);
 
 	struct starpu_buffer_descr *descrs = task->buffers;
 	unsigned nbuffers = task->cl->nbuffers;
@@ -633,7 +633,7 @@ int _starpu_fetch_task_input(struct starpu_task *task, uint32_t mask)
 	}
 
 	if (profiling && task->profiling_info)
-		starpu_clock_gettime(&task->profiling_info->acquire_data_end_time);
+		_starpu_clock_gettime(&task->profiling_info->acquire_data_end_time);
 
 	STARPU_TRACE_END_FETCH_INPUT(NULL);
 
@@ -654,7 +654,7 @@ void _starpu_push_task_output(struct starpu_task *task, uint32_t mask)
 
 	int profiling = starpu_profiling_status_get();
 	if (profiling && task->profiling_info)
-		starpu_clock_gettime(&task->profiling_info->release_data_start_time);
+		_starpu_clock_gettime(&task->profiling_info->release_data_start_time);
 
         struct starpu_buffer_descr *descrs = task->buffers;
         unsigned nbuffers = task->cl->nbuffers;
@@ -690,7 +690,7 @@ void _starpu_push_task_output(struct starpu_task *task, uint32_t mask)
 	}
 
 	if (profiling && task->profiling_info)
-		starpu_clock_gettime(&task->profiling_info->release_data_end_time);
+		_starpu_clock_gettime(&task->profiling_info->release_data_end_time);
 
 	STARPU_TRACE_END_PUSH_OUTPUT(NULL);
 }

+ 4 - 4
src/drivers/driver_common/driver_common.c

@@ -48,7 +48,7 @@ void _starpu_driver_start_job(struct _starpu_worker *args, starpu_job_t j, struc
 	
 		if ((profiling && profiling_info) || calibrate_model || starpu_top)
 		{
-			starpu_clock_gettime(codelet_start);
+			_starpu_clock_gettime(codelet_start);
 			_starpu_worker_register_executing_start_date(workerid, codelet_start);
 		}
 	}
@@ -77,7 +77,7 @@ void _starpu_driver_end_job(struct _starpu_worker *args, starpu_job_t j, struct
 
 	if (rank == 0) {
 		if ((profiling && profiling_info) || calibrate_model || starpu_top)
-			starpu_clock_gettime(codelet_end);
+			_starpu_clock_gettime(codelet_end);
 	}
 
 	if (starpu_top)
@@ -150,14 +150,14 @@ void _starpu_block_worker(int workerid, pthread_cond_t *cond, pthread_mutex_t *m
 	STARPU_TRACE_WORKER_SLEEP_START
 	_starpu_worker_set_status(workerid, STATUS_SLEEPING);
 
-	starpu_clock_gettime(&start_time);
+	_starpu_clock_gettime(&start_time);
 	_starpu_worker_register_sleeping_start_date(workerid, &start_time);
 
 	_STARPU_PTHREAD_COND_WAIT(cond, mutex);
 
 	_starpu_worker_set_status(workerid, STATUS_UNKNOWN);
 	STARPU_TRACE_WORKER_SLEEP_END
-	starpu_clock_gettime(&end_time);
+	_starpu_clock_gettime(&end_time);
 
 	int profiling = starpu_profiling_status_get();
 	if (profiling)

+ 8 - 8
src/profiling/profiling.c

@@ -134,7 +134,7 @@ struct starpu_task_profiling_info *_starpu_allocate_profiling_info_if_needed(str
 
 static void _starpu_worker_reset_profiling_info_with_lock(int workerid)
 {
-	starpu_clock_gettime(&worker_info[workerid].start_time);
+	_starpu_clock_gettime(&worker_info[workerid].start_time);
 
 	/* This is computed in a lazy fashion when the application queries
 	 * profiling info. */
@@ -156,7 +156,7 @@ static void _starpu_worker_reset_profiling_info_with_lock(int workerid)
 	if (status == STATUS_SLEEPING)
 	{
 		worker_registered_sleeping_start[workerid] = 1;
-		starpu_clock_gettime(&sleeping_start_date[workerid]);
+		_starpu_clock_gettime(&sleeping_start_date[workerid]);
 	}
 	else {
 		worker_registered_sleeping_start[workerid] = 0;
@@ -165,7 +165,7 @@ static void _starpu_worker_reset_profiling_info_with_lock(int workerid)
 	if (status == STATUS_EXECUTING)
 	{
 		worker_registered_executing_start[workerid] = 1;
-		starpu_clock_gettime(&executing_start_date[workerid]);
+		_starpu_clock_gettime(&executing_start_date[workerid]);
 	}
 	else {
 		worker_registered_executing_start[workerid] = 0;
@@ -263,7 +263,7 @@ int starpu_worker_get_profiling_info(int workerid, struct starpu_worker_profilin
 	{
 		/* The total time is computed in a lazy fashion */
 		struct timespec now;
-		starpu_clock_gettime(&now);
+		_starpu_clock_gettime(&now);
 
 		/* In case some worker is currently sleeping, we take into
 		 * account the time spent since it registered. */
@@ -305,7 +305,7 @@ void _starpu_profiling_set_task_push_start_time(struct starpu_task *task)
 	profiling_info = task->profiling_info;
 
 	if (profiling_info)
-		starpu_clock_gettime(&profiling_info->push_start_time);
+		_starpu_clock_gettime(&profiling_info->push_start_time);
 }
 
 void _starpu_profiling_set_task_push_end_time(struct starpu_task *task)
@@ -317,7 +317,7 @@ void _starpu_profiling_set_task_push_end_time(struct starpu_task *task)
 	profiling_info = task->profiling_info;
 
 	if (profiling_info)
-		starpu_clock_gettime(&profiling_info->push_end_time);
+		_starpu_clock_gettime(&profiling_info->push_end_time);
 }
 
 /*
@@ -336,7 +336,7 @@ void _starpu_initialize_busid_matrix(void)
 
 static void _starpu_bus_reset_profiling_info(struct starpu_bus_profiling_info *bus_info)
 {
-	starpu_clock_gettime(&bus_info->start_time);
+	_starpu_clock_gettime(&bus_info->start_time);
 	bus_info->transferred_bytes = 0;
 	bus_info->transfer_count = 0;
 }
@@ -388,7 +388,7 @@ int starpu_bus_get_profiling_info(int busid, struct starpu_bus_profiling_info *b
 	if (bus_info)
 	{
 		struct timespec now;
-		starpu_clock_gettime(&now);
+		_starpu_clock_gettime(&now);
 
 		/* total_time = now - start_time */
 		starpu_timespec_sub(&now, &bus_profiling_info[src_node][dst_node].start_time,

+ 1 - 1
src/top/starpu_top.c

@@ -618,7 +618,7 @@ void starpu_top_debug_lock(const char* debug_message)
 unsigned long long int current_timestamp()
 {
 	struct timespec now;
-	starpu_clock_gettime(&now);
+	_starpu_clock_gettime(&now);
 	return _starpu_top_timing_timespec_to_ms(&now);
 }
 

+ 1 - 1
src/top/starpu_top_task.c

@@ -84,7 +84,7 @@ void starpu_top_task_prevision(
 	unsigned long long taskid = _starpu_get_job_associated_to_task(task)->job_id;
 	STARPU_ASSERT(starpu_top_status_get());
 	struct timespec now;
-	starpu_clock_gettime(&now);
+	_starpu_clock_gettime(&now);
 	char * str= (char *)malloc(sizeof(char)*200);
 	snprintf(str, 128, 
 				"PREV;%llu;%d;%llu;%llu;%llu\n",