changeset 1605:5b99bcc6bdb0 draft

fix mail_check and init dim_count and init _export_task_log.
author Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp>
date Sun, 14 Apr 2013 22:48:43 +0900
parents e6855e99bdde
children b09f44c7c052
files TaskManager/Cell/CellTaskManagerImpl.cc TaskManager/Fifo/FifoTaskManagerImpl.cc TaskManager/kernel/ppe/CpuThreads.cc TaskManager/kernel/ppe/HTask.cc TaskManager/kernel/ppe/TaskManagerImpl.cc TaskManager/kernel/ppe/TaskManagerImpl.h
diffstat 6 files changed, 26 insertions(+), 20 deletions(-) [+]
line wrap: on
line diff
--- a/TaskManager/Cell/CellTaskManagerImpl.cc	Thu Apr 11 23:05:04 2013 +0900
+++ b/TaskManager/Cell/CellTaskManagerImpl.cc	Sun Apr 14 22:48:43 2013 +0900
@@ -240,7 +240,9 @@
         } else if (data == (memaddr) MY_SPE_COMMAND_MALLOC) {
             // MY_SPE_COMMAND_MALLOC   SPE からのmain memory request
             send_alloc_reply(this, id, speThreads);
-        } else if (data > (memaddr) MY_SPE_NOP) {
+        } else if (data == (memaddr) MY_SPE_NOP) {
+            continue;
+        } else {
 #ifdef TASK_LIST_MAIL
   	    // multi dimensionだったらカウントする 
             TaskListPtr list = (TaskListPtr)data;
--- a/TaskManager/Fifo/FifoTaskManagerImpl.cc	Thu Apr 11 23:05:04 2013 +0900
+++ b/TaskManager/Fifo/FifoTaskManagerImpl.cc	Sun Apr 14 22:48:43 2013 +0900
@@ -225,26 +225,26 @@
 	    ppeTaskList->freeAll(); 
         } else if (data == (memaddr)MY_SPE_COMMAND_EXIT) {
             __debug_ppe("mail_check(): Task List finish COMMAND\n");
-	} else if (data == (memaddr)MY_SPE_COMMAND_MALLOC) {
-	    send_alloc_reply(this, 0, mainScheduler);
+        } else if (data == (memaddr)MY_SPE_COMMAND_MALLOC) {
+            send_alloc_reply(this, 0, mainScheduler);
         } else if (data != (memaddr)MY_SPE_NOP) {
             __debug_ppe("mail_check(): recv from 0x%x\n", data);
-	    // post_func を先に実行しないと、systask_finish が active_queue
-	    // 移されてから、wait_for されるという事態が起きることがある。
+            // post_func を先に実行しないと、systask_finish が active_queue
+            // 移されてから、wait_for されるという事態が起きることがある。
 #ifdef TASK_LIST_MAIL
             TaskListPtr list = (TaskListPtr)data;
             check_task_list_finish(schedTaskManager, list, waitTaskQueue);
 #else
             HTaskPtr task = (HTaskPtr)data;
 #if 0
-	    if (task->cpu_type != CPU_PPE) {
-		const char *name = get_task_name(task);
-		if (name != NULL) {
-		  printf("[PPE] ");
-		  printf("Task id : %d, ", task->command);
-		  printf("Task name : %s\n", name);
-		}
-	    }
+            if (task->cpu_type != CPU_PPE) {
+                const char *name = get_task_name(task);
+                if (name != NULL) {
+                    printf("[PPE] ");
+                    printf("Task id : %d, ", task->command);
+                    printf("Task name : %s\n", name);
+                }
+            }
 #endif
 #ifndef NOT_CHECK
 	    
--- a/TaskManager/kernel/ppe/CpuThreads.cc	Thu Apr 11 23:05:04 2013 +0900
+++ b/TaskManager/kernel/ppe/CpuThreads.cc	Sun Apr 14 22:48:43 2013 +0900
@@ -109,7 +109,7 @@
             p->self->flag.dim_count = cpu_num;
         for (int i = 0; i < cpu_num; i++) {
             send_mail(i+SPE_0,1,(memaddr*)&p); // i+min_cpu()
-	}
+        }
     } else {
         send_mail(cpu_num,1,(memaddr*)&p);
     }
--- a/TaskManager/kernel/ppe/HTask.cc	Thu Apr 11 23:05:04 2013 +0900
+++ b/TaskManager/kernel/ppe/HTask.cc	Sun Apr 14 22:48:43 2013 +0900
@@ -20,7 +20,7 @@
 {
     if (export_task_log)
         tasklog->create_time = rdtsc();
-    
+    this->flag.dim_count = 0;    
     TaskList *tl = (TaskList*)rbuf;
     tl->self = this;
     tl->set_last(last);
@@ -29,6 +29,7 @@
 
 void
 HTask::iterate(long x) {
+    this->flag.dim_count = 0;
     TaskList *tl = (TaskList*)rbuf;
     tl->dim=1;
     tl->x=x;
@@ -39,6 +40,7 @@
 
 void
 HTask::iterate(long x, long y) {
+    this->flag.dim_count = 0;
     TaskList *tl = (TaskList*)rbuf;
     tl->dim=2;
     tl->x=x;
@@ -50,6 +52,7 @@
 
 void
 HTask::iterate(long x, long y, long z) {
+    this->flag.dim_count = 0;
     TaskList *tl = (TaskList*)rbuf;
     tl->dim=3;
     tl->x=x;
@@ -124,6 +127,7 @@
     r_size = 0;
     TaskListPtr tl =  mimpl->createTaskList();
     tl->self = 0;
+    this->flag.dim_count = 0;
     rbuf = (memaddr)tl;
     bzero(tl->tasks,sizeof(Task)*TASK_MAX_SIZE);
     Task *task = tl->tasks;
--- a/TaskManager/kernel/ppe/TaskManagerImpl.cc	Thu Apr 11 23:05:04 2013 +0900
+++ b/TaskManager/kernel/ppe/TaskManagerImpl.cc	Sun Apr 14 22:48:43 2013 +0900
@@ -24,7 +24,7 @@
 }
 
 TaskManagerImpl::TaskManagerImpl(int num)
-    : machineNum(num){
+    : machineNum(num) ,_export_task_log(0){
     // 実行可能なHTaskのリスト
     activeTaskQueue = new QueueInfo<HTask>(htaskPool);
     // wait_forで止まっているHTaskのリスト。必要ないが、Dead lock detection に使う
--- a/TaskManager/kernel/ppe/TaskManagerImpl.h	Thu Apr 11 23:05:04 2013 +0900
+++ b/TaskManager/kernel/ppe/TaskManagerImpl.h	Sun Apr 14 22:48:43 2013 +0900
@@ -31,12 +31,12 @@
     Scheduler *scheduler;
     TaskManagerImpl *others;
     int _export_task_log;
-
+    
     /* constructor */
-    TaskManagerImpl(int num = 0) ;
-
+    TaskManagerImpl(int num = 0);
+    
     virtual ~TaskManagerImpl() { }
-
+    
     /* functions */
     // system
     virtual void init(int,int,int) = 0;