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

Merge branch 'master' of git+ssh://scm.gforge.inria.fr/gitroot/starpu/starpu into ft_checkpoint

Romain LION лет назад: 5
Родитель
Сommit
efee900a03
6 измененных файлов с 59 добавлено и 1 удалено
  1. 6 0
      ChangeLog
  2. 3 1
      doc/doxygen/chapters/320_scheduling.doxy
  3. 16 0
      include/starpu_helper.h
  4. 6 0
      mpi/include/starpu_mpi.h
  5. 5 0
      mpi/src/starpu_mpi_init.c
  6. 23 0
      src/core/topology.c

+ 6 - 0
ChangeLog

@@ -33,6 +33,12 @@ New features:
   * New STARPU_PER_WORKER perfmodel.
   * New STARPU_PER_WORKER perfmodel.
   * Add energy accounting in the simgrid mode: starpu_energy_use() and
   * Add energy accounting in the simgrid mode: starpu_energy_use() and
     starpu_energy_used().
     starpu_energy_used().
+  * New function starpu_mpi_get_thread_cpuid() to know where is bound the MPI
+    thread.
+  * New function starpu_get_pu_os_index() to convert logical index of a PU to
+    its OS index.
+  * New function starpu_get_hwloc_topology() to get a copy of the hwloc
+    topology used by StarPU.
 
 
 Small changes:
 Small changes:
   * Use the S4U interface of Simgrid instead of xbt and MSG.
   * Use the S4U interface of Simgrid instead of xbt and MSG.

+ 3 - 1
doc/doxygen/chapters/320_scheduling.doxy

@@ -205,7 +205,9 @@ simply tend to run all computations on the most energy-conservative processing
 unit. To account for the consumption of the whole machine (including idle
 unit. To account for the consumption of the whole machine (including idle
 processing units), the idle power of the machine should be given by setting
 processing units), the idle power of the machine should be given by setting
 <c>export STARPU_IDLE_POWER=200</c> (\ref STARPU_IDLE_POWER) for 200W, for instance. This value can often
 <c>export STARPU_IDLE_POWER=200</c> (\ref STARPU_IDLE_POWER) for 200W, for instance. This value can often
-be obtained from the machine power supplier.
+be obtained from the machine power supplier, e.g. by running
+
+<c>ipmitool -I lanplus -H mymachine-ipmi -U myuser -P mypasswd sdr type Current</c>
 
 
 The energy actually consumed by the total execution can be displayed by setting
 The energy actually consumed by the total execution can be displayed by setting
 <c>export STARPU_PROFILING=1 STARPU_WORKER_STATS=1</c> (\ref STARPU_PROFILING and \ref STARPU_WORKER_STATS).
 <c>export STARPU_PROFILING=1 STARPU_WORKER_STATS=1</c> (\ref STARPU_PROFILING and \ref STARPU_WORKER_STATS).

+ 16 - 0
include/starpu_helper.h

@@ -20,6 +20,10 @@
 #include <stdio.h>
 #include <stdio.h>
 #include <starpu.h>
 #include <starpu.h>
 
 
+#ifdef STARPU_HAVE_HWLOC
+#include <hwloc.h>
+#endif
+
 #ifdef __cplusplus
 #ifdef __cplusplus
 extern "C"
 extern "C"
 {
 {
@@ -190,6 +194,18 @@ int starpu_data_cpy(starpu_data_handle_t dst_handle, starpu_data_handle_t src_ha
 */
 */
 void starpu_display_bindings(void);
 void starpu_display_bindings(void);
 
 
+/**
+   If \c hwloc is used, convert the given \p logical_index of a PU to the OS
+   index of this PU. If \c hwloc is not used, return \p logical_index.
+*/
+int starpu_get_pu_os_index(unsigned logical_index);
+
+#ifdef STARPU_HAVE_HWLOC
+/**
+   Get a copy of the hwloc topology used by StarPU.
+*/
+int starpu_get_hwloc_topology(hwloc_topology_t* topology);
+#endif
 /** @} */
 /** @} */
 
 
 #ifdef __cplusplus
 #ifdef __cplusplus

+ 6 - 0
mpi/include/starpu_mpi.h

@@ -136,6 +136,12 @@ int starpu_mpi_world_size(void);
 */
 */
 int starpu_mpi_comm_get_attr(MPI_Comm comm, int keyval, void *attribute_val, int *flag);
 int starpu_mpi_comm_get_attr(MPI_Comm comm, int keyval, void *attribute_val, int *flag);
 
 
+
+/**
+   Get the logical index of the core where the MPI thread is bound.
+*/
+int starpu_mpi_get_thread_cpuid(void);
+
 int starpu_mpi_get_communication_tag(void);
 int starpu_mpi_get_communication_tag(void);
 void starpu_mpi_set_communication_tag(int tag);
 void starpu_mpi_set_communication_tag(int tag);
 
 

+ 5 - 0
mpi/src/starpu_mpi_init.c

@@ -344,3 +344,8 @@ int starpu_mpi_world_rank(void)
 	starpu_mpi_comm_rank(MPI_COMM_WORLD, &rank);
 	starpu_mpi_comm_rank(MPI_COMM_WORLD, &rank);
 	return rank;
 	return rank;
 }
 }
+
+int starpu_mpi_get_thread_cpuid(void)
+{
+	return _starpu_mpi_thread_cpuid;
+}

+ 23 - 0
src/core/topology.c

@@ -3056,3 +3056,26 @@ void starpu_topology_print(FILE *output)
 		fprintf(output, "\n");
 		fprintf(output, "\n");
 	}
 	}
 }
 }
+
+int starpu_get_pu_os_index(unsigned logical_index)
+{
+#ifdef STARPU_HAVE_HWLOC
+	struct _starpu_machine_config *config = _starpu_get_machine_config();
+	struct _starpu_machine_topology *topology = &config->topology;
+
+	hwloc_topology_t topo = topology->hwtopology;
+
+	return hwloc_get_obj_by_type(topo, HWLOC_OBJ_PU, logical_index)->os_index;
+#else
+	return logical_index;
+#endif
+}
+
+#ifdef STARPU_HAVE_HWLOC
+int starpu_get_hwloc_topology(hwloc_topology_t* topology)
+{
+	struct _starpu_machine_config *config = _starpu_get_machine_config();
+
+	return hwloc_topology_dup(topology, config->topology.hwtopology);
+}
+#endif