Mercurial > hg > Game > Cerium
view 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 |
line wrap: on
line source
#include "TaskList.h" #include "HTask.h" #include "Scheduler.h" class HTask; int TaskList::ismultidim(int cpu_num) { TaskList* p = this; int dim_count = 0; int dim_count_max = 0; while(p) { if (p->dim>0) { dim_count = (p->x)*(p->y)*(p->z); if (dim_count_max < dim_count) dim_count_max = dim_count; if (dim_count > cpu_num) dim_count = cpu_num; p->self->flag.dim_count = dim_count; } else p->self->flag.dim_count = 1; p = p->next; } return dim_count_max; } void TaskList::print() { printf("dim %d,x %d,y %d,z %d,cpu %d\n",dim,(int)x,(int)y,(int)z,cpu); Task* t = &tasks[0]; Task* p = t; int i = 0; while(t<last()) { printf("command %s\n",task_list[t->command].name); t = t->next(); if (i++ & 1) p = p->next(); if (t==p) { printf(" ... looped\n"); break; } } }