浏览代码

Correctly bind PIOman threads when STARPU_WORKER_GETBIND is enabled

Requires PM2 SVN revision 28932
Philippe SWARTVAGHER 4 年之前
父节点
当前提交
d7fc965289
共有 2 个文件被更改,包括 13 次插入0 次删除
  1. 4 0
      configure.ac
  2. 9 0
      mpi/src/nmad/starpu_mpi_nmad.c

+ 4 - 0
configure.ac

@@ -448,6 +448,10 @@ if test x$enable_mpi = xyes -a x$enable_nmad = xyes ; then
     build_nmad_lib=yes
     build_nmad_lib=yes
     build_mpi_lib=no
     build_mpi_lib=no
     PKG_CHECK_MODULES([NMAD],[nmad])
     PKG_CHECK_MODULES([NMAD],[nmad])
+    AC_CHECK_DECL([piom_ltask_set_bound_thread_os_indexes], have_piom_ltask_set_bound_thread_os_indexes=yes, have_piom_ltask_set_bound_thread_os_indexes=no, [[#include <pioman.h>]])
+    if test x$have_piom_ltask_set_bound_thread_os_indexes = xyes; then
+      AC_DEFINE(HAVE_PIOM_LTASK_SET_BOUND_THREAD_OS_INDEXES, [1], [piom_ltask_set_bound_thread_os_indexes is availabe])
+    fi
 else
 else
     build_nmad_lib=no
     build_nmad_lib=no
 fi
 fi

+ 9 - 0
mpi/src/nmad/starpu_mpi_nmad.c

@@ -634,9 +634,18 @@ int _starpu_mpi_progress_init(struct _starpu_mpi_argc_argv *argc_argv)
 
 
 	/* Tell pioman to use a bound thread for communication progression:
 	/* Tell pioman to use a bound thread for communication progression:
 	 * share the same core as StarPU's MPI thread, the MPI thread has very low activity with NMAD backend */
 	 * share the same core as StarPU's MPI thread, the MPI thread has very low activity with NMAD backend */
+#ifdef HAVE_PIOM_LTASK_SET_BOUND_THREAD_OS_INDEXES
+	/* We prefer to give the OS index of the core, because StarPU can have
+	 * a different vision of the topology, especially if STARPU_WORKERS_GETBIND
+	 * is enabled */
+	int indexes[1] = { starpu_get_pu_os_index((unsigned) _starpu_mpi_thread_cpuid) };
+	if (!_starpu_mpi_nobind)
+		piom_ltask_set_bound_thread_os_indexes(HWLOC_OBJ_PU, indexes, 1);
+#else
 	int indexes[1] = { _starpu_mpi_thread_cpuid };
 	int indexes[1] = { _starpu_mpi_thread_cpuid };
 	if (!_starpu_mpi_nobind)
 	if (!_starpu_mpi_nobind)
 		piom_ltask_set_bound_thread_indexes(HWLOC_OBJ_PU, indexes, 1);
 		piom_ltask_set_bound_thread_indexes(HWLOC_OBJ_PU, indexes, 1);
+#endif
 
 
 	/* Register some hooks for communication progress if needed */
 	/* Register some hooks for communication progress if needed */
 	int polling_point_prog, polling_point_idle;
 	int polling_point_prog, polling_point_idle;