Skip to content

Commit 4a5c36e

Browse files
Make Directory Name More Unique (#60)
* add ms to dirname * Try uuid * rm print
1 parent b439dc0 commit 4a5c36e

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

hpc_launcher/schedulers/scheduler.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@
2121
import tempfile
2222
import subprocess
2323
import shutil
24+
import uuid
2425
from hpc_launcher.cli.console_pipe import run_process_with_live_output
2526
from hpc_launcher.schedulers import parse_env_list
2627

@@ -473,8 +474,9 @@ def create_launch_folder_name(
473474
folder_name = os.getcwd()
474475
elif launch_dir == "":
475476
# Create a folder for the output and error logs
476-
# Timestamp is of the format YYYY-MM-DD_HHhMMmSSs
477-
folder_name = f'{folder_prefix}-{self.job_name or command_as_folder_name}_{time.strftime("%Y-%m-%d_%Hh%Mm%Ss")}'
477+
# Timestamp is of the format YYYY-MM-DD_HHhMMmSSs_UUID
478+
short_uuid = uuid.uuid4().hex[:8]
479+
folder_name = f'{folder_prefix}-{self.job_name or command_as_folder_name}_{time.strftime("%Y-%m-%d_%Hh%Mm%Ss")}_{short_uuid}'
478480
else:
479481
folder_name = launch_dir
480482

0 commit comments

Comments
 (0)