Parcourir la source

thread: fix definitions of starpu_pthread_create and starpu_pthread_create_on (2nd part)

Nathalie Furmento il y a 12 ans
Parent
commit
1c75b34ec9

+ 2 - 2
include/starpu_thread.h

@@ -51,8 +51,8 @@ int starpu_pthread_attr_setdetachstate(starpu_pthread_attr_t *attr, int detachst
 typedef pthread_t starpu_pthread_t;
 typedef pthread_attr_t starpu_pthread_attr_t;
 
-#define starpu_pthread_create(name, thread, attr, routine, arg) pthread_create(thread, attr, routine, arg)
-#define starpu_pthread_create_on(name, thread, attr, routine, arg, where) starpu_pthread_create(name, thread, attr, routine, arg)
+#define starpu_pthread_create pthread_create
+#define starpu_pthread_create_on(name, thread, attr, routine, arg, where) starpu_pthread_create(thread, attr, routine, arg)
 #define starpu_pthread_join pthread_join
 #define starpu_pthread_attr_init pthread_attr_init
 #define starpu_pthread_attr_destroy pthread_attr_destroy

+ 1 - 1
mpi/src/starpu_mpi.c

@@ -960,7 +960,7 @@ int _starpu_mpi_initialize(int *argc, char ***argv, int initialize_mpi)
 	argc_argv->argc = argc;
 	argc_argv->argv = argv;
 
-	_STARPU_PTHREAD_CREATE("MPI progress", &progress_thread, NULL, _starpu_mpi_progress_thread_func, argc_argv);
+	_STARPU_PTHREAD_CREATE(&progress_thread, NULL, _starpu_mpi_progress_thread_func, argc_argv);
 
 	_STARPU_PTHREAD_MUTEX_LOCK(&mutex);
 	while (!running)

+ 9 - 9
src/common/thread.h

@@ -28,20 +28,20 @@
 	int p_ret =  starpu_pthread_create_on((name), (thread), (attr), (routine), (arg), (where)); 	\
 	if (STARPU_UNLIKELY(p_ret != 0)) {								\
 		fprintf(stderr,										\
-			"%s:%d starpu_pthread_create: %s\n",						\
+			"%s:%d starpu_pthread_create_on: %s\n",						\
 			__FILE__, __LINE__, strerror(p_ret));						\
 		STARPU_ABORT();										\
 	}												\
 } while (0)
 
-#define _STARPU_PTHREAD_CREATE(name, thread, attr, routine, arg) do {		    	\
-	int p_ret =  starpu_pthread_create((name), (thread), (attr), (routine), (arg)); \
-	if (STARPU_UNLIKELY(p_ret != 0)) {						\
-		fprintf(stderr,								\
-			"%s:%d starpu_pthread_create: %s\n",				\
-			__FILE__, __LINE__, strerror(p_ret));				\
-		STARPU_ABORT();								\
-	}										\
+#define _STARPU_PTHREAD_CREATE(thread, attr, routine, arg) do {		    	\
+	int p_ret =  starpu_pthread_create((thread), (attr), (routine), (arg)); \
+	if (STARPU_UNLIKELY(p_ret != 0)) {					\
+		fprintf(stderr,							\
+			"%s:%d starpu_pthread_create: %s\n",			\
+			__FILE__, __LINE__, strerror(p_ret));			\
+		STARPU_ABORT();							\
+	}									\
 } while (0)
 
 /*

+ 1 - 2
src/drivers/gordon/driver_gordon.c

@@ -465,8 +465,7 @@ void *_starpu_gordon_worker(void *arg)
 	_STARPU_PTHREAD_MUTEX_INIT(&progress_mutex, NULL);
 	_STARPU_PTHREAD_COND_INIT(&progress_cond, NULL);
 
-	_STARPU_PTHREAD_CREATE("Gordon progress", &progress_thread, NULL,
-			       gordon_worker_progress, gordon_set_arg);
+	_STARPU_PTHREAD_CREATE(&progress_thread, NULL, gordon_worker_progress, gordon_set_arg);
 
 	/* wait for the progression thread to be ready */
 	_STARPU_PTHREAD_MUTEX_LOCK(&progress_mutex);

+ 2 - 2
src/top/starpu_top_connection.c

@@ -161,7 +161,7 @@ void _starpu_top_communications_threads_launcher(void)
 	starpu_pthread_attr_init(&threads_attr);
 	starpu_pthread_attr_setdetachstate(&threads_attr, PTHREAD_CREATE_DETACHED);
 
-	_STARPU_PTHREAD_CREATE("StarPU-Top from", &from_ui, &threads_attr, message_from_ui, NULL);
-	_STARPU_PTHREAD_CREATE("StarPU-Top to", &to_ui, &threads_attr, message_to_ui, NULL);
+	_STARPU_PTHREAD_CREATE(&from_ui, &threads_attr, message_from_ui, NULL);
+	_STARPU_PTHREAD_CREATE(&to_ui, &threads_attr, message_to_ui, NULL);
 }