diff --git a/hysop/core/graph/computational_node_frontend.py b/hysop/core/graph/computational_node_frontend.py index 55bc7d4f020e3713ce393d75936c623c9c97a6f8..930f091468d42ad44ccfac67b440b94c138b94fd 100644 --- a/hysop/core/graph/computational_node_frontend.py +++ b/hysop/core/graph/computational_node_frontend.py @@ -102,7 +102,8 @@ class ComputationalGraphNodeFrontend(ComputationalGraphNodeGenerator): # Skip not on-task operators very early if 'mpi_params' in self.impl_kwds.keys(): if not self.impl_kwds['mpi_params'].on_task: - return (HiddenOperator(mpi_params=self.impl_kwds['mpi_params']), ) + return (HiddenOperator(domain=first_not_None(field.domain for field in self.impl_kwds['variables'].keys()), + mpi_params=self.impl_kwds['mpi_params']), ) op = self.impl(**self.impl_kwds) except: sargs = ['*{} = {}'.format(k, v.__class__) diff --git a/hysop/core/graph/graph_builder.py b/hysop/core/graph/graph_builder.py index baa9113d2f64e78fea838ae2e451bbea90fad015..8833f452fdb39e04a47a142eaccb5a2cb493bfd4 100644 --- a/hysop/core/graph/graph_builder.py +++ b/hysop/core/graph/graph_builder.py @@ -336,6 +336,7 @@ class GraphBuilder(object): # add operator node and fill vertex properties opnode = self.new_node(op, subgraph, current_level, node, node_id, opvertex) if isinstance(node, RedistributeInter): + assert self.search_intertasks_ops # Save graph building state for filling next nodes topologies after graph completion redistribute_inter.append((node_id, node, subgraph, node_ops, node_vertices, from_subgraph, opvertex, op, opnode)) gprint(" *Will be handled later") @@ -703,7 +704,7 @@ class GraphBuilder(object): is_graph_updated = _closure(f, t, double_check_inputs[f][t], self.topology_states[f]) # Final intertask redistributes as closure - if (current_level == 0) and outputs_are_inputs: + if self.search_intertasks_ops and (current_level == 0) and outputs_are_inputs: available_elems, needed_elems = {}, {} needed_elems.update(self.input_fields) available_elems.update(self.output_fields) diff --git a/hysop/core/graph/node_generator.py b/hysop/core/graph/node_generator.py index d195f929588af977607a0ad7b127b7d6a99df16c..9c342ce11ac223367c3cf6c2825784292c4383ee 100644 --- a/hysop/core/graph/node_generator.py +++ b/hysop/core/graph/node_generator.py @@ -10,8 +10,9 @@ class HiddenOperator(object): This object should pass the intialization through graph building where it is definitely removed. This object is an helper to build a graph with appropriates Inter-Task redistributes.""" - def __init__(self, mpi_params): + def __init__(self, mpi_params, domain): self.mpi_params = mpi_params + self.domain = domain self.name = '' def available_methods(self, *args, **kwargs): diff --git a/hysop/problem.py b/hysop/problem.py index 859c6ce13409b9c81b3e010169c802ed9f5d59a8..358ef95c46ad75eec16609f81272c4c070314cbb 100644 --- a/hysop/problem.py +++ b/hysop/problem.py @@ -53,8 +53,10 @@ class Problem(ComputationalGraph): for node in [_ for _ in self.nodes if isinstance(_, Problem)]: node.initialize(outputs_are_inputs=True, topgraph_method=None, is_root=True) node.discretize() + search_intertasks_ops = all([node.domain.has_tasks for node in self.nodes]) self.initialize(outputs_are_inputs=outputs_are_inputs, - topgraph_method=None, is_root=True, search_intertasks_ops=True) + topgraph_method=None, is_root=True, + search_intertasks_ops=search_intertasks_ops) if (args is not None) and args.stop_at_discretization: return 'discretization'