Browse Source

Make sure that the directory that should contain the performance models is
created before writing in it.

Cédric Augonnet 15 years ago
parent
commit
fff603e54c
1 changed files with 12 additions and 2 deletions
  1. 12 2
      src/core/perfmodel/perfmodel_bus.c

+ 12 - 2
src/core/perfmodel/perfmodel_bus.c

@@ -180,7 +180,11 @@ static void write_bus_latency_file_content(void)
 	get_latency_path(path, 256);
 
 	f = fopen(path, "w+");
-	STARPU_ASSERT(f);
+	if (!f)
+	{
+		perror("fopen");
+		STARPU_ASSERT(0);
+	}
 
 	for (src = 0; src < MAXNODES; src++)
 	{
@@ -249,7 +253,11 @@ static void load_bus_bandwith_file_content(void)
 	get_bandwith_path(path, 256);
 
 	f = fopen(path, "r");
-	STARPU_ASSERT(f);
+	if (!f)
+	{
+		perror("fopen");
+		STARPU_ASSERT(0);
+	}
 
 	for (src = 0; src < MAXNODES; src++)
 	{
@@ -345,6 +353,8 @@ static void load_bus_bandwith_file(void)
 
 void load_bus_performance_files(void)
 {
+	create_sampling_directory_if_needed();
+
 	load_bus_latency_file();
 	load_bus_bandwith_file();
 }