ryujin 2.5.0 revision c64172211cf21344cb9b9b0f3a1266aa6400d392
Loading...
Searching...
No Matches
scheduler.h
Go to the documentation of this file.
1//
2// SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
3// Copyright (C) 2020 - 2026 by the ryujin authors
4//
5
6#pragma once
7
8#include <ryujin/base/compile_time_options.h>
10
11#include <deal.II/base/mpi_stub.h>
12#include <deal.II/base/parameter_acceptor.h>
13
14#include <functional>
15#include <string>
16#include <vector>
17
18namespace ryujin
19{
41 template <typename Number = double>
42 class Scheduler final : public dealii::ParameterAcceptor
43 {
44 public:
46
53 Scheduler(const MPI_Comm &mpi_comm,
54 const std::vector<Task *> &required,
55 const std::vector<Task *> &tasks = {},
56 const std::function<void(const std::string &)> &info = {});
57
61 void run();
62
63 private:
68
69 std::string base_name_;
70
71 Number t_final_;
72 bool align_time_steps_;
73 Number timer_granularity_;
74
75 std::vector<std::string> task_names_;
76
78
82
83 const MPI_Comm mpi_comm_;
84
85 const std::vector<Task *> required_;
86 const std::vector<Task *> selectable_;
87
88 std::function<void(const std::string &)> info_;
89
93 std::vector<Task *> tasks_;
94
96
100
104 void run_phase(TaskPhase phase, TaskContext<Number> &context);
105
107 };
108
109} // namespace ryujin
Scheduler(const MPI_Comm &mpi_comm, const std::vector< Task * > &required, const std::vector< Task * > &tasks={}, const std::function< void(const std::string &)> &info={})
TaskPhase
Definition task.h:33