12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364 |
- /* StarPU --- Runtime system for heterogeneous multicore architectures.
- *
- * Copyright (C) 2013-2021 Université de Bordeaux, CNRS (LaBRI UMR 5800), Inria
- * Copyright (C) 2013 Simon Archipoff
- *
- * StarPU is free software; you can redistribute it and/or modify
- * it under the terms of the GNU Lesser General Public License as published by
- * the Free Software Foundation; either version 2.1 of the License, or (at
- * your option) any later version.
- *
- * StarPU is distributed in the hope that it will be useful, but
- * WITHOUT ANY WARRANTY; without even the implied warranty of
- * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
- *
- * See the GNU Lesser General Public License in COPYING.LGPL for more details.
- */
- #include <starpu_sched_component.h>
- #include <starpu_scheduler.h>
- #include <float.h>
- #include <limits.h>
- static void initialize_heteroprio_heft_center_policy(unsigned sched_ctx_id)
- {
- struct starpu_sched_component_heteroprio_data heteroprio_data =
- {
- .mct = NULL,
- .batch = 1,
- };
- starpu_sched_component_initialize_simple_schedulers(sched_ctx_id, 2,
- (starpu_sched_component_create_t) starpu_sched_component_heteroprio_create, &heteroprio_data,
- STARPU_SCHED_SIMPLE_DECIDE_WORKERS |
- STARPU_SCHED_SIMPLE_FIFOS_BELOW |
- STARPU_SCHED_SIMPLE_FIFOS_BELOW_READY |
- STARPU_SCHED_SIMPLE_FIFOS_BELOW_EXP |
- STARPU_SCHED_SIMPLE_IMPL,
- (starpu_sched_component_create_t) starpu_sched_component_heft_create, NULL,
- STARPU_SCHED_SIMPLE_DECIDE_WORKERS |
- STARPU_SCHED_SIMPLE_FIFO_ABOVE |
- STARPU_SCHED_SIMPLE_FIFO_ABOVE_PRIO |
- STARPU_SCHED_SIMPLE_FIFOS_BELOW |
- STARPU_SCHED_SIMPLE_FIFOS_BELOW_PRIO |
- STARPU_SCHED_SIMPLE_FIFOS_BELOW_READY |
- STARPU_SCHED_SIMPLE_FIFOS_BELOW_EXP |
- STARPU_SCHED_SIMPLE_IMPL);
- }
- struct starpu_sched_policy _starpu_sched_modular_heteroprio_heft_policy =
- {
- .init_sched = initialize_heteroprio_heft_center_policy,
- .deinit_sched = starpu_sched_tree_deinitialize,
- .add_workers = starpu_sched_tree_add_workers,
- .remove_workers = starpu_sched_tree_remove_workers,
- .push_task = starpu_sched_tree_push_task,
- .pop_task = starpu_sched_tree_pop_task,
- .pre_exec_hook = starpu_sched_component_worker_pre_exec_hook,
- .post_exec_hook = starpu_sched_component_worker_post_exec_hook,
- .pop_every_task = NULL,
- .policy_name = "modular-heteroprio-heft",
- .policy_description = "heteroprio+heft modular policy",
- .worker_type = STARPU_WORKER_LIST,
- .prefetches = 1,
- };
|