Mercurial > hg > Members > innparusu > Gears
comparison src/parallel_execution/context.c @ 138:337fdbffa693 default tip
Merge
author | Tatsuki IHA <e125716@ie.u-ryukyu.ac.jp> |
---|---|
date | Sat, 01 Oct 2016 00:23:35 +0900 |
parents | 36ac17d37be4 77e60b6cdace |
children |
comparison
equal
deleted
inserted
replaced
137:fe1fbfec7d01 | 138:337fdbffa693 |
---|---|
53 extern __code createData2_stub(struct Context*); | 53 extern __code createData2_stub(struct Context*); |
54 extern __code createTask1_stub(struct Context*); | 54 extern __code createTask1_stub(struct Context*); |
55 extern __code createTask2_stub(struct Context*); | 55 extern __code createTask2_stub(struct Context*); |
56 extern __code createTask3_stub(struct Context*); | 56 extern __code createTask3_stub(struct Context*); |
57 extern __code createTask4_stub(struct Context*); | 57 extern __code createTask4_stub(struct Context*); |
58 extern __code createTask5_stub(struct Context*); | |
59 extern __code createTask6_stub(struct Context*); | |
60 extern __code poll1_stub(struct Context*); | |
61 extern __code poll2_stub(struct Context*); | |
62 /* extern __code createTask3_stub(struct Context*); */ | |
63 /* extern __code createTask4_stub(struct Context*); */ | |
58 extern __code putQueue1_stub(struct Context*); | 64 extern __code putQueue1_stub(struct Context*); |
59 extern __code putQueue2_stub(struct Context*); | 65 extern __code putQueue2_stub(struct Context*); |
60 extern __code putQueue3_stub(struct Context*); | 66 extern __code putQueue3_stub(struct Context*); |
61 extern __code putQueue4_stub(struct Context*); | 67 extern __code putQueue4_stub(struct Context*); |
62 extern __code getQueue_stub(struct Context*); | 68 extern __code getTask_stub(struct Context*); |
69 extern __code getQueue1_stub(struct Context*); | |
70 extern __code getInputData1_stub(struct Context*); | |
71 extern __code getInputData2_stub(struct Context*); | |
72 extern __code getOutputData1_stub(struct Context*); | |
73 extern __code getOutputData2_stub(struct Context*); | |
74 extern __code waitFor_stub(struct Context*); | |
63 extern __code spawnTask_stub(struct Context*); | 75 extern __code spawnTask_stub(struct Context*); |
76 extern __code checkTaskFinish1_stub(struct Context*); | |
77 extern __code checkTaskFinish2_stub(struct Context*); | |
64 extern __code twice_stub(struct Context*); | 78 extern __code twice_stub(struct Context*); |
79 extern __code add_stub(struct Context*); | |
80 extern __code mult_stub(struct Context*); | |
65 extern __code start_time_stub(struct Context*); | 81 extern __code start_time_stub(struct Context*); |
66 extern __code end_time_stub(struct Context*); | 82 extern __code end_time_stub(struct Context*); |
67 extern __code exit_code(struct Context*); | 83 extern __code exit_code(struct Context*); |
68 | 84 |
69 __code initContext(struct Context* context) { | 85 __code initContext(struct Context* context) { |
70 context->heapLimit = sizeof(union Data)*ALLOCATE_SIZE; | 86 context->heapLimit = sizeof(union Data)*ALLOCATE_SIZE; |
71 context->code = (__code(**) (struct Context*)) NEWN(ALLOCATE_SIZE, void*); | 87 context->code = (__code(**) (struct Context*)) NEWN(ALLOCATE_SIZE, void*); |
72 context->data = NEWN(ALLOCATE_SIZE, union Data*); | 88 context->data = NEWN(ALLOCATE_SIZE, union Data*); |
89 context->mData = NEWN(ALLOCATE_SIZE, union MetaData*); | |
73 context->heapStart = NEWN(context->heapLimit, char); | 90 context->heapStart = NEWN(context->heapLimit, char); |
74 context->heap = context->heapStart; | 91 context->heap = context->heapStart; |
75 | 92 |
76 context->codeNum = Exit; | 93 context->codeNum = Exit; |
77 | 94 |
122 context->code[CreateData2] = createData2_stub; | 139 context->code[CreateData2] = createData2_stub; |
123 context->code[CreateTask1] = createTask1_stub; | 140 context->code[CreateTask1] = createTask1_stub; |
124 context->code[CreateTask2] = createTask2_stub; | 141 context->code[CreateTask2] = createTask2_stub; |
125 context->code[CreateTask3] = createTask3_stub; | 142 context->code[CreateTask3] = createTask3_stub; |
126 context->code[CreateTask4] = createTask4_stub; | 143 context->code[CreateTask4] = createTask4_stub; |
144 context->code[CreateTask5] = createTask5_stub; | |
145 context->code[CreateTask6] = createTask6_stub; | |
146 context->code[Poll1] = poll1_stub; | |
147 context->code[Poll2] = poll2_stub; | |
127 context->code[PutQueue1] = putQueue1_stub; | 148 context->code[PutQueue1] = putQueue1_stub; |
128 context->code[PutQueue2] = putQueue2_stub; | 149 context->code[PutQueue2] = putQueue2_stub; |
129 context->code[PutQueue3] = putQueue3_stub; | 150 context->code[PutQueue3] = putQueue3_stub; |
130 context->code[PutQueue4] = putQueue4_stub; | 151 context->code[PutQueue4] = putQueue4_stub; |
131 context->code[GetQueue] = getQueue_stub; | 152 context->code[GetTask] = getTask_stub; |
153 context->code[GetQueue1] = getQueue1_stub; | |
154 context->code[GetInputData1] = getInputData1_stub; | |
155 context->code[GetInputData2] = getInputData2_stub; | |
156 context->code[GetOutputData1] = getOutputData1_stub; | |
157 context->code[GetOutputData2] = getOutputData2_stub; | |
158 context->code[WaitFor] = waitFor_stub; | |
132 context->code[SpawnTask] = spawnTask_stub; | 159 context->code[SpawnTask] = spawnTask_stub; |
160 context->code[CheckTaskFinish1] = checkTaskFinish1_stub; | |
161 context->code[CheckTaskFinish2] = checkTaskFinish2_stub; | |
133 context->code[Twice] = twice_stub; | 162 context->code[Twice] = twice_stub; |
163 context->code[Add] = add_stub; | |
164 context->code[Mult] = mult_stub; | |
134 context->code[StartTime] = start_time_stub; | 165 context->code[StartTime] = start_time_stub; |
135 context->code[EndTime] = end_time_stub; | 166 context->code[EndTime] = end_time_stub; |
136 context->code[Exit] = exit_code; | 167 context->code[Exit] = exit_code; |
137 | 168 |
138 struct Worker* worker = ALLOC_DATA(context, Worker); | 169 struct Worker* worker = ALLOC_DATA(context, Worker); |
173 waitQueue->last = 0; | 204 waitQueue->last = 0; |
174 waitQueue->count = 0; | 205 waitQueue->count = 0; |
175 | 206 |
176 context->dataNum = Queue; | 207 context->dataNum = Queue; |
177 | 208 |
209 context->metaDataNum = 0; | |
178 context->node_stack = stack_init(sizeof(struct Node*), 100); | 210 context->node_stack = stack_init(sizeof(struct Node*), 100); |
179 context->code_stack = stack_init(sizeof(enum Code), 100); | 211 context->code_stack = stack_init(sizeof(enum Code), 100); |
180 } | 212 } |