Parcourir la source

In traces, make MPI prefix really a prefix, and make it shorter: just the rank number

Samuel Thibault il y a 12 ans
Parent
commit
0c4af1481c
2 fichiers modifiés avec 26 ajouts et 26 suppressions
  1. 21 21
      src/debug/traces/starpu_fxt.c
  2. 5 5
      src/debug/traces/starpu_fxt_mpi.c

+ 21 - 21
src/debug/traces/starpu_fxt.c

@@ -191,19 +191,19 @@ static void update_accumulated_time(int worker, double sleep_time, double exec_t
 #ifdef STARPU_HAVE_POTI
 static char *memnode_container_alias(char *output, int len, const char *prefix, long unsigned int memnodeid)
 {
-	snprintf(output, len, "mn%s%"PRIu64"", prefix, memnodeid);
+	snprintf(output, len, "%smn%"PRIu64"", prefix, memnodeid);
 	return output;
 }
 
 static char *thread_container_alias(char *output, int len, const char *prefix, long unsigned int threadid)
 {
-	snprintf(output, len, "t%s%"PRIu64"", prefix, threadid);
+	snprintf(output, len, "%st%"PRIu64"", prefix, threadid);
 	return output;
 }
 
 static char *worker_container_alias(char *output, int len, const char *prefix, long unsigned int workerid)
 {
-	snprintf(output, len, "w%s%"PRIu64"", prefix, workerid);
+	snprintf(output, len, "%sw%"PRIu64"", prefix, workerid);
 	return output;
 }
 
@@ -227,7 +227,7 @@ static void memnode_set_state(double time, const char *prefix, unsigned int memn
 	memnode_container_alias(container, STARPU_POTI_STR_LEN, prefix, memnodeid);
 	poti_SetState(time, container, "MS", name);
 #else
-	fprintf(out_paje_file, "10	%.9f	mn%s%u	MS	%s\n", time, prefix, memnodeid, name);
+	fprintf(out_paje_file, "10	%.9f	%smn%u	MS	%s\n", time, prefix, memnodeid, name);
 #endif
 }
 
@@ -238,7 +238,7 @@ static void worker_set_state(double time, const char *prefix, long unsigned int
 	thread_container_alias(container, STARPU_POTI_STR_LEN, prefix, workerid);
 	poti_SetState(time, container, "S", name);
 #else
-	fprintf(out_paje_file, "10	%.9f	t%s%"PRIu64"	S	%s\n", time, prefix, workerid, name);
+	fprintf(out_paje_file, "10	%.9f	%st%"PRIu64"	S	%s\n", time, prefix, workerid, name);
 #endif
 }
 
@@ -259,17 +259,17 @@ static void handle_new_mem_node(struct fxt_ev_64 *ev, struct starpu_fxt_options
 		char new_memnode_container_alias[STARPU_POTI_STR_LEN], new_memnode_container_name[STARPU_POTI_STR_LEN];
 		memnode_container_alias (new_memnode_container_alias, STARPU_POTI_STR_LEN, prefix, ev->param[0]);
 		/* TODO: ramkind */
-		snprintf(new_memnode_container_name, STARPU_POTI_STR_LEN, "MEMNODE%s%"PRIu64"", prefix, ev->param[0]);
+		snprintf(new_memnode_container_name, STARPU_POTI_STR_LEN, "%sMEMNODE%"PRIu64"", prefix, ev->param[0]);
 		poti_CreateContainer(get_event_time_stamp(ev, options), new_memnode_container_alias, "Mn", program_container, new_memnode_container_name);
 #else
-		fprintf(out_paje_file, "7	%.9f	mn%s%"PRIu64"	Mn	%sp	MEMNODE%s%"PRIu64"\n", get_event_time_stamp(ev, options), prefix, ev->param[0], prefix, options->file_prefix, ev->param[0]);
+		fprintf(out_paje_file, "7	%.9f	%smn%"PRIu64"	Mn	%sp	%sMEMNODE%"PRIu64"\n", get_event_time_stamp(ev, options), prefix, ev->param[0], prefix, options->file_prefix, ev->param[0]);
 #endif
 
 		if (!options->no_bus)
 #ifdef STARPU_HAVE_POTI
 			poti_SetVariable(get_event_time_stamp(ev, options), new_memnode_container_alias, "bw", 0.0);
 #else
-			fprintf(out_paje_file, "13	%.9f	mn%s%"PRIu64"	bw	0.0\n", 0.0f, prefix, ev->param[0]);
+			fprintf(out_paje_file, "13	%.9f	%smn%"PRIu64"	bw	0.0\n", 0.0f, prefix, ev->param[0]);
 #endif
 	}
 }
@@ -330,14 +330,14 @@ static void handle_worker_init_start(struct fxt_ev_64 *ev, struct starpu_fxt_opt
 		char new_thread_container_name[STARPU_POTI_STR_LEN];
 		snprintf(new_thread_container_name, STARPU_POTI_STR_LEN, "%s%d", prefix, threadid);
 		char new_worker_container_name[STARPU_POTI_STR_LEN];
-		snprintf(new_worker_container_name, STARPU_POTI_STR_LEN, "%s%s%d", kindstr, prefix, devid);
+		snprintf(new_worker_container_name, STARPU_POTI_STR_LEN, "%s%s%d", prefix, kindstr, devid);
 		poti_CreateContainer(get_event_time_stamp(ev, options), new_thread_container_alias, "T", memnode_container, new_thread_container_name);
 		poti_CreateContainer(get_event_time_stamp(ev, options), new_worker_container_alias, "W", new_thread_container_alias, new_worker_container_name);
 #else
-		fprintf(out_paje_file, "7	%.9f	t%s%d	T	mn%s%d	%s%d\n",
+		fprintf(out_paje_file, "7	%.9f	%st%d	T	%smn%d	%s%d\n",
 			get_event_time_stamp(ev, options), prefix, threadid, prefix, nodeid, prefix, threadid);
-		fprintf(out_paje_file, "7	%.9f	w%s%d	W	t%s%d	%s%s%d\n",
-			get_event_time_stamp(ev, options), prefix, workerid, prefix, threadid, kindstr, prefix, devid);
+		fprintf(out_paje_file, "7	%.9f	%sw%d	W	%st%d	%s%s%d\n",
+			get_event_time_stamp(ev, options), prefix, workerid, prefix, threadid, prefix, kindstr, devid);
 #endif
 	}
 
@@ -385,7 +385,7 @@ static void handle_worker_deinit_end(struct fxt_ev_64 *ev, struct starpu_fxt_opt
 		thread_container_alias(worker_container, STARPU_POTI_STR_LEN, prefix, ev->param[1]);
 		poti_DestroyContainer(get_event_time_stamp(ev, options), "T", worker_container);
 #else
-		fprintf(out_paje_file, "8	%.9f	t%s%"PRIu64"	T\n",
+		fprintf(out_paje_file, "8	%.9f	%st%"PRIu64"	T\n",
 			get_event_time_stamp(ev, options), prefix, ev->param[1]);
 #endif
 	}
@@ -508,7 +508,7 @@ static void handle_start_codelet_body(struct fxt_ev_64 *ev, struct starpu_fxt_op
 			thread_container_alias(container, STARPU_POTI_STR_LEN, prefix, ev->param[2]);
 			poti_SetState(start_codelet_time, container, ctx, name);
 #else
-			fprintf(out_paje_file, "10	%.9f	t%s%"PRIu64"	Ctx%d	%s\n", start_codelet_time, prefix, ev->param[2], sched_ctx, name);
+			fprintf(out_paje_file, "10	%.9f	%st%"PRIu64"	Ctx%d	%s\n", start_codelet_time, prefix, ev->param[2], sched_ctx, name);
 #endif
 		}
 	}
@@ -586,7 +586,7 @@ static void handle_user_event(struct fxt_ev_64 *ev, struct starpu_fxt_options *o
 #ifdef STARPU_HAVE_POTI
 			thread_container_alias (container, STARPU_POTI_STR_LEN, prefix, ev->param[1]);
 #else
-			fprintf(out_paje_file, "9	%.9f	event	t%s%"PRIu64"	%lu\n", get_event_time_stamp(ev, options), prefix, ev->param[1], code);
+			fprintf(out_paje_file, "9	%.9f	event	%st%"PRIu64"	%lu\n", get_event_time_stamp(ev, options), prefix, ev->param[1], code);
 #endif
 	}
 #ifdef STARPU_HAVE_POTI
@@ -687,7 +687,7 @@ static void handle_start_driver_copy(struct fxt_ev_64 *ev, struct starpu_fxt_opt
 			memnode_container_alias(src_memnode_container, STARPU_POTI_STR_LEN, prefix, src);
 			poti_StartLink(time, program_container, "L", src_memnode_container, paje_value, paje_key);
 #else
-			fprintf(out_paje_file, "18	%.9f	L	%sp	%u	mn%s%u	com_%u\n", time, prefix, size, prefix, src, comid);
+			fprintf(out_paje_file, "18	%.9f	L	%sp	%u	%smn%u	com_%u\n", time, prefix, size, prefix, src, comid);
 #endif
 		}
 
@@ -727,7 +727,7 @@ static void handle_end_driver_copy(struct fxt_ev_64 *ev, struct starpu_fxt_optio
 			memnode_container_alias(dst_memnode_container, STARPU_POTI_STR_LEN, prefix, dst);
 			poti_EndLink(time, program_container, "L", dst_memnode_container, paje_value, paje_key);
 #else
-			fprintf(out_paje_file, "19	%.9f	L	%sp	%u	mn%s%u	com_%u\n", time, prefix, size, prefix, dst, comid);
+			fprintf(out_paje_file, "19	%.9f	L	%sp	%u	%smn%u	com_%u\n", time, prefix, size, prefix, dst, comid);
 #endif
 		}
 
@@ -1012,7 +1012,7 @@ void _starpu_fxt_display_bandwidth(struct starpu_fxt_options *options)
 			memnode_container_alias(src_memnode_container, STARPU_POTI_STR_LEN, prefix, itor->src_node);
 			poti_SetVariable(itor->comm_start, src_memnode_container, "bw", current_bandwidth_per_node[itor->src_node]);
 #else
-			fprintf(out_paje_file, "13	%.9f	mn%s%u	bw	%f\n",
+			fprintf(out_paje_file, "13	%.9f	%smn%u	bw	%f\n",
 				itor->comm_start, prefix, itor->src_node, current_bandwidth_per_node[itor->src_node]);
 #endif
 		}
@@ -1025,7 +1025,7 @@ void _starpu_fxt_display_bandwidth(struct starpu_fxt_options *options)
 			memnode_container_alias(dst_memnode_container, STARPU_POTI_STR_LEN, prefix, itor->dst_node);
 			poti_SetVariable(itor->comm_start, dst_memnode_container, "bw", current_bandwidth_per_node[itor->dst_node]);
 #else
-			fprintf(out_paje_file, "13	%.9f	mn%s%u	bw	%f\n",
+			fprintf(out_paje_file, "13	%.9f	%smn%u	bw	%f\n",
 				itor->comm_start, prefix, itor->dst_node, current_bandwidth_per_node[itor->dst_node]);
 #endif
 		}
@@ -1082,7 +1082,7 @@ void starpu_fxt_parse_new_file(char *filename_in, struct starpu_fxt_options *opt
 			poti_SetVariable(0.0, new_scheduler_container_alias, "ntask", 0.0);
 		}
 #else
-		fprintf(out_paje_file, "7	0.0	%sp	P	MPIroot	program%s \n", prefix, prefix);
+		fprintf(out_paje_file, "7	0.0	%sp	P	MPIroot	%sprogram \n", prefix, prefix);
 		/* create a variable with the number of tasks */
 		if (!options->no_counter)
 		{
@@ -1529,7 +1529,7 @@ void starpu_fxt_generate_trace(struct starpu_fxt_options *options)
 #endif
 
 			char file_prefix[32];
-			snprintf(file_prefix, 32, "mpi_%d_", filerank);
+			snprintf(file_prefix, 32, "%d_", filerank);
 
 			options->file_prefix = file_prefix;
 			options->file_offset = offsets[inputfile];

+ 5 - 5
src/debug/traces/starpu_fxt_mpi.c

@@ -1,6 +1,6 @@
 /* StarPU --- Runtime system for heterogeneous multicore architectures.
  *
- * Copyright (C) 2012  Université Bordeaux 1
+ * Copyright (C) 2012-2013  Université Bordeaux 1
  * Copyright (C) 2010, 2011  Centre National de la Recherche Scientifique
  *
  * StarPU is free software; you can redistribute it and/or modify
@@ -229,13 +229,13 @@ static void display_all_transfers_from_trace(FILE *out_paje_file, int src)
 				snprintf(paje_value, STARPU_POTI_STR_LEN, "%lu", (long unsigned) size);
 				snprintf(paje_key, STARPU_POTI_STR_LEN, "mpicom_%lu", id);
 				char mpi_container[STARPU_POTI_STR_LEN];
-				snprintf(mpi_container, sizeof(mpi_container), "mpi_%d_p", /* XXX */src);
+				snprintf(mpi_container, sizeof(mpi_container), "%d_p", /* XXX */src);
 				poti_StartLink(start_date, "MPIroot", "MPIL", mpi_container, paje_value, paje_key);
-				snprintf(mpi_container, sizeof(mpi_container), "mpi_%d_p", /* XXX */dst);
+				snprintf(mpi_container, sizeof(mpi_container), "%d_p", /* XXX */dst);
 				poti_EndLink(end_date, "MPIroot", "MPIL", mpi_container, paje_value, paje_key);
 #else
-				fprintf(out_paje_file, "18	%.9f	MPIL	MPIroot	%ld	mpi_%d_p	mpicom_%lu\n", start_date, size, /* XXX */src, id);
-				fprintf(out_paje_file, "19	%.9f	MPIL	MPIroot	%ld	mpi_%d_p	mpicom_%lu\n", end_date, size, /* XXX */dst, id);
+				fprintf(out_paje_file, "18	%.9f	MPIL	MPIroot	%ld	%d_p	mpicom_%lu\n", start_date, size, /* XXX */src, id);
+				fprintf(out_paje_file, "19	%.9f	MPIL	MPIroot	%ld	%d_p	mpicom_%lu\n", end_date, size, /* XXX */dst, id);
 #endif
 			}
 		}