5 #include <athena/mesh/mesh.hpp>
6 #include <athena/parameter_input.hpp>
19 if (deps.empty())
return true;
23 for (
auto& dep_task : deps) {
24 auto it =
tasks_.find(dep_task);
28 if (it->second.done)
continue;
30 tasks_[dep_task] = {
false, {}};
37 if (!
tasks_[dep_task].done)
return false;
44 for (
auto& task : tasks) {
45 auto it =
tasks_.find(task);
49 tasks_[task] = {
false, {}};
56 scheduler = std::make_shared<Scheduler>(pmb);
static SchedulerPtr Create(MeshBlock *pmb, ParameterInput *pin)
IntegrationStage current_stage_
Scheduler(MeshBlock *pmb)
constructor and destructor
bool DoTask(TaskFunc func)
functions
std::unordered_map< TaskFunc, TaskInfo > tasks_
bool CheckDone(std::vector< TaskFunc > const &deps)
void AddTasks(std::vector< TaskFunc > const &tasks)
bool(*)(MeshBlock *, IntegrationStage) TaskFunc
std::shared_ptr< Scheduler > SchedulerPtr