Skip to content

Commit

Permalink
Set i_batch for SubmitterLocal when submitting (#164)
Browse files Browse the repository at this point in the history
  • Loading branch information
dachengx authored Jun 7, 2024
1 parent 41119c7 commit cce3ea0
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 1 deletion.
3 changes: 2 additions & 1 deletion alea/submitter.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,7 @@ class Submitter:
config_file_path: str
template_path: str
combine_n_jobs: int = 1
first_i_batch: int = 0
allowed_special_args: List[str] = []
logging = logging.getLogger("submitter_logger")

Expand Down Expand Up @@ -336,7 +337,7 @@ def computation_tickets_generator(self):
_, _, annotations = Runner.runner_arguments()

for runner_args in self.merged_arguments_generator():
for i_batch in range(runner_args.get("n_batch", 1)):
for i_batch in range(self.first_i_batch, runner_args.get("n_batch", 1)):
i_args = deepcopy(runner_args)
i_args["i_batch"] = i_batch

Expand Down
1 change: 1 addition & 0 deletions alea/submitters/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,7 @@ def __init__(self, *args, **kwargs):
self.local_configurations = kwargs.get("local_configurations", {})
self.template_path = self.local_configurations.pop("template_path", None)
self.combine_n_jobs = self.local_configurations.pop("combine_n_jobs", 1)
self.first_i_batch = kwargs.pop("i_batch", 1)
super().__init__(*args, **kwargs)

@staticmethod
Expand Down

0 comments on commit cce3ea0

Please sign in to comment.