changeset 1079:7823233584da draft

single cpu run on Mac OS X
author one@zeus.cr.ie.u-ryukyu.ac.jp
date Sat, 18 Dec 2010 11:04:58 +0900
parents 6dabcd1a9ccf
children 704b9e320f1e
files TaskManager/Fifo/FifoTaskManagerImpl.cc TaskManager/Fifo/FifoTaskManagerImpl.h TaskManager/Makefile.def example/many_task/Makefile.def example/many_task/Makefile.macosx example/many_task/main.cc example/many_task/ppe/QuickSort.cc example/many_task/sort.h
diffstat 8 files changed, 31 insertions(+), 8 deletions(-) [+]
line wrap: on
line diff
--- a/TaskManager/Fifo/FifoTaskManagerImpl.cc	Sat Dec 18 09:43:08 2010 +0900
+++ b/TaskManager/Fifo/FifoTaskManagerImpl.cc	Sat Dec 18 11:04:58 2010 +0900
@@ -86,6 +86,7 @@
  *
  * ActiveTaskQueue (依存条件は満たし済み) のタスクを
  * 実行タスクリストに入れる
+ * CPU_PPE 
  */
 void
 FifoTaskManagerImpl::set_runTaskList(QueueInfo<HTask> *activeTaskQueue)
@@ -104,10 +105,27 @@
     }
 }
 
+/**
+ *    exec all cpu type as simulation
+ */
+void
+FifoTaskManagerImpl::set_runTaskList1(QueueInfo<HTask> *activeTaskQueue)
+{
+    // printf("active task queue length = %d\n",activeTaskQueue->length());
+    HTaskPtr htask = activeTaskQueue->getFirst();
+    while (htask != NULL) {
+	set_taskList(htask, taskListInfo );
+	HTaskPtr next = activeTaskQueue->getNext(htask);
+	activeTaskQueue->remove(htask);
+	htask = next;
+    }
+}
+
+
 void
 FifoTaskManagerImpl::poll()
 {
-    set_runTaskList(activeTaskQueue);
+    set_runTaskList1(activeTaskQueue);
     // list を実行する
     sendTaskList();
     // ppe scheduler からの mail を調べる
--- a/TaskManager/Fifo/FifoTaskManagerImpl.h	Sat Dec 18 09:43:08 2010 +0900
+++ b/TaskManager/Fifo/FifoTaskManagerImpl.h	Sat Dec 18 11:04:58 2010 +0900
@@ -39,6 +39,8 @@
     void print_arch();
 
     // call by user
+private:
+    void set_runTaskList1(QueueInfo<HTask>* activeTaskQueue);
 
 };
 
--- a/TaskManager/Makefile.def	Sat Dec 18 09:43:08 2010 +0900
+++ b/TaskManager/Makefile.def	Sat Dec 18 11:04:58 2010 +0900
@@ -27,9 +27,9 @@
 IMPL_CELL_SRCS = $(IMPL_FIFO_SRCS) $(wildcard $(IMPL_CELL_DIR)/*.cc)
 IMPL_CELL_OBJS = $(IMPL_CELL_SRCS:.cc=.o)
 
-ABIBIT = 32
+ABIBIT = 64
 
-OPT = -g -O9 -DMAIL_QUEUE
+OPT = -g  -DMAIL_QUEUE
 # -DEARLY_TOUCH
 # -g -DTASK_LIST_MAIL -O9
 
--- a/example/many_task/Makefile.def	Sat Dec 18 09:43:08 2010 +0900
+++ b/example/many_task/Makefile.def	Sat Dec 18 11:04:58 2010 +0900
@@ -14,3 +14,6 @@
 
 INCLUDE = -I${CERIUM}/include/TaskManager -I. -I..
 LIBS = -L${CERIUM}/TaskManager
+
+ABIBIT = 64
+ABI = -m$(ABIBIT)
--- a/example/many_task/Makefile.macosx	Sat Dec 18 09:43:08 2010 +0900
+++ b/example/many_task/Makefile.macosx	Sat Dec 18 11:04:58 2010 +0900
@@ -13,7 +13,7 @@
 TASK_OBJS = $(TASK_SRCS:.cc=.o)
 
 CC      = g++
-CC += -m32
+CC += $(ABI)
 # CFLAGS  = -g -Wall# -O9 #-DDEBUG
 
 INCLUDE = -I${CERIUM}/include/TaskManager -I. -I..
--- a/example/many_task/main.cc	Sat Dec 18 09:43:08 2010 +0900
+++ b/example/many_task/main.cc	Sat Dec 18 11:04:58 2010 +0900
@@ -94,8 +94,8 @@
 static void
 sort_init(SchedTask *manager, void *a, void *b)
 {
-    sorter.cpuNum = (int)a;
-    int length = (int)b;
+    sorter.cpuNum = (long)a;
+    long length = (long)b;
 
     sorter.data = (DataPtr)manager->allocate(sizeof(Data)*length);
     sorter.data_length = length;
--- a/example/many_task/ppe/QuickSort.cc	Sat Dec 18 09:43:08 2010 +0900
+++ b/example/many_task/ppe/QuickSort.cc	Sat Dec 18 11:04:58 2010 +0900
@@ -35,7 +35,7 @@
 #endif
 
     // printf("[PPE] Quick: length:%d addr->%x \n",end, (int)rbuff);
-    //printf("[PPE] Quick: data[0]: %d addr->%x\n",sizeof(r_data),r_data); 
+    printf("[PPE] Quick: data[0]: %ld addr->%lx\n",sizeof(r_data),(long)r_data); 
 
     //show_data(r_data, end);
     quick_sort(r_data, begin, end-1);
--- a/example/many_task/sort.h	Sat Dec 18 09:43:08 2010 +0900
+++ b/example/many_task/sort.h	Sat Dec 18 11:04:58 2010 +0900
@@ -8,8 +8,8 @@
 
 typedef struct sort {
     int data_length;
-    int cpuNum;
     int split_num;
+    long cpuNum;
     HTaskPtr *fsort;
     HTaskPtr *bsort;
     DataPtr data;