123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481 |
- #ifndef __STARPU_SCHEDULER_H__
- #define __STARPU_SCHEDULER_H__
- #include <starpu.h>
- #ifdef __cplusplus
- extern "C"
- {
- #endif
- struct starpu_task;
- struct starpu_sched_policy
- {
-
- void (*init_sched)(unsigned sched_ctx_id);
-
- void (*deinit_sched)(unsigned sched_ctx_id);
-
- int (*push_task)(struct starpu_task *);
- double (*simulate_push_task)(struct starpu_task *);
-
- void (*push_task_notify)(struct starpu_task *, int workerid, int perf_workerid, unsigned sched_ctx_id);
-
- struct starpu_task *(*pop_task)(unsigned sched_ctx_id);
-
- struct starpu_task *(*pop_every_task)(unsigned sched_ctx_id);
-
- void (*submit_hook)(struct starpu_task *task);
-
- void (*pre_exec_hook)(struct starpu_task *, unsigned sched_ctx_id);
-
- void (*post_exec_hook)(struct starpu_task *, unsigned sched_ctx_id);
-
- void (*do_schedule)(unsigned sched_ctx_id);
-
- void (*add_workers)(unsigned sched_ctx_id, int *workerids, unsigned nworkers);
-
- void (*remove_workers)(unsigned sched_ctx_id, int *workerids, unsigned nworkers);
-
- int prefetches;
-
- const char *policy_name;
-
- const char *policy_description;
- enum starpu_worker_collection_type worker_type;
- };
- struct starpu_sched_policy **starpu_sched_get_predefined_policies(void);
- void starpu_worker_get_sched_condition(int workerid, starpu_pthread_mutex_t **sched_mutex, starpu_pthread_cond_t **sched_cond);
- unsigned long starpu_task_get_job_id(struct starpu_task *task);
- int starpu_sched_get_min_priority(void);
- int starpu_sched_get_max_priority(void);
- int starpu_sched_set_min_priority(int min_prio);
- int starpu_sched_set_max_priority(int max_prio);
- int starpu_worker_can_execute_task(unsigned workerid, struct starpu_task *task, unsigned nimpl);
- int starpu_worker_can_execute_task_impl(unsigned workerid, struct starpu_task *task, unsigned *impl_mask);
- int starpu_worker_can_execute_task_first_impl(unsigned workerid, struct starpu_task *task, unsigned *nimpl);
- int starpu_push_local_task(int workerid, struct starpu_task *task, int back);
- int starpu_push_task_end(struct starpu_task *task);
- int starpu_get_prefetch_flag(void);
- int starpu_prefetch_task_input_on_node_prio(struct starpu_task *task, unsigned node, int prio);
- int starpu_prefetch_task_input_on_node(struct starpu_task *task, unsigned node);
- int starpu_idle_prefetch_task_input_on_node_prio(struct starpu_task *task, unsigned node, int prio);
- int starpu_idle_prefetch_task_input_on_node(struct starpu_task *task, unsigned node);
- int starpu_prefetch_task_input_for_prio(struct starpu_task *task, unsigned worker, int prio);
- int starpu_prefetch_task_input_for(struct starpu_task *task, unsigned worker);
- int starpu_idle_prefetch_task_input_for_prio(struct starpu_task *task, unsigned worker, int prio);
- int starpu_idle_prefetch_task_input_for(struct starpu_task *task, unsigned worker);
- uint32_t starpu_task_footprint(struct starpu_perfmodel *model, struct starpu_task *task, struct starpu_perfmodel_arch *arch, unsigned nimpl);
- uint32_t starpu_task_data_footprint(struct starpu_task *task);
- double starpu_task_expected_length(struct starpu_task *task, struct starpu_perfmodel_arch *arch, unsigned nimpl);
- double starpu_task_worker_expected_length(struct starpu_task *task, unsigned workerid, unsigned sched_ctx_id, unsigned nimpl);
- double starpu_worker_get_relative_speedup(struct starpu_perfmodel_arch *perf_arch);
- double starpu_task_expected_data_transfer_time(unsigned memory_node, struct starpu_task *task);
- double starpu_task_expected_data_transfer_time_for(struct starpu_task *task, unsigned worker);
- double starpu_data_expected_transfer_time(starpu_data_handle_t handle, unsigned memory_node, enum starpu_data_access_mode mode);
- double starpu_task_expected_energy(struct starpu_task *task, struct starpu_perfmodel_arch *arch, unsigned nimpl);
- double starpu_task_worker_expected_energy(struct starpu_task *task, unsigned workerid, unsigned sched_ctx_id, unsigned nimpl);
- double starpu_task_expected_conversion_time(struct starpu_task *task, struct starpu_perfmodel_arch *arch, unsigned nimpl);
- typedef void (*starpu_notify_ready_soon_func)(void *data, struct starpu_task *task, double delay);
- void starpu_task_notify_ready_soon_register(starpu_notify_ready_soon_func f, void *data);
- void starpu_sched_ctx_worker_shares_tasks_lists(int workerid, int sched_ctx_id);
- void starpu_sched_task_break(struct starpu_task *task);
- int starpu_wake_worker_relax(int workerid);
- int starpu_wake_worker_no_relax(int workerid);
- int starpu_wake_worker_locked(int workerid);
- int starpu_wake_worker_relax_light(int workerid);
- #ifdef __cplusplus
- }
- #endif
- #endif
|