diff --git a/libmuscle/python/libmuscle/manager/instance_manager.py b/libmuscle/python/libmuscle/manager/instance_manager.py index 37627891..cde2192d 100644 --- a/libmuscle/python/libmuscle/manager/instance_manager.py +++ b/libmuscle/python/libmuscle/manager/instance_manager.py @@ -139,9 +139,11 @@ def start_all(self) -> None: stdout_path = idir / 'stdout.txt' stderr_path = idir / 'stderr.txt' + res_req = self._configuration.get_resources(model.name + component.name) + request = InstantiationRequest( instance, program, - self._configuration.resources[model.name + component.name], + res_req, resources, idir, workdir, stdout_path, stderr_path) _logger.info(f'Instantiating {instance}') self._requests_out.put(request) diff --git a/libmuscle/python/libmuscle/planner/planner.py b/libmuscle/python/libmuscle/planner/planner.py index d6a758ad..2fe735b1 100644 --- a/libmuscle/python/libmuscle/planner/planner.py +++ b/libmuscle/python/libmuscle/planner/planner.py @@ -3,8 +3,8 @@ from typing import Dict, Iterable, List, Mapping, Set, Tuple from ymmsl.v0_2 import ( - Component, Configuration, Model, MPICoresResReq, MPINodesResReq, - Operator, Reference, ResourceRequirements, ThreadedResReq) + Component, Configuration, Model, MPICoresResReq, + MPINodesResReq, Operator, Reference, ResourceRequirements, ThreadedResReq) from libmuscle.planner.resources import OnNodeResources, Resources from libmuscle.util import instance_indices @@ -517,13 +517,18 @@ def allocate_all( # Analyse model root_model = configuration.root_model() model = ModelGraph(root_model) - requirements = configuration.resources programs = configuration.programs exclusive = { i for c in model.components() for i in c.instances() if (c.implementation and not programs[c.implementation].can_share_resources)} + requirements: dict[Reference, ResourceRequirements] = { + root_model.name + component.name: + configuration.get_resources(root_model.name + component.name) + for component in model.components() + } + # Allocate unallocated_instances = [ i for c in model.components() for i in c.instances()]