Browse Source

Also interpret STARPU_HOME

Samuel Thibault 13 years ago
parent
commit
1c42006ca2
2 changed files with 5 additions and 3 deletions
  1. 2 2
      doc/chapters/using.texi
  2. 3 1
      src/core/perfmodel/perfmodel.c

+ 2 - 2
doc/chapters/using.texi

@@ -56,8 +56,8 @@ AFTER First element is 3.140000
 @end example
 
 When StarPU is used for the first time, the directory
-@code{$HOME/.starpu/} is created, performance models will be stored in
-that directory.
+@code{$STARPU_HOME/.starpu/} is created, performance models will be stored in
+that directory (@code{STARPU_HOME} defaults to @code{$HOME})
 
 Please note that buses are benchmarked when StarPU is launched for the
 first time. This may take a few minutes, or less if @code{hwloc} is

+ 3 - 1
src/core/perfmodel/perfmodel.c

@@ -330,7 +330,9 @@ void _starpu_get_perf_model_dir(char *path, size_t maxlen)
 	snprintf(path, maxlen, "%s", STARPU_PERF_MODEL_DIR);
 #else
 	/* by default, we use $HOME/.starpu/sampling */
-	const char *home_path = getenv("HOME");
+	const char *home_path = getenv("STARPU_HOME");
+	if (!home_path)
+		home_path = getenv("HOME");
 	if (!home_path)
 		home_path = getenv("USERPROFILE");
 	if (!home_path)