diff --git a/reframe/core/pipeline.py b/reframe/core/pipeline.py index 9a8f94f608..8612e0e0a8 100644 --- a/reframe/core/pipeline.py +++ b/reframe/core/pipeline.py @@ -1779,6 +1779,11 @@ def compile(self): f'systems/0/partitions/@{self.current_partition.name}' f'/time_limit') ) + # Get job options from managed resources and prepend them to + # build_job_opts. We want any user supplied options to be able to + # override those set by the framework. + resources_opts = self._map_resources_to_jobopts() + self._build_job.options = resources_opts + self._build_job.options with osext.change_dir(self._stagedir): # Prepare build job build_commands = [ @@ -1921,11 +1926,7 @@ def _get_cp_env(): # Get job options from managed resources and prepend them to # job_opts. We want any user supplied options to be able to # override those set by the framework. - resources_opts = [] - for r, v in self.extra_resources.items(): - resources_opts.extend( - self._current_partition.get_resource(r, **v)) - + resources_opts = self._map_resources_to_jobopts() self._job.options = resources_opts + self._job.options with osext.change_dir(self._stagedir): try: @@ -1949,6 +1950,13 @@ def _get_cp_env(): if self.job.sched_flex_alloc_nodes: self.num_tasks = self.job.num_tasks + def _map_resources_to_jobopts(self): + resources_opts = [] + for r, v in self.extra_resources.items(): + resources_opts += self._current_partition.get_resource(r, **v) + + return resources_opts + @final def compile_complete(self): '''Check if the build phase has completed.