From 5bb7c0027874c9b8061dacd0cd9ff3c7e7c9903d Mon Sep 17 00:00:00 2001 From: stadtler1 <s.stadtler@fz-juelich.de> Date: Tue, 30 Jun 2020 14:03:29 +0200 Subject: [PATCH] mkdir --> makedirs to allow for recursive directory creation --- .../DataExtraction/main_single_master.py | 20 ++++++++++++++++--- 1 file changed, 17 insertions(+), 3 deletions(-) diff --git a/workflow_parallel_frame_prediction/DataExtraction/main_single_master.py b/workflow_parallel_frame_prediction/DataExtraction/main_single_master.py index 4894408a..fda72c67 100644 --- a/workflow_parallel_frame_prediction/DataExtraction/main_single_master.py +++ b/workflow_parallel_frame_prediction/DataExtraction/main_single_master.py @@ -93,19 +93,33 @@ def main(): if clear_destination == 1: shutil.rmtree(destination_dir) os.mkdir(destination_dir) - logger.critical("Destination : {destination} exist -> Remove and Re-Cereate".format(destination=destination_dir)) - print("Destination : {destination} exist -> Remove and Re-Cereate".format(destination=destination_dir)) + logger.critical("Destination : {destination} exist -> Remove and Re-Create".format(destination=destination_dir)) + print("Destination : {destination} exist -> Remove and Re-Create".format(destination=destination_dir)) else: logger.critical("Destination : {destination} exist -> will not be removed (caution : overwrite)".format(destination=destination_dir)) print("Destination : {destination} exist -> will not be rmeoved (caution : overwrite)".format(destination=destination_dir)) + + + + # 20200630 +++ Scarlet + else: + if my_rank == 0: + os.makedirs(destination_dir) #, exist_ok=True) + logger.info("Destination : {destination} does not exist -> Create".format(destination=destination_dir)) + print("Destination : {destination} does not exist -> Create".format(destination=destination_dir)) + + # 20200630 --- Scarlet + # Create a log folder for slave-nodes to write down their processes slave_log_path = os.path.join(destination_dir,log_temp) if my_rank == 0: if os.path.exists(slave_log_path) == False: - os.mkdir(slave_log_path) + # 20200630 Scarlet + #os.mkdir(slave_log_path) + os.makedirs(slave_log_path) if my_rank == 0: # node is master -- GitLab