Browse Source

Prefixing of src/common/htable32.h

find . -type f -not -name "*svn*"|xargs sed -i s/"\bHTBL32_NODE_SIZE\b"/STARPU_HTBL32_NODE_SIZE/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bhtbl32_node_t\b"/starpu_htbl32_node_t/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bhtbl_search_32\b"/_starpu_htbl_search_32/g
find . -type f -not -name "*svn*"|xargs sed -i s/"\bhtbl_insert_32\b"/_starpu_htbl_insert_32/g
Nathalie Furmento 15 years ago
parent
commit
dd64890a33
3 changed files with 19 additions and 19 deletions
  1. 11 11
      src/common/htable32.c
  2. 5 5
      src/common/htable32.h
  3. 3 3
      src/core/perfmodel/perfmodel_history.c

+ 11 - 11
src/common/htable32.c

@@ -20,17 +20,17 @@
 #include <stdint.h>
 #include <string.h>
 
-void *htbl_search_32(struct starpu_htbl32_node_s *htbl, uint32_t key)
+void *_starpu_htbl_search_32(struct starpu_htbl32_node_s *htbl, uint32_t key)
 {
 	unsigned currentbit;
 	unsigned keysize = 32;
 
-	htbl32_node_t *current_htbl = htbl;
+	starpu_htbl32_node_t *current_htbl = htbl;
 
 	/* 000000000001111 with HTBL_NODE_SIZE 1's */
-	uint32_t mask = (1<<HTBL32_NODE_SIZE)-1;
+	uint32_t mask = (1<<STARPU_HTBL32_NODE_SIZE)-1;
 
-	for(currentbit = 0; currentbit < keysize; currentbit+=HTBL32_NODE_SIZE)
+	for(currentbit = 0; currentbit < keysize; currentbit+=STARPU_HTBL32_NODE_SIZE)
 	{
 	
 	//	printf("search : current bit = %d \n", currentbit);
@@ -44,7 +44,7 @@ void *htbl_search_32(struct starpu_htbl32_node_s *htbl, uint32_t key)
 		 * */
 
 		unsigned last_currentbit = 
-			keysize - (currentbit + HTBL32_NODE_SIZE);
+			keysize - (currentbit + STARPU_HTBL32_NODE_SIZE);
 		uint32_t offloaded_mask = mask << last_currentbit;
 		unsigned current_index = 
 			(key & (offloaded_mask)) >> (last_currentbit);
@@ -59,22 +59,22 @@ void *htbl_search_32(struct starpu_htbl32_node_s *htbl, uint32_t key)
  * returns the previous value of the tag, or NULL else
  */
 
-void *htbl_insert_32(struct starpu_htbl32_node_s **htbl, uint32_t key, void *entry)
+void *_starpu_htbl_insert_32(struct starpu_htbl32_node_s **htbl, uint32_t key, void *entry)
 {
 	unsigned currentbit;
 	unsigned keysize = 32;
 
-	htbl32_node_t **current_htbl_ptr = htbl;
+	starpu_htbl32_node_t **current_htbl_ptr = htbl;
 
 	/* 000000000001111 with HTBL_NODE_SIZE 1's */
-	uint32_t mask = (1<<HTBL32_NODE_SIZE)-1;
+	uint32_t mask = (1<<STARPU_HTBL32_NODE_SIZE)-1;
 
-	for(currentbit = 0; currentbit < keysize; currentbit+=HTBL32_NODE_SIZE)
+	for(currentbit = 0; currentbit < keysize; currentbit+=STARPU_HTBL32_NODE_SIZE)
 	{
 		//printf("insert : current bit = %d \n", currentbit);
 		if (*current_htbl_ptr == NULL) {
 			/* TODO pad to change that 1 into 16 ? */
-			*current_htbl_ptr = calloc(sizeof(htbl32_node_t), 1);
+			*current_htbl_ptr = calloc(sizeof(starpu_htbl32_node_t), 1);
 			assert(*current_htbl_ptr);
 		}
 
@@ -85,7 +85,7 @@ void *htbl_insert_32(struct starpu_htbl32_node_s **htbl, uint32_t key, void *ent
 		 * */
 
 		unsigned last_currentbit = 
-			keysize - (currentbit + HTBL32_NODE_SIZE);
+			keysize - (currentbit + STARPU_HTBL32_NODE_SIZE);
 		uint32_t offloaded_mask = mask << last_currentbit;
 		unsigned current_index = 
 			(key & (offloaded_mask)) >> (last_currentbit);

+ 5 - 5
src/common/htable32.h

@@ -22,14 +22,14 @@
 #include <stdio.h>
 #include <assert.h>
 
-#define HTBL32_NODE_SIZE	16
+#define STARPU_HTBL32_NODE_SIZE	16
 
 typedef struct starpu_htbl32_node_s {
 	unsigned nentries;
-	struct starpu_htbl32_node_s *children[1<<HTBL32_NODE_SIZE];
-} htbl32_node_t;
+	struct starpu_htbl32_node_s *children[1<<STARPU_HTBL32_NODE_SIZE];
+} starpu_htbl32_node_t;
 
-void *htbl_search_32(struct starpu_htbl32_node_s *htbl, uint32_t key);
-void *htbl_insert_32(struct starpu_htbl32_node_s **htbl, uint32_t key, void *entry);
+void *_starpu_htbl_search_32(struct starpu_htbl32_node_s *htbl, uint32_t key);
+void *_starpu_htbl_insert_32(struct starpu_htbl32_node_s **htbl, uint32_t key, void *entry);
 
 #endif // __GENERIC_HTABLE_H__

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

@@ -42,7 +42,7 @@ static void insert_history_entry(struct starpu_history_entry_t *entry, struct st
 	link->entry = entry;
 	*list = link;
 
-	old = htbl_insert_32(history_ptr, entry->footprint, entry);
+	old = _starpu_htbl_insert_32(history_ptr, entry->footprint, entry);
 	/* that may fail in case there is some concurrency issue */
 	STARPU_ASSERT(old == NULL);
 }
@@ -521,7 +521,7 @@ double _starpu_history_based_job_expected_length(struct starpu_perfmodel_t *mode
 		return -1.0;
 
 	pthread_rwlock_rdlock(&model->model_rwlock);
-	entry = htbl_search_32(history, key);
+	entry = _starpu_htbl_search_32(history, key);
 	pthread_rwlock_unlock(&model->model_rwlock);
 
 	exp = entry?entry->mean:-1.0;
@@ -556,7 +556,7 @@ void _starpu_update_perfmodel_history(starpu_job_t j, enum starpu_perf_archtype
 
 			pthread_rwlock_wrlock(&model->model_rwlock);
 	
-				entry = htbl_search_32(history, key);
+				entry = _starpu_htbl_search_32(history, key);
 	
 				if (!entry)
 				{