diff --git a/autosubmit/autosubmit.py b/autosubmit/autosubmit.py index 8f22a65c486b5c213e87a989120ce20ed54f4f43..b5b112240ad82c80dc920a12581b0a509dcb7734 100644 --- a/autosubmit/autosubmit.py +++ b/autosubmit/autosubmit.py @@ -3188,6 +3188,8 @@ class Autosubmit: num_chunks = as_conf.get_num_chunks() chunk_ini = as_conf.get_chunk_ini() member_list = as_conf.get_member_list() + run_only_members = as_conf.get_member_list(run_only=True) + # print("Run only members {0}".format(run_only_members)) if len(member_list) != len(set(member_list)): raise AutosubmitCritical( "There are repeated member names!") @@ -3208,7 +3210,7 @@ class Autosubmit: job_list.generate(date_list, member_list, num_chunks, chunk_ini, parameters, date_format, as_conf.get_retrials(), as_conf.get_default_job_type(), - as_conf.get_wrapper_type(), as_conf.get_wrapper_jobs(), notransitive=notransitive, update_structure=True) + as_conf.get_wrapper_type(), as_conf.get_wrapper_jobs(), notransitive=notransitive, update_structure=True, run_only_members=run_only_members) if rerun == "true": chunk_list = Autosubmit._create_json( @@ -4359,7 +4361,7 @@ class Autosubmit: job_list = JobList(expid, BasicConfig, ConfigParserFactory(), Autosubmit._get_job_list_persistence(expid, as_conf)) - + run_only_members = as_conf.get_member_list(run_only=True) date_list = as_conf.get_date_list() date_format = '' if as_conf.get_chunk_size_unit() is 'hour': @@ -4372,7 +4374,7 @@ class Autosubmit: job_list.generate(date_list, as_conf.get_member_list(), as_conf.get_num_chunks(), as_conf.get_chunk_ini(), as_conf.load_parameters(), date_format, as_conf.get_retrials(), as_conf.get_default_job_type(), as_conf.get_wrapper_type(), as_conf.get_wrapper_jobs(), - new=False, notransitive=notransitive) + new=False, notransitive=notransitive, run_only_members=run_only_members) if rerun == "true": chunk_list = Autosubmit._create_json(as_conf.get_chunk_list()) diff --git a/autosubmit/config/config_common.py b/autosubmit/config/config_common.py index d3bd390909a3b208b906263b8d66e46fb6c5ff18..3149a5e0969af7a383d431ae03c683ca6928ad69 100644 --- a/autosubmit/config/config_common.py +++ b/autosubmit/config/config_common.py @@ -1067,7 +1067,7 @@ class AutosubmitConfig(object): return default return int(chunk_size) - def get_member_list(self): + def get_member_list(self, run_only=False): """ Returns members list from experiment's config file @@ -1075,7 +1075,8 @@ class AutosubmitConfig(object): :rtype: list """ member_list = list() - string = self._exp_parser.get('experiment', 'MEMBERS') + string = self._exp_parser.get('experiment', 'MEMBERS') if run_only == False else self._exp_parser.get_option( + 'experiment', 'RUN_ONLY_MEMBERS', '') if not string.startswith("["): string = '[{0}]'.format(string) split_string = nestedExpr('[', ']').parseString(string).asList() diff --git a/autosubmit/config/files/expdef.conf b/autosubmit/config/files/expdef.conf index a5512812ce43e0e92afd5c6d14cce4534d0c2b8d..986910deff8898e7a0b54a7c0abca7ccfb1f3d71 100644 --- a/autosubmit/config/files/expdef.conf +++ b/autosubmit/config/files/expdef.conf @@ -30,6 +30,8 @@ NUMCHUNKS = CHUNKINI = # Calendar used. LIST: standard, noleap CALENDAR = standard +# List of members that can be included in this run. Optional. +RUN_ONLY_MEMBERS = [project] # Select project type. STRING = git, svn, local, none diff --git a/autosubmit/database/db_jobdata.py b/autosubmit/database/db_jobdata.py index 63c4cf289d5ae19c423f2c87cb66fd2fdce14eb3..da40e5be7425358c9240f7e4d0bea8482f1a7689 100644 --- a/autosubmit/database/db_jobdata.py +++ b/autosubmit/database/db_jobdata.py @@ -795,7 +795,7 @@ class JobDataStructure(MainDataBase): if len(tracking_dictionary.keys()) >= int(current_date_member_completed_count * 0.9): # If setstatus changes more than 90% of date-member completed jobs, it's a new run # Must create a new experiment run - Log.result( + Log.debug( "Since a significant amount of jobs have changed status. Autosubmit will consider a new run of the same experiment.") self.validate_current_run( job_list, chunk_unit, chunk_size, True) diff --git a/autosubmit/job/job_list.py b/autosubmit/job/job_list.py index 4e030b88b2b5c95e1d7927efc03af452468656d2..30ecb2db087271f4a52925af1ced2eda6445d2f2 100644 --- a/autosubmit/job/job_list.py +++ b/autosubmit/job/job_list.py @@ -121,7 +121,7 @@ class JobList(object): # print(job.parents) def generate(self, date_list, member_list, num_chunks, chunk_ini, parameters, date_format, default_retrials, - default_job_type, wrapper_type=None, wrapper_jobs=None, new=True, notransitive=False, update_structure=False): + default_job_type, wrapper_type=None, wrapper_jobs=None, new=True, notransitive=False, update_structure=False, run_only_members=[]): """ Creates all jobs needed for the current workflow @@ -183,6 +183,20 @@ class JobList(object): for job in self._job_list: job.parameters = parameters + # Checking for member constraints + if len(run_only_members) > 0: + # Found + Log.info("Considering only members {0}".format( + str(run_only_members))) + old_job_list = [job for job in self._job_list] + self._job_list = [ + job for job in old_job_list if job.member is None or job.member in run_only_members or job.status not in [Status.WAITING, Status.READY]] + for job in self._job_list: + job.parents = [ + jobp for jobp in job.parents if jobp in self._job_list] + job.children = [ + jobc for jobc in job._children if jobc in self._job_list] + # Perhaps this should be done by default independent of the wrapper_type supplied if wrapper_type == 'vertical-mixed': self._ordered_jobs_by_date_member = self._create_sorted_dict_jobs(