94 Build the task graph of the coupled system, and add it to time_step
96 The arguments are those of exahype2.api.Solver.generate_solver_realisation().
99 ccz4, scalar_field = self.
_host.solvers
100 for solver
in self.
_host.solvers:
101 if solver.numerical_scheme
is not self.
_schemes[solver]:
103 f
"Solver {solver.name} holds a numerical scheme of its own, "
104 f
"but the numerical scheme of the coupled solver {self._host.name} rules"
108 for solver
in self.
_host.solvers:
110 solver.generate_solver_realisation(
117 add_global_tasks=
False,
120 coupled_time_step.merge(graphs[ccz4])
121 coupled_time_step.merge(graphs[scalar_field])
124 previous_end = {ccz4: [], scalar_field: []}
127 solver: self.
_first_tasks(graphs[solver], previous_end[solver])
128 for solver
in self.
_host.solvers
132 for solver
in self.
_host.solvers
134 copy = create_copy_task(
138 self.
_host.ccz4_auxiliary_copies,
140 for task
in previous_end[ccz4] + previous_end[scalar_field]:
141 copy.add_dependency(task)
142 for task
in first[ccz4] + first[scalar_field]:
143 task.add_dependency(copy)
145 for task
in first[scalar_field]:
146 for dependency
in end[ccz4]:
147 task.add_dependency(dependency)
148 coupled_time_step.add_task(copy)
153 entity=peano4.api.taskgraph.Task.GridEntity.GLOBAL_END_OF_STEP,
155 for task
in coupled_time_step.sink_tasks():
156 synchronise.add_dependency(task)
157 synchronise.add_action_set(SynchroniseTimeStepSizes([ccz4, scalar_field]))
158 coupled_time_step.add_task(synchronise)
160 ccz4.numerical_scheme.wrap_task_graph_in_load_balancing_and_amr_tasks(
163 if ccz4.mesh_adaptation
is not None:
164 ccz4.mesh_adaptation.construct_output(
165 exahype2_project, peano_project, mesh_adaptation
168 title = f
"Time stepping task graph for host {self._host.name}"
170 coupled_time_step.visualise(title=title)
172 coupled_time_step.log_as_text(title=title)
173 time_step.merge(coupled_time_step)