From 488c1fcafff1411fa31f048fa4d957a0f684de06 Mon Sep 17 00:00:00 2001 From: Bojan Rosko Date: Wed, 13 Nov 2024 10:40:33 +0000 Subject: [PATCH] temp dir --- device/tt_cluster_descriptor.cpp | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/device/tt_cluster_descriptor.cpp b/device/tt_cluster_descriptor.cpp index c57bdec8..97c5a711 100644 --- a/device/tt_cluster_descriptor.cpp +++ b/device/tt_cluster_descriptor.cpp @@ -303,9 +303,11 @@ std::string tt_ClusterDescriptor::get_cluster_descriptor_file_path() { static std::string yaml_path; static bool is_initialized = false; if (!is_initialized){ - // Cluster descriptor path will be created in the working directory. - std::filesystem::path cluster_path_dir = std::filesystem::path(".umd"); - std::filesystem::create_directories( cluster_path_dir ); + + // Cluster descriptor yaml will be created in a unique temporary directory. + std::filesystem::path temp_path = std::filesystem::temp_directory_path(); + std::string cluster_path_dir_template = temp_path / "umd_XXXXXX"; + std::filesystem::path cluster_path_dir = mkdtemp(cluster_path_dir_template.data()); std::filesystem::path cluster_path = cluster_path_dir / "cluster_descriptor.yaml"; if (!std::filesystem::exists(cluster_path)){ auto val = system ( ("touch " + cluster_path.string()).c_str());