diff --git a/autosubmit/autosubmit.py b/autosubmit/autosubmit.py index 3bd4d0c4cc8cb08e589a9e1f0df80f58f8f8dbb8..ba62f7a43dbefa71a2652760bf421bd47cf20a0e 100644 --- a/autosubmit/autosubmit.py +++ b/autosubmit/autosubmit.py @@ -200,7 +200,7 @@ class Autosubmit: help='Supply the list of dates/members/chunks to filter the list of jobs. Default = "Any". ' 'LIST = "[ 19601101 [ fc0 [1 2 3 4] fc1 [1] ] 19651101 [ fc0 [16-30] ] ]"') subparser.add_argument( - '-expand_status', type=str, help='Select the statuses to be expanded') + '-expand_status', type=str, help='Select the stat uses to be expanded') subparser.add_argument('--hide_groups', action='store_true', default=False, help='Hides the groups from the plot') subparser.add_argument('-cw', '--check_wrapper', action='store_true', @@ -844,7 +844,7 @@ class Autosubmit: os.mkdir(tmp_path) os.chmod(tmp_path, 0o775) os.mkdir(os.path.join(tmp_path, BasicConfig.LOCAL_ASLOG_DIR)) - os.chmod(os.path.join(tmp_path, BasicConfig.LOCAL_ASLOG_DIR), 0o755) + os.chmod(os.path.join(tmp_path, BasicConfig.LOCAL_ASLOG_DIR), 0o775) Log.debug("Creating temporal remote directory...") remote_tmp_path = os.path.join(tmp_path, "LOG_"+exp_id) os.mkdir(remote_tmp_path) @@ -1131,6 +1131,7 @@ class Autosubmit: :rtype: \n """ job_list._job_list = jobs_filtered + job_list.update_list(as_conf,False) # Current choice is Paramiko Submitter submitter = Autosubmit._get_submitter(as_conf) @@ -1155,10 +1156,10 @@ class Autosubmit: # Loading parameters again Autosubmit._load_parameters(as_conf, job_list, submitter.platforms) while job_list.get_active(): - # Sending only_wrappers = True - Autosubmit.submit_ready_jobs( - as_conf, job_list, platforms_to_test, packages_persistence, True, only_wrappers, hold=False) - job_list.update_list(as_conf, False, False) + Autosubmit.submit_ready_jobs(as_conf, job_list, platforms_to_test, packages_persistence, True, only_wrappers, hold=False) + job_list.update_list(as_conf, False) + + @staticmethod def run_experiment(expid, notransitive=False, update_version=False): @@ -1483,8 +1484,7 @@ class Autosubmit: Log.debug("\nJobs prepared for {1}: {0}", len( job_list.get_prepared(platform)), platform.name) - packages_to_submit = JobPackager( - as_conf, platform, job_list, hold=hold).build_packages() + packages_to_submit = JobPackager(as_conf, platform, job_list, hold=hold).build_packages() if not inspect: platform.open_submit_script() @@ -1493,9 +1493,19 @@ class Autosubmit: try: # If called from inspect command or -cw if only_wrappers or inspect: + if hasattr(package, "name"): + job_list.packages_dict[package.name] = package.jobs + from job.job import WrapperJob + wrapper_job = WrapperJob(package.name, package.jobs[0].id, Status.READY, 0, + package.jobs, + package._wallclock, package._num_processors, + package.platform, as_conf, hold) + job_list.job_package_map[package.jobs[0].id] = wrapper_job + packages_persistence.save(package.name, package.jobs, package._expid, inspect) for innerJob in package._jobs: # Setting status to COMPLETED so it does not get stuck in the loop that calls this function innerJob.status = Status.COMPLETED + # If called from RUN or inspect command if not only_wrappers: try: @@ -1513,11 +1523,10 @@ class Autosubmit: package.platform, as_conf, hold) job_list.job_package_map[package.jobs[0].id] = wrapper_job - if isinstance(package, JobPackageThread): - # If it is instance of JobPackageThread, then it is JobPackageVertical. - packages_persistence.save( - package.name, package.jobs, package._expid, inspect) - save = True + if isinstance(package, JobPackageThread): + # If it is instance of JobPackageThread, then it is JobPackageVertical. + packages_persistence.save( + package.name, package.jobs, package._expid, inspect) except WrongTemplateException as e: Log.error( "Invalid parameter substitution in {0} template", e.job_name) @@ -3106,8 +3115,7 @@ class Autosubmit: for job in jobs_wr: job.children = job.children - referenced_jobs_to_remove job.parents = job.parents - referenced_jobs_to_remove - Autosubmit.generate_scripts_andor_wrappers(as_conf, job_list_wrappers, jobs_wr, - packages_persistence, True) + Autosubmit.generate_scripts_andor_wrappers(as_conf, job_list_wrappers, jobs_wr,packages_persistence, True) packages = packages_persistence.load(True) else: @@ -3796,7 +3804,7 @@ class Autosubmit: packages_persistence = JobPackagePersistence(os.path.join(BasicConfig.LOCAL_ROOT_DIR, expid, "pkl"), "job_packages_" + expid) os.chmod(os.path.join(BasicConfig.LOCAL_ROOT_DIR, - expid, "pkl", "job_packages_" + expid+".db"), 0644) + expid, "pkl", "job_packages_" + expid+".db"), 0775) packages_persistence.reset_table(True) referenced_jobs_to_remove = set() job_list_wrappers = copy.deepcopy(job_list) diff --git a/autosubmit/job/job_list.py b/autosubmit/job/job_list.py index 7ae6c66309767bf874397ccb497c2d14783a8e47..962ac9daa3ba10bae4374211af5c010ed27d34d0 100644 --- a/autosubmit/job/job_list.py +++ b/autosubmit/job/job_list.py @@ -1236,13 +1236,12 @@ class JobList: if not notransitive: # Transitive reduction required current_structure = None - try: - current_structure = DbStructure.get_structure( - self.expid, self._config.STRUCTURES_DIR) - except Exception as exp: - pass - # print("Lengths : " + str(len(self._job_list)) + "\t" + - # str(len(current_structure.keys()))) + if os.path.exists(os.path.join(self._config.STRUCTURES_DIR,"structure_"+self.expid+".db")): + try: + current_structure = DbStructure.get_structure( + self.expid, self._config.STRUCTURES_DIR) + except Exception as exp: + pass structure_valid = False if ((current_structure) and (len(self._job_list) == len(current_structure.keys()))): structure_valid = True @@ -1274,7 +1273,7 @@ class JobList: job.children.remove(child) child.parents.remove(job) try: - DbStructure.save_structure( + DbStructure.save_strucexiture( self.graph, self.expid, self._config.STRUCTURES_DIR) except Exception as exp: pass diff --git a/autosubmit/platforms/locplatform.py b/autosubmit/platforms/locplatform.py index ff5c660f525eb86fa95f8977ba579f0a12b5f702..2f3d4f0ed5c5ed47b29df091defca0febe333e05 100644 --- a/autosubmit/platforms/locplatform.py +++ b/autosubmit/platforms/locplatform.py @@ -150,7 +150,7 @@ class LocalPlatform(ParamikoPlatform): sleeptime = 5 remote_path = os.path.join(self.get_files_path(), src) retries = 0 - max_retries = 2 + max_retries = 3 while not file_exist and retries < max_retries: try: file_exist = os.path.isfile(os.path.join(self.get_files_path(),src)) diff --git a/autosubmit/platforms/slurmplatform.py b/autosubmit/platforms/slurmplatform.py index 3c97b8c885d3bd53a6eb7548a63a94d7cded6a64..d382d80c7d2ee063104b4f35a54db4726bcd26dc 100644 --- a/autosubmit/platforms/slurmplatform.py +++ b/autosubmit/platforms/slurmplatform.py @@ -211,7 +211,7 @@ class SlurmPlatform(ParamikoPlatform): file_exist = False sleeptime = 5 retries = 0 - max_retries = 5 + max_retries = 3 while not file_exist and retries < max_retries: try: self._ftpChannel.stat(os.path.join(self.get_files_path(), filename)) # This return IOError if path doesn't exist