changeset 1666:b49aaf88eae6 draft

fix dim_count init
author Masa
date Wed, 17 Jul 2013 18:10:48 +0900
parents ce031df3dd32
children 805f60a3e9f9
files TaskManager/kernel/ppe/HTask.cc TaskManager/kernel/ppe/QueueInfo.h TaskManager/kernel/ppe/TaskManagerImpl.cc
diffstat 3 files changed, 18 insertions(+), 18 deletions(-) [+]
line wrap: on
line diff
--- a/TaskManager/kernel/ppe/HTask.cc	Tue Jul 16 16:59:52 2013 +0900
+++ b/TaskManager/kernel/ppe/HTask.cc	Wed Jul 17 18:10:48 2013 +0900
@@ -20,7 +20,7 @@
 {
     if (export_task_log)
         tasklog->create_time = rdtsc();
-    this->flag.dim_count = 0;    
+    this->flag.dim_count = 1;    
     TaskList *tl = (TaskList*)rbuf;
     tl->self = this;
     tl->set_last(last);
@@ -29,7 +29,7 @@
 
 void
 HTask::iterate(long x) {
-    this->flag.dim_count = 0;
+    this->flag.dim_count = 1;
     TaskList *tl = (TaskList*)rbuf;
     tl->self = this;
     tl->set_last(last);
@@ -42,7 +42,7 @@
 
 void
 HTask::iterate(long x, long y) {
-    this->flag.dim_count = 0;
+    this->flag.dim_count = 1;
     TaskList *tl = (TaskList*)rbuf;
     tl->self = this;
     tl->set_last(last);
@@ -56,7 +56,7 @@
 
 void
 HTask::iterate(long x, long y, long z) {
-    this->flag.dim_count = 0;
+    this->flag.dim_count = 1;
     TaskList *tl = (TaskList*)rbuf;
     tl->self = this;
     tl->set_last(last);
@@ -132,7 +132,7 @@
     r_size = 0;
     TaskListPtr tl =  mimpl->createTaskList();
     tl->self = 0;
-    this->flag.dim_count = 0;
+    this->flag.dim_count = 1;
     rbuf = (memaddr)tl;
     bzero(tl->tasks,sizeof(Task)*TASK_MAX_SIZE);
     Task *task = tl->tasks;
--- a/TaskManager/kernel/ppe/QueueInfo.h	Tue Jul 16 16:59:52 2013 +0900
+++ b/TaskManager/kernel/ppe/QueueInfo.h	Wed Jul 17 18:10:48 2013 +0900
@@ -315,7 +315,7 @@
     int i = 0;
     if (empty()) return 0;
     T* e = first;
-    while((e = e->next) != this ) i++;
+    while((e = e->next) != this && e) i++;
     return i;
 }
 
--- a/TaskManager/kernel/ppe/TaskManagerImpl.cc	Tue Jul 16 16:59:52 2013 +0900
+++ b/TaskManager/kernel/ppe/TaskManagerImpl.cc	Wed Jul 17 18:10:48 2013 +0900
@@ -307,19 +307,19 @@
         me->tasklog->finish_time = rdtsc();
 
     while(TaskQueue *p = me->wait_me->poll()) {
-    HTaskPtr you = p->task;
-    QueueInfo<TaskQueue> *wait_i = you->wait_i;
-    // 相手の wait queue から自分(を指しているTaskQueue)を削除
-    wait_i->remove(p->waiter);
-    // queue を free する
-    wait_i->free_(p->waiter);
+	HTaskPtr you = p->task;
+	QueueInfo<TaskQueue> *wait_i = you->wait_i;
+	// 相手の wait queue から自分(を指しているTaskQueue)を削除
+	wait_i->remove(p->waiter);
+	// queue を free する
+	wait_i->free_(p->waiter);
 
-    if (wait_i->empty()) {
-        wait_queue->remove(you);
-        append_activeTask(you);
-    }
+	if (wait_i->empty()) {
+	    wait_queue->remove(you);
+	    append_activeTask(you);
+	}
 
-    wait_i->free_(p);   // p->wait_i, p->wait_me は再利用される
+	wait_i->free_(p);   // p->wait_i, p->wait_me は再利用される
     }
 
     // このTaskList は終わったので、今 free して良いが、TaskListInfo に入っているので、
@@ -334,7 +334,7 @@
 
     me->self = 0;
     if (!me->flag.no_auto_free)
-    htaskImpl->free_(me);
+	htaskImpl->free_(me);
 }
 
 /**