Просмотр исходного кода

mpi: New configure option --enable-mpi-progression-hook to enable the
activity polling method for StarPU-MPI.

Nathalie Furmento лет назад: 12
Родитель
Сommit
32cfa5ab67
4 измененных файлов с 25 добавлено и 16 удалено
  1. 2 0
      ChangeLog
  2. 7 0
      configure.ac
  3. 5 1
      doc/chapters/configuration.texi
  4. 11 15
      mpi/src/starpu_mpi.c

+ 2 - 0
ChangeLog

@@ -116,6 +116,8 @@ Small features:
   * File STARPU-REVISION --- containing the SVN revision number from which
     StarPU was compiled --- is installed in the share/doc/starpu directory
   * starpu_perfmodel_plot can now directly draw GFlops curves.
+  * New configure option --enable-mpi-progression-hook to enable the
+    activity polling method for StarPU-MPI.
 
 Changes:
   * Fix the block filter functions.

+ 7 - 0
configure.ac

@@ -1234,6 +1234,13 @@ if test x$use_mpi = xyes; then
 	AC_DEFINE(STARPU_USE_MPI,[],[whether the StarPU MPI library is available])
 fi
 
+AC_ARG_ENABLE(mpi-progression-hook, [AS_HELP_STRING([--enable-mpi-progression-hook],
+				   [Enable StarPU MPI activity polling method])],
+				   enable_mpi_progression_hook=$enableval, enable_mpi_progression_hook=no)
+if  test x$enable_mpi_progression_hook = xyes; then
+	AC_DEFINE(STARPU_MPI_ACTIVITY, [1], [enable StarPU MPI activity polling method])
+fi
+
 ###############################################################################
 #                                                                             #
 #                               StarPU-Top                                    #

+ 5 - 1
doc/chapters/configuration.texi

@@ -209,10 +209,14 @@ enabled when the GCC compiler provides a plug-in support.
 @end defvr
 
 @defvr {Configure option} --with-mpicc=@var{path}
-Use the @command{mpicc} compiler at @var{path}, for starpumpi
+Use the @command{mpicc} compiler at @var{path}, for StarPU-MPI.
 (@pxref{StarPU MPI support}).
 @end defvr
 
+@defvr {Configure option} --enable-mpi-progression-hook
+Enable the activity polling method for StarPU-MPI.
+@end defvr
+
 @node Advanced configuration
 @subsection Advanced configuration
 

+ 11 - 15
mpi/src/starpu_mpi.c

@@ -23,11 +23,7 @@
 #include <starpu_profiling.h>
 #include <starpu_mpi_stats.h>
 #include <starpu_mpi_insert_task.h>
-
-#ifdef STARPU_DEVEL
-#  warning TODO find a better way to select the polling method (perhaps during the configuration)
-#endif
-//#define USE_STARPU_ACTIVITY	1
+#include <common/config.h>
 
 static void _starpu_mpi_submit_new_mpi_request(void *arg);
 static void _starpu_mpi_handle_request_termination(struct _starpu_mpi_req *req);
@@ -699,7 +695,7 @@ static void _starpu_mpi_submit_new_mpi_request(void *arg)
 	_STARPU_MPI_LOG_OUT();
 }
 
-#ifdef USE_STARPU_ACTIVITY
+#ifdef STARPU_MPI_ACTIVITY
 static unsigned _starpu_mpi_progression_hook_func(void *arg __attribute__((unused)))
 {
 	unsigned may_block = 1;
@@ -714,7 +710,7 @@ static unsigned _starpu_mpi_progression_hook_func(void *arg __attribute__((unuse
 
 	return may_block;
 }
-#endif
+#endif /* STARPU_MPI_ACTIVITY */
 
 static void _starpu_mpi_test_detached_requests(void)
 {
@@ -885,9 +881,9 @@ static void *_starpu_mpi_progress_thread_func(void *arg)
 		/* shall we block ? */
 		unsigned block = _starpu_mpi_req_list_empty(new_requests);
 
-#ifndef USE_STARPU_ACTIVITY
+#ifndef STARPU_MPI_ACTIVITY
 		block = block && _starpu_mpi_req_list_empty(detached_requests);
-#endif
+#endif /* STARPU_MPI_ACTIVITY */
 
 		if (block)
 		{
@@ -946,9 +942,9 @@ static void *_starpu_mpi_progress_thread_func(void *arg)
 /*                                                      */
 /********************************************************/
 
-#ifdef USE_STARPU_ACTIVITY
+#ifdef STARPU_MPI_ACTIVITY
 static int hookid = - 1;
-#endif
+#endif /* STARPU_MPI_ACTIVITY */
 
 static void _starpu_mpi_add_sync_point_in_fxt(void)
 {
@@ -1006,10 +1002,10 @@ int _starpu_mpi_initialize(int *argc, char ***argv, int initialize_mpi)
 		_STARPU_PTHREAD_COND_WAIT(&cond_progression, &mutex);
 	_STARPU_PTHREAD_MUTEX_UNLOCK(&mutex);
 
-#ifdef USE_STARPU_ACTIVITY
+#ifdef STARPU_MPI_ACTIVITY
 	hookid = starpu_progression_hook_register(progression_hook_func, NULL);
 	STARPU_ASSERT(hookid >= 0);
-#endif
+#endif /* STARPU_MPI_ACTIVITY */
 
 	_starpu_mpi_add_sync_point_in_fxt();
 	_starpu_mpi_comm_amounts_init(MPI_COMM_WORLD);
@@ -1058,9 +1054,9 @@ int starpu_mpi_shutdown(void)
 
 	pthread_join(progress_thread, &value);
 
-#ifdef USE_STARPU_ACTIVITY
+#ifdef STARPU_MPI_ACTIVITY
 	starpu_progression_hook_deregister(hookid);
-#endif
+#endif /* STARPU_MPI_ACTIVITY */
 
 	TRACE_MPI_STOP(rank, world_size);