Skip to content

Commit

Permalink
temp dir
Browse files Browse the repository at this point in the history
  • Loading branch information
broskoTT committed Nov 13, 2024
1 parent b497b04 commit 488c1fc
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions device/tt_cluster_descriptor.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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());
Expand Down

0 comments on commit 488c1fc

Please sign in to comment.