Pārlūkot izejas kodu

add MPI Master Slave case in FxT

Corentin Salingue 8 gadi atpakaļ
vecāks
revīzija
53c207b848
1 mainītis faili ar 19 papildinājumiem un 0 dzēšanām
  1. 19 0
      src/debug/traces/starpu_fxt.c

+ 19 - 0
src/debug/traces/starpu_fxt.c

@@ -33,6 +33,7 @@
 #define CUDA_WORKER_COLORS_NB	9
 #define OPENCL_WORKER_COLORS_NB 9
 #define MIC_WORKER_COLORS_NB	9
+#define MPI_MS_WORKER_COLORS_NB	9
 #define SCC_WORKER_COLORS_NB	9
 #define OTHER_WORKER_COLORS_NB	4
 
@@ -40,6 +41,7 @@ static char *cpus_worker_colors[CPUS_WORKER_COLORS_NB] = {"/greens9/7", "/greens
 static char *cuda_worker_colors[CUDA_WORKER_COLORS_NB] = {"/ylorrd9/9", "/ylorrd9/6", "/ylorrd9/3", "/ylorrd9/1", "/ylorrd9/8", "/ylorrd9/7", "/ylorrd9/4", "/ylorrd9/2",  "/ylorrd9/1"};
 static char *opencl_worker_colors[OPENCL_WORKER_COLORS_NB] = {"/blues9/9", "/blues9/6", "/blues9/3", "/blues9/1", "/blues9/8", "/blues9/7", "/blues9/4", "/blues9/2",  "/blues9/1"};
 static char *mic_worker_colors[MIC_WORKER_COLORS_NB] = {"/reds9/9", "/reds9/6", "/reds9/3", "/reds9/1", "/reds9/8", "/reds9/7", "/reds9/4", "/reds9/2",  "/reds9/1"};
+static char *mpi_ms_worker_colors[MPI_MS_WORKER_COLORS_NB] = {"/reds9/9", "/reds9/6", "/reds9/3", "/reds9/1", "/reds9/8", "/reds9/7", "/reds9/4", "/reds9/2",  "/reds9/1"};
 static char *scc_worker_colors[SCC_WORKER_COLORS_NB] = {"/reds9/9", "/reds9/6", "/reds9/3", "/reds9/1", "/reds9/8", "/reds9/7", "/reds9/4", "/reds9/2",  "/reds9/1"};
 static char *other_worker_colors[OTHER_WORKER_COLORS_NB] = {"/greys9/9", "/greys9/8", "/greys9/7", "/greys9/6"};
 static char *worker_colors[STARPU_NMAXWORKERS];
@@ -48,6 +50,7 @@ static unsigned opencl_index = 0;
 static unsigned cuda_index = 0;
 static unsigned cpus_index = 0;
 static unsigned mic_index = 0;
+static unsigned mpi_ms_index = 0;
 static unsigned scc_index = 0;
 static unsigned other_index = 0;
 
@@ -247,6 +250,14 @@ static void set_next_mic_worker_color(int workerid)
 	if (mic_index == MIC_WORKER_COLORS_NB) mic_index = 0;
 }
 
+static void set_next_mpi_ms_worker_color(int workerid)
+{
+	if (workerid >= STARPU_NMAXWORKERS)
+		return;
+	worker_colors[workerid] = mpi_ms_worker_colors[mpi_ms_index++];
+	if (mpi_ms_index == MPI_MS_WORKER_COLORS_NB) mpi_ms_index = 0;
+}
+
 static void set_next_scc_worker_color(int workerid)
 {
 	if (workerid >= STARPU_NMAXWORKERS)
@@ -900,6 +911,14 @@ static void handle_worker_init_start(struct fxt_ev_64 *ev, struct starpu_fxt_opt
 			arch.devices[0].devid = devid;
 			arch.devices[0].ncores = 1;
 			break;
+		case _STARPU_FUT_MPI_KEY:
+			set_next_mpi_ms_worker_color(workerid);
+			kindstr = "mpi_ms";
+			arch.devices[0].type = STARPU_MPI_WORKER;
+			arch.devices[0].devid = devid;
+			arch.devices[0].ncores = 1;
+			break;
+			
 		case _STARPU_FUT_SCC_KEY:
 			set_next_scc_worker_color(workerid);
 			kindstr = "scc";