ソースを参照

mpi: add function starpu_mpi_get_thread_cpuid()

To know where is bound the MPI thread
Philippe SWARTVAGHER 4 年 前
コミット
683761bb4d
共有3 個のファイルを変更した13 個の追加0 個の削除を含む
  1. 2 0
      ChangeLog
  2. 6 0
      mpi/include/starpu_mpi.h
  3. 5 0
      mpi/src/starpu_mpi_init.c

+ 2 - 0
ChangeLog

@@ -33,6 +33,8 @@ New features:
   * New STARPU_PER_WORKER perfmodel.
   * Add energy accounting in the simgrid mode: starpu_energy_use() and
     starpu_energy_used().
+  * New function starpu_mpi_get_thread_cpuid() to know where is bound the MPI
+    thread
 
 Small changes:
   * Use the S4U interface of Simgrid instead of xbt and MSG.

+ 6 - 0
mpi/include/starpu_mpi.h

@@ -132,6 +132,12 @@ int starpu_mpi_world_size(void);
 */
 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);
 void starpu_mpi_set_communication_tag(int tag);
 

+ 5 - 0
mpi/src/starpu_mpi_init.c

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