Explorar el Código

In case we have multiple processes using StarPU (eg. with MPI), we need to
generate multiple traces at the same time, so we suffix the trace file's name
with the pid of the process.

Cédric Augonnet hace 15 años
padre
commit
4ac9f355f0
Se han modificado 1 ficheros con 13 adiciones y 3 borrados
  1. 13 3
      src/common/fxt.c

+ 13 - 3
src/common/fxt.c

@@ -38,9 +38,19 @@ static void profile_set_tracefile(char *fmt, ...)
 	va_start(vl, fmt);
 	vsprintf(PROF_FILE_USER, fmt, vl);
 	va_end(vl);
-	strcat(PROF_FILE_USER, "_user_");
-	if ((user = getenv("USER")))
-		strcat(PROF_FILE_USER, user);
+
+	user = getenv("USER");
+	if (!user)
+		user = "";
+
+	int pid = getpid();
+
+	char suffix[128];
+	snprintf(suffix, 128, "_user_%s_%d", user, pid);
+
+	strcat(PROF_FILE_USER, suffix);
+
+
 }