My Project
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Macros
scheduling.h
Go to the documentation of this file.
1 /*
2 START OF LICENSE STUB
3  DeDOS: Declarative Dispersion-Oriented Software
4  Copyright (C) 2017 University of Pennsylvania, Georgetown University
5 
6  This program is free software: you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation, either version 3 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program. If not, see <http://www.gnu.org/licenses/>.
18 END OF LICENSE STUB
19 */
20 #ifndef SCHEDULING_H_
21 #define SCHEDULING_H_
22 
23 #include "dfg.h"
24 #include "scheduling_cut.h"
25 
26 struct to_schedule {
27  int *msu_ids;
28  int num_msu;
29 };
30 
31 void prepare_clone(struct dfg_msu *msu);
32 struct dfg_msu *clone_msu(int msu_id);
33 int unclone_msu(int msu_id);
35 int schedule_msu(struct dfg_msu *msu, struct dfg_runtime *rt, struct dfg_msu **new_msus);
36 int place_on_runtime(struct dfg_runtime *rt, struct dfg_msu *msu);
37 
38 /* Related to previous allocation draft */
39 int (*policy)(struct to_schedule *ts, struct dedos_dfg *dfg);
40 int allocate(struct to_schedule *ts);
41 int init_scheduler(const char *policy);
42 struct dfg_thread *find_thread(struct dfg_msu *msu, struct dfg_runtime *runtime);
43 uint64_t compute_out_of_cut_bw(struct dfg_msu *msu, struct cut *c, const char *direction);
44 int greedy_policy(struct to_schedule *ts, struct dedos_dfg *dfg);
45 
46 int set_edges(struct to_schedule *ts, struct dedos_dfg *dfg);
47 int set_msu_deadlines(struct to_schedule *ts, struct dedos_dfg *dfg);
48 
49 #endif /* !SCHEDULING_H_ */
int * msu_ids
Definition: scheduling.h:27
void prepare_clone(struct dfg_msu *msu)
Find an ID and clean up data structures for an MSU.
Definition: scheduling.c:260
uint64_t compute_out_of_cut_bw(struct dfg_msu *msu, struct cut *c, const char *direction)
int set_msu_deadlines(struct to_schedule *ts, struct dedos_dfg *dfg)
int greedy_policy(struct to_schedule *ts, struct dedos_dfg *dfg)
Representation of a runtime in the DFG.
Definition: dfg.h:73
int allocate(struct to_schedule *ts)
struct dfg_msu * clone_msu(int msu_id)
Clone a msu of given ID.
Definition: scheduling.c:619
int(* policy)(struct to_schedule *ts, struct dedos_dfg *dfg)
Definition: scheduling.h:39
int unclone_msu(int msu_id)
Definition: scheduling.c:566
Representation of a single MSU in the dfg.
Definition: dfg.h:216
int schedule_msu(struct dfg_msu *msu, struct dfg_runtime *rt, struct dfg_msu **new_msus)
Tries to place an MSU on a given runtime.
Definition: scheduling.c:710
Top-level structure holding the data-flow graph.
Definition: dfg.h:239
static struct dedos_dfg * dfg
Static local copy of the DFG, so each call doesn't have to pass a copy.
Definition: dfg.c:32
int init_scheduler(const char *policy)
Interfaces for the creation and modification of the data-flow-graph and and general description of th...
int set_edges(struct to_schedule *ts, struct dedos_dfg *dfg)
int fix_all_route_ranges(struct dedos_dfg *dfg)
Definition: scheduling.c:179
Representation of a thread on a runtime in the DFG.
Definition: dfg.h:104
struct dfg_thread * find_thread(struct dfg_msu *msu, struct dfg_runtime *runtime)
int place_on_runtime(struct dfg_runtime *rt, struct dfg_msu *msu)
Find a core on which to spawn a new thread for an MSU.
Definition: scheduling.c:317