Accéder au contenu.
Menu Sympa

starpu-devel - Re: [Starpu-devel] [Starpu-commits] [Review needed] Move $HOME/.starpu/sampling to $XDG_CACHE_HOME/starpu/sampling

Objet : Developers list for StarPU

Archives de la liste

Re: [Starpu-devel] [Starpu-commits] [Review needed] Move $HOME/.starpu/sampling to $XDG_CACHE_HOME/starpu/sampling


Chronologique Discussions 
  • From: ludovic.courtes@inria.fr (Ludovic Courtès)
  • To: Cyril Roelandt <cyril.roelandt@inria.fr>
  • Cc: starpu-devel@lists.gforge.inria.fr
  • Subject: Re: [Starpu-devel] [Starpu-commits] [Review needed] Move $HOME/.starpu/sampling to $XDG_CACHE_HOME/starpu/sampling
  • Date: Tue, 13 Dec 2011 15:46:15 +0100
  • List-archive: <http://lists.gforge.inria.fr/pipermail/starpu-devel>
  • List-id: "Developers list. For discussion of new features, code changes, etc." <starpu-devel.lists.gforge.inria.fr>

Hello!

(Moving to starpu-devel.)

Cyril Roelandt <cyril.roelandt@inria.fr> skribis:

> As Ludovic Courtes pointed out, the StarPU samplings should probably
> be stored in $XDG_CACHE_HOME/starpu/sampling rather than in
> $HOME/.starpu/sampling.
>
> Some of our users are probably used to having these files in
> $HOME/.starpu/sampling though, so it would be nice if nothing was to
> change for them.
>
> The following patch makes sure we store our perfmodels in
> $XDG_CACHE_HOME or $HOME/.cache if $HOME/.starpu/sampling does not
> exist :

Nice!

> --- src/core/perfmodel/perfmodel.c (revision 4847)
> +++ src/core/perfmodel/perfmodel.c (working copy)
> @@ -335,9 +335,27 @@
> const char *home_path = getenv("HOME");
> if (!home_path)
> home_path = getenv("USERPROFILE");
> - if (!home_path)
> +
> + if (home_path)
> + {
> + snprintf(path, maxlen, "%s/.starpu/sampling/", home_path);
> + int ret;
> + struct stat dummy;
> +
> + /* It already exists, let's use it */
> + ret = stat(path, &dummy);
> + if (ret == 0)
> + return;
> + }
> +
> + /* $HOME/.starpu/sampling/ does not exist, let's try other
> locations */
> + char *xdg_cache_home = getenv("XDG_CACHE_HOME");
> + if (xdg_cache_home)
> + snprintf(path, maxlen, "%s/starpu/sampling/",
> xdg_cache_home);
> + else if (home_path)
> + snprintf(path, maxlen, "%s/.cache/starpu/sampling/",
> home_path);
> + else
> _STARPU_ERROR("couldn't find a home place to put
> starpu data\n");
> - snprintf(path, maxlen, "%s/.starpu/sampling/", home_path);
> #endif
> }

Looks good to me!

Could you update the manual while you’re at it? :-)

> Brice Goglin also suggested that if neither $XDG_CACHE_HOME or $HOME
> were set, we should probably use $STARPU_PREFIX/share. I'm not sure we
> define STARPU_PREFIX though.

I don’t think it’s necessary, especially since $prefix is likely to be
read-only.

Thanks,
Ludo’.





Archives gérées par MHonArc 2.6.19+.

Haut de le page