Mercurial > hg > Game > Cerium
annotate TaskManager/kernel/ppe/TaskList.cc @ 2054:2e7a6f40672f draft
add param(4) in FileMapReduce.cc
author | masa |
---|---|
date | Fri, 29 Jan 2016 15:56:28 +0900 |
parents | be15a4d33605 |
children |
rev | line source |
---|---|
1756 | 1 #include "TaskList.h" |
2 #include "HTask.h" | |
3 #include "Scheduler.h" | |
4 | |
5 class HTask; | |
6 | |
1763 | 7 int TaskList::ismultidim(int cpu_num) { |
1756 | 8 TaskList* p = this; |
9 int dim_count = 0; | |
10 int dim_count_max = 0; | |
11 while(p) { | |
12 if (p->dim>0) { | |
13 dim_count = (p->x)*(p->y)*(p->z); | |
14 if (dim_count_max < dim_count) dim_count_max = dim_count; | |
1763 | 15 if (dim_count > cpu_num) dim_count = cpu_num; |
1756 | 16 p->self->flag.dim_count = dim_count; |
1762
b53d197ec03d
copy task list for multi dimention
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1757
diff
changeset
|
17 } else |
b53d197ec03d
copy task list for multi dimention
Shinji KONO <kono@ie.u-ryukyu.ac.jp>
parents:
1757
diff
changeset
|
18 p->self->flag.dim_count = 1; |
1756 | 19 p = p->next; |
20 } | |
21 return dim_count_max; | |
22 } | |
23 | |
24 void TaskList::print() { | |
25 printf("dim %d,x %d,y %d,z %d,cpu %d\n",dim,(int)x,(int)y,(int)z,cpu); | |
26 Task* t = &tasks[0]; | |
1763 | 27 Task* p = t; |
28 int i = 0; | |
1757 | 29 while(t<last()) { |
1756 | 30 printf("command %s\n",task_list[t->command].name); |
31 t = t->next(); | |
1763 | 32 if (i++ & 1) p = p->next(); |
33 if (t==p) { | |
34 printf(" ... looped\n"); break; | |
35 } | |
1756 | 36 } |
37 } |