Kaynağa Gözat

New environment variable STARPU_FXT_SUFFIX to set the filename in which to save the fxt trace

Nathalie Furmento 4 yıl önce
ebeveyn
işleme
1f7d5547cd

+ 4 - 0
ChangeLog

@@ -50,6 +50,10 @@ Small changes:
 StarPU 1.3.5 (git revision xxx)
 ====================================================================
 
+Small features:
+  * New environment variable STARPU_FXT_SUFFIX to set the filename in
+    which to save the fxt trace
+
 Small changes:
   * Move MPI cache functions into the public API
   * Add STARPU_MPI_NOBIND environment variable.

+ 3 - 1
doc/doxygen/chapters/380_offline_performance_tools.doxy

@@ -84,7 +84,9 @@ Or you can simply point the <c>PKG_CONFIG_PATH</c> to
 When FxT is enabled, a trace is generated when StarPU is terminated by calling
 starpu_shutdown(). The trace is a binary file whose name has the form
 <c>prof_file_XXX_YYY</c> where <c>XXX</c> is the user name, and
-<c>YYY</c> is the pid of the process that used StarPU. This file is saved in the
+<c>YYY</c> is the pid of the process that used StarPU. One can change
+the name of the file by setting the environnement variable \ref
+STARPU_FXT_SUFFIX. This file is saved in the
 <c>/tmp/</c> directory by default, or by the directory specified by
 the environment variable \ref STARPU_FXT_PREFIX.
 

+ 9 - 2
doc/doxygen/chapters/501_environment_variables.doxy

@@ -935,14 +935,21 @@ Specify in which file the debugging output should be saved to.
 <dd>
 \anchor STARPU_FXT_PREFIX
 \addindex __env__STARPU_FXT_PREFIX
-Specify in which directory to save the trace generated if FxT is enabled. It needs to have a trailing '/' character.
+Specify in which directory to save the generated trace if FxT is enabled.
+</dd>
+
+<dt>STARPU_FXT_SUFFIX</dt>
+<dd>
+\anchor STARPU_FXT_SUFFIX
+\addindex __env__STARPU_FXT_SUFFIX
+Specify in which file to save the generated trace if FxT is enabled.
 </dd>
 
 <dt>STARPU_FXT_TRACE</dt>
 <dd>
 \anchor STARPU_FXT_TRACE
 \addindex __env__STARPU_FXT_TRACE
-Specify whether to generate (1) or not (0) the FxT trace in /tmp/prof_file_XXX_YYY . The default is 1 (generate it)
+Specify whether to generate (1) or not (0) the FxT trace in /tmp/prof_file_XXX_YYY (the directory and file name can be changed with \ref STARPU_FXT_PREFIX and \ref STARPU_FXT_SUFFIX). The default is 1 (generate it)
 </dd>
 
 <dt>STARPU_LIMIT_CUDA_devid_MEM</dt>

+ 9 - 1
src/common/fxt.c

@@ -112,7 +112,15 @@ static void _starpu_profile_set_tracefile(void)
 		user = "";
 
 	char suffix[127];
-	snprintf(suffix, sizeof(suffix), "prof_file_%s_%d", user, _starpu_id);
+	char *fxt_suffix = starpu_getenv("STARPU_FXT_SUFFIX");
+	if (!fxt_suffix)
+	{
+		snprintf(suffix, sizeof(suffix), "prof_file_%s_%d", user, _starpu_id);
+	}
+	else
+	{
+		snprintf(suffix, sizeof(suffix), "%s", fxt_suffix);
+	}
 
 	snprintf(_starpu_prof_file_user, sizeof(_starpu_prof_file_user), "%s/%s", fxt_prefix, suffix);
 }