Преглед на файлове

drop thread parameter of starpu_pthread_setname, Darwin doesn't support it and we don't use it anyway

Samuel Thibault преди 9 години
родител
ревизия
666fd063bf

+ 4 - 4
include/starpu_thread.h

@@ -47,7 +47,7 @@ typedef msg_process_t starpu_pthread_t;
 typedef int starpu_pthread_attr_t;
 
 int starpu_pthread_create_on(char *name, starpu_pthread_t *thread, const starpu_pthread_attr_t *attr, void *(*start_routine) (void *), void *arg, msg_host_t host);
-#define starpu_pthread_setname(thread, name)
+#define starpu_pthread_setname(name)
 int starpu_pthread_create(starpu_pthread_t *thread, const starpu_pthread_attr_t *attr, void *(*start_routine) (void *), void *arg);
 int starpu_pthread_join(starpu_pthread_t thread, void **retval);
 int starpu_pthread_exit(void *retval) STARPU_ATTRIBUTE_NORETURN;
@@ -64,12 +64,12 @@ typedef pthread_attr_t starpu_pthread_attr_t;
 #define starpu_pthread_create_on(name, thread, attr, routine, arg, where) starpu_pthread_create(thread, attr, routine, arg)
 #ifdef STARPU_HAVE_PTHREAD_SETNAME_NP
 #ifdef STARPU_HAVE_DARWIN
-#define starpu_pthread_setname(thread, name) pthread_setname_np(name)
+#define starpu_pthread_setname(name) pthread_setname_np(name)
 #else
-#define starpu_pthread_setname(thread, name) pthread_setname_np(thread, name)
+#define starpu_pthread_setname(name) pthread_setname_np(pthread_self(), name)
 #endif
 #else
-#define starpu_pthread_setname(thread, name)
+#define starpu_pthread_setname(name)
 #endif
 #define starpu_pthread_join pthread_join
 #define starpu_pthread_exit pthread_exit

+ 1 - 1
mpi/src/starpu_mpi.c

@@ -1280,7 +1280,7 @@ static void *_starpu_mpi_progress_thread_func(void *arg)
 	struct _starpu_mpi_argc_argv *argc_argv = (struct _starpu_mpi_argc_argv *) arg;
 	int rank, worldsize;
 
-	starpu_pthread_setname(pthread_self(), "MPI");
+	starpu_pthread_setname("MPI");
 
 #ifndef STARPU_SIMGRID
 	_starpu_mpi_do_initialize(argc_argv);

+ 1 - 1
src/core/task.c

@@ -1191,7 +1191,7 @@ static void *watchdog_func(void *arg)
 	timeout = ((float) atoll(timeout_env)) / 1000000;
 #endif
 	struct _starpu_machine_config *config = (struct _starpu_machine_config *)_starpu_get_machine_config();
-	starpu_pthread_setname(pthread_self(), "watchdog");
+	starpu_pthread_setname("watchdog");
 
 	STARPU_PTHREAD_MUTEX_LOCK(&config->submitted_mutex);
 	while (_starpu_machine_is_running())

+ 1 - 1
src/drivers/cpu/driver_cpu.c

@@ -217,7 +217,7 @@ int _starpu_cpu_driver_init(struct _starpu_worker *cpu_worker)
 
 	snprintf(cpu_worker->name, sizeof(cpu_worker->name), "CPU %d", devid);
 	snprintf(cpu_worker->short_name, sizeof(cpu_worker->short_name), "CPU %d", devid);
-	starpu_pthread_setname(pthread_self(), cpu_worker->short_name);
+	starpu_pthread_setname(cpu_worker->short_name);
 
 	_STARPU_TRACE_WORKER_INIT_END(cpu_worker->workerid);
 

+ 1 - 1
src/drivers/cuda/driver_cuda.c

@@ -661,7 +661,7 @@ int _starpu_cuda_driver_init(struct _starpu_worker_set *worker_set)
 	{
 		char thread_name[16];
 		snprintf(thread_name, sizeof(thread_name), "CUDA %u", worker0->devid);
-		starpu_pthread_setname(pthread_self(), thread_name);
+		starpu_pthread_setname(thread_name);
 	}
 
 	/* tell the main thread that this one is ready */

+ 1 - 1
src/drivers/mic/driver_mic_source.c

@@ -540,7 +540,7 @@ void *_starpu_mic_src_worker(void *arg)
 	{
 		char thread_name[16];
 		snprintf(thread_name, sizeof(thread_name), "MIC %d", devid);
-		starpu_pthread_setname(pthread_self(), thread_name);
+		starpu_pthread_setname(thread_name);
 	}
 
 	for (i = 0; i < worker_set->nworkers; i++)

+ 1 - 1
src/drivers/opencl/driver_opencl.c

@@ -640,7 +640,7 @@ int _starpu_opencl_driver_init(struct _starpu_worker *worker)
 #endif
 	snprintf(worker->name, sizeof(worker->name), "OpenCL %u (%s %.1f GiB)", devid, devname, size);
 	snprintf(worker->short_name, sizeof(worker->short_name), "OpenCL %u", devid);
-	starpu_pthread_setname(pthread_self(), worker->short_name);
+	starpu_pthread_setname(worker->short_name);
 
 	worker->pipeline_length = starpu_get_env_number_default("STARPU_OPENCL_PIPELINE", 2);
 	if (worker->pipeline_length > STARPU_MAX_PIPELINE)

+ 1 - 1
src/drivers/scc/driver_scc_source.c

@@ -304,7 +304,7 @@ void *_starpu_scc_src_worker(void *arg)
 	{
 		char thread_name[16];
 		snprintf(thread_name, sizeof(thread_name), "SCC %d", devid);
-		starpu_pthread_setname(pthread_self(), thread_name);
+		starpu_pthread_setname(thread_name);
 	}
 
 	_STARPU_TRACE_WORKER_INIT_END(workerid);

+ 2 - 2
src/top/starpu_top_connection.c

@@ -60,7 +60,7 @@ void * message_from_ui(void * p)
 {
 	(void) p;
 	char str[STARPU_TOP_BUFFER_SIZE];
-	starpu_pthread_setname(pthread_self(), "starpu_top_message_from_ui");
+	starpu_pthread_setname("starpu_top_message_from_ui");
 	while(1)
 	{
 		char * check=fgets (str, STARPU_TOP_BUFFER_SIZE, starpu_top_socket_fd_read);
@@ -86,7 +86,7 @@ static
 void * message_to_ui(void * p)
 {
 	(void) p;
-	starpu_pthread_setname(pthread_self(), "starpu_top_message_to_ui");
+	starpu_pthread_setname("starpu_top_message_to_ui");
 	while(1)
 	{
 		char* message = _starpu_top_message_remove(_starpu_top_mt);