Bläddra i källkod

src/common/fxt.c: create directory in which to dump trace file

Nathalie Furmento 4 år sedan
förälder
incheckning
ff44bd2b5e
2 ändrade filer med 7 tillägg och 15 borttagningar
  1. 5 14
      src/common/fxt.c
  2. 2 1
      tools/gdbinit

+ 5 - 14
src/common/fxt.c

@@ -95,26 +95,17 @@ static void _starpu_profile_set_tracefile(void)
 
 	char *fxt_prefix = starpu_getenv("STARPU_FXT_PREFIX");
 	if (!fxt_prefix)
-	     fxt_prefix = "/tmp/";
+		fxt_prefix = "/tmp";
 	else
-	{
-		// Check if the given folder really exists:
-		struct stat folder_stat;
-		if (stat(fxt_prefix, &folder_stat) < 0 || !S_ISDIR(folder_stat.st_mode))
-		{
-			_STARPU_MSG("%s is not a valid directory.\n", fxt_prefix);
-			_starpu_abort();
-		}
-	}
-
-	user = starpu_getenv("USER");
-	if (!user)
-		user = "";
+		_starpu_mkpath_and_check(fxt_prefix, S_IRWXU);
 
 	char suffix[127];
 	char *fxt_suffix = starpu_getenv("STARPU_FXT_SUFFIX");
 	if (!fxt_suffix)
 	{
+		user = starpu_getenv("USER");
+		if (!user)
+			user = "";
 		snprintf(suffix, sizeof(suffix), "prof_file_%s_%d", user, _starpu_id);
 	}
 	else

+ 2 - 1
tools/gdbinit

@@ -15,7 +15,8 @@
 #
 # To set a breakpoint when starting gdb with option "-ex run",
 # here what you need to do:
-#set breakpoint pending on
+set breakpoint pending on
+break _starpu_bubble_partition_data_if_needed
 #break starpu_mpi.c:419
 
 define starpu-print-job