Sfoglia il codice sorgente

src/core/disk.c: create directory when needed

Nathalie Furmento 10 anni fa
parent
commit
7db76b5ca3
1 ha cambiato i file con 11 aggiunte e 0 eliminazioni
  1. 11 0
      src/core/disk.c

+ 11 - 0
src/core/disk.c

@@ -378,19 +378,30 @@ _starpu_swap_init(void)
 
 	backend = getenv("STARPU_DISK_SWAP_BACKEND");
 	if (!backend)
+	{
+		_starpu_mkpath(path, S_IRWXU);
 		ops = &starpu_disk_unistd_ops;
+	}
 	else if (!strcmp(backend, "stdio"))
+	{
+		_starpu_mkpath(path, S_IRWXU);
 		ops = &starpu_disk_stdio_ops;
+	}
 	else if (!strcmp(backend, "unistd"))
+	{
+		_starpu_mkpath(path, S_IRWXU);
 		ops = &starpu_disk_unistd_ops;
+	}
 	else if (!strcmp(backend, "unistd_o_direct"))
 	{
 #ifdef STARPU_LINUX_SYS
+		_starpu_mkpath(path, S_IRWXU);
 		ops = &starpu_disk_unistd_o_direct_ops;
 #else
 		_STARPU_DISP("Warning: o_direct support is not compiled in, could not enable disk swap");
 		return;
 #endif
+
 	}
 	else if (!strcmp(backend, "leveldb"))
 	{