Samuel Thibault лет назад: 10
Родитель
Сommit
803270bbfb

+ 11 - 11
mpi/src/starpu_mpi_cache.c

@@ -34,20 +34,20 @@ static starpu_pthread_mutex_t *_cache_sent_mutex;
 static starpu_pthread_mutex_t *_cache_received_mutex;
 static struct _starpu_data_entry **_cache_sent_data = NULL;
 static struct _starpu_data_entry **_cache_received_data = NULL;
-int _cache_enabled=1;
+int _starpu_cache_enabled=1;
 
 void _starpu_mpi_cache_init(MPI_Comm comm)
 {
 	int nb_nodes;
 	int i;
 
-	_cache_enabled = starpu_get_env_number("STARPU_MPI_CACHE");
-	if (_cache_enabled == -1)
+	_starpu_cache_enabled = starpu_get_env_number("STARPU_MPI_CACHE");
+	if (_starpu_cache_enabled == -1)
 	{
-		_cache_enabled = 1;
+		_starpu_cache_enabled = 1;
 	}
 
-	if (_cache_enabled == 0)
+	if (_starpu_cache_enabled == 0)
 	{
 		if (!getenv("STARPU_SILENT")) fprintf(stderr,"Warning: StarPU MPI Communication cache is disabled\n");
 		return;
@@ -75,7 +75,7 @@ void _starpu_mpi_cache_empty_tables(int world_size)
 {
 	int i;
 
-	if (_cache_enabled == 0) return;
+	if (_starpu_cache_enabled == 0) return;
 
 	_STARPU_MPI_DEBUG(2, "Clearing htable for cache\n");
 
@@ -106,7 +106,7 @@ void _starpu_mpi_cache_free(int world_size)
 {
 	int i;
 
-	if (_cache_enabled == 0) return;
+	if (_starpu_cache_enabled == 0) return;
 
 	_starpu_mpi_cache_empty_tables(world_size);
 	free(_cache_sent_data);
@@ -170,7 +170,7 @@ void starpu_mpi_cache_flush_all_data(MPI_Comm comm)
 	int nb_nodes, i;
 	int mpi_rank, my_rank;
 
-	if (_cache_enabled == 0) return;
+	if (_starpu_cache_enabled == 0) return;
 
 	MPI_Comm_size(comm, &nb_nodes);
 	MPI_Comm_rank(comm, &my_rank);
@@ -210,7 +210,7 @@ void starpu_mpi_cache_flush(MPI_Comm comm, starpu_data_handle_t data_handle)
 	int i, my_rank, nb_nodes;
 	int mpi_rank;
 
-	if (_cache_enabled == 0) return;
+	if (_starpu_cache_enabled == 0) return;
 
 	MPI_Comm_size(comm, &nb_nodes);
 	MPI_Comm_rank(comm, &my_rank);
@@ -248,7 +248,7 @@ void *_starpu_mpi_already_received(int src, starpu_data_handle_t data, int mpi_r
 {
 	struct _starpu_data_entry *already_received;
 
-	if (_cache_enabled == 0) return NULL;
+	if (_starpu_cache_enabled == 0) return NULL;
 
 	STARPU_PTHREAD_MUTEX_LOCK(&_cache_received_mutex[mpi_rank]);
 	HASH_FIND_PTR(_cache_received_data[mpi_rank], &data, already_received);
@@ -271,7 +271,7 @@ void *_starpu_mpi_already_sent(starpu_data_handle_t data, int dest)
 {
 	struct _starpu_data_entry *already_sent;
 
-	if (_cache_enabled == 0) return NULL;
+	if (_starpu_cache_enabled == 0) return NULL;
 
 	STARPU_PTHREAD_MUTEX_LOCK(&_cache_sent_mutex[dest]);
 	HASH_FIND_PTR(_cache_sent_data[dest], &data, already_sent);

+ 1 - 1
mpi/src/starpu_mpi_cache.h

@@ -27,7 +27,7 @@
 extern "C" {
 #endif
 
-extern int _cache_enabled;
+extern int _starpu_cache_enabled;
 void _starpu_mpi_cache_init(MPI_Comm comm);
 void *_starpu_mpi_already_received(int src, starpu_data_handle_t data, int mpi_rank);
 void *_starpu_mpi_already_sent(starpu_data_handle_t data, int dest);

+ 6 - 6
mpi/src/starpu_mpi_private.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2010, 2012  Université de Bordeaux
+ * Copyright (C) 2010, 2012, 2014  Université de Bordeaux
  * Copyright (C) 2010, 2011, 2012, 2013  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -17,19 +17,19 @@
 
 #include <starpu_mpi_private.h>
 
-int _debug_rank=-1;
-int _debug_level_min=0;
-int _debug_level_max=0;
+int _starpu_debug_rank=-1;
+int _starpu_debug_level_min=0;
+int _starpu_debug_level_max=0;
 int _starpu_mpi_tag = 42;
 
 void _starpu_mpi_set_debug_level_min(int level)
 {
-	_debug_level_min = level;
+	_starpu_debug_level_min = level;
 }
 
 void _starpu_mpi_set_debug_level_max(int level)
 {
-	_debug_level_max = level;
+	_starpu_debug_level_max = level;
 }
 
 int starpu_mpi_get_communication_tag(void)

+ 12 - 12
mpi/src/starpu_mpi_private.h

@@ -29,11 +29,11 @@
 extern "C" {
 #endif
 
-extern int _debug_rank;
+extern int _starpu_debug_rank;
 
 #ifdef STARPU_VERBOSE
-extern int _debug_level_min;
-extern int _debug_level_max;
+extern int _starpu_debug_level_min;
+extern int _starpu_debug_level_max;
 void _starpu_mpi_set_debug_level_min(int level);
 void _starpu_mpi_set_debug_level_max(int level);
 #endif
@@ -42,10 +42,10 @@ void _starpu_mpi_set_debug_level_max(int level);
 #  define _STARPU_MPI_DEBUG(level, fmt, ...) \
 	do \
 	{								\
-		if (!getenv("STARPU_SILENT") && _debug_level_min <= level && level <= _debug_level_max)	\
+		if (!getenv("STARPU_SILENT") && _starpu_debug_level_min <= level && level <= _starpu_debug_level_max)	\
 		{							\
-			if (_debug_rank == -1) MPI_Comm_rank(MPI_COMM_WORLD, &_debug_rank); \
-			fprintf(stderr, "%*s[%d][starpu_mpi][%s:%d] " fmt , (_debug_rank+1)*4, "", _debug_rank, __starpu_func__ , __LINE__,## __VA_ARGS__); \
+			if (_starpu_debug_rank == -1) MPI_Comm_rank(MPI_COMM_WORLD, &_starpu_debug_rank); \
+			fprintf(stderr, "%*s[%d][starpu_mpi][%s:%d] " fmt , (_starpu_debug_rank+1)*4, "", _starpu_debug_rank, __starpu_func__ , __LINE__,## __VA_ARGS__); \
 			fflush(stderr); \
 		}			\
 	} while(0);
@@ -54,18 +54,18 @@ void _starpu_mpi_set_debug_level_max(int level);
 #endif
 
 #define _STARPU_MPI_DISP(fmt, ...) do { if (!getenv("STARPU_SILENT")) { \
-	       				     if (_debug_rank == -1) MPI_Comm_rank(MPI_COMM_WORLD, &_debug_rank); \
-                                             fprintf(stderr, "%*s[%d][starpu_mpi][%s:%d] " fmt , (_debug_rank+1)*4, "", _debug_rank, __starpu_func__ , __LINE__ ,## __VA_ARGS__); \
+	       				     if (_starpu_debug_rank == -1) MPI_Comm_rank(MPI_COMM_WORLD, &_starpu_debug_rank); \
+                                             fprintf(stderr, "%*s[%d][starpu_mpi][%s:%d] " fmt , (_starpu_debug_rank+1)*4, "", _starpu_debug_rank, __starpu_func__ , __LINE__ ,## __VA_ARGS__); \
                                              fflush(stderr); }} while(0);
 
 #ifdef STARPU_VERBOSE0
 #  define _STARPU_MPI_LOG_IN()             do { if (!getenv("STARPU_SILENT")) { \
-                                               if (_debug_rank == -1) MPI_Comm_rank(MPI_COMM_WORLD, &_debug_rank);                        \
-                                               fprintf(stderr, "%*s[%d][starpu_mpi][%s:%d] -->\n", (_debug_rank+1)*4, "", _debug_rank, __starpu_func__ , __LINE__); \
+                                               if (_starpu_debug_rank == -1) MPI_Comm_rank(MPI_COMM_WORLD, &_starpu_debug_rank);                        \
+                                               fprintf(stderr, "%*s[%d][starpu_mpi][%s:%d] -->\n", (_starpu_debug_rank+1)*4, "", _starpu_debug_rank, __starpu_func__ , __LINE__); \
                                                fflush(stderr); }} while(0)
 #  define _STARPU_MPI_LOG_OUT()            do { if (!getenv("STARPU_SILENT")) { \
-                                               if (_debug_rank == -1) MPI_Comm_rank(MPI_COMM_WORLD, &_debug_rank);                        \
-                                               fprintf(stderr, "%*s[%d][starpu_mpi][%s:%d] <--\n", (_debug_rank+1)*4, "", _debug_rank, __starpu_func__, __LINE__ ); \
+                                               if (_starpu_debug_rank == -1) MPI_Comm_rank(MPI_COMM_WORLD, &_starpu_debug_rank);                        \
+                                               fprintf(stderr, "%*s[%d][starpu_mpi][%s:%d] <--\n", (_starpu_debug_rank+1)*4, "", _starpu_debug_rank, __starpu_func__, __LINE__ ); \
                                                fflush(stderr); }} while(0)
 #else
 #  define _STARPU_MPI_LOG_IN()

+ 1 - 1
mpi/src/starpu_mpi_task_insert.c

@@ -173,7 +173,7 @@ void _starpu_mpi_exchange_data_after_execution(starpu_data_handle_t data, enum s
 static
 void _starpu_mpi_clear_data_after_execution(starpu_data_handle_t data, enum starpu_data_access_mode mode, int me, int do_execute, MPI_Comm comm)
 {
-	if (_cache_enabled)
+	if (_starpu_cache_enabled)
 	{
 		if (mode & STARPU_W || mode & STARPU_REDUX)
 		{