diff example/many_task/main.cc @ 217:bfdd037aee21 draft

fix
author gongo@localhost.localdomain
date Wed, 04 Feb 2009 22:50:42 +0900
parents 028ffc9c0375
children 305ac1897c50
line wrap: on
line diff
--- a/example/many_task/main.cc	Wed Feb 04 22:44:16 2009 +0900
+++ b/example/many_task/main.cc	Wed Feb 04 22:50:42 2009 +0900
@@ -11,18 +11,20 @@
  
 double getTime();
 
-char *help_str = "Usage: ./sort [-cpu spe_num] [-length data_length]\n \
-  -cpu     Number of SPE used (default 1)			    \n \
-  -length  Sorted number of data (default 1200)";
+const char *help_str = "Usage: ./sort [option]\n \
+options\n\
+  -cpu     Number of SPE used (default 1)\n\
+  -l, --length  Sorted number of data (default 1200)\n\
+  -h, --help    Print this message";
 
 int
 init(int argc, char **argv)
 {
     for (int i = 1; argv[i]; ++i) {
-        if (strcmp(argv[i], "-length") == 0) {
+        if (strcmp(argv[i], "--length") == 0 || strcmp(argv[i], "-l") == 0) {
             data_size = atoi(argv[++i]);
         }
-	if (strcmp(argv[i], "--help") == 0) {
+	if (strcmp(argv[i], "--help") == 0 || strcmp(argv[i], "-h") == 0) {
 	    printf("%s\n", help_str);
 	    return -1;
 	}
@@ -32,7 +34,7 @@
 }
 
 int
-main(int argc, char *argv[])
+cerium_main(int argc, char *argv[])
 {
     // 計測用
     double st_time, ed_time;	
@@ -45,19 +47,18 @@
     task_init();
 
     runLoop = manager->create_task(TASK_MAIN);
-    printf("main spenum: %d\n",spenum);
-    runLoop->add_param(spenum);
+    runLoop->add_param(6);
     runLoop->add_param(data_size);
 
     runLoop->spawn();
     // Start
     st_time = getTime();
-    manager->run();
-    ed_time = getTime();
+    //manager->run();
+    //ed_time = getTime();
 
-    printf("Time: %0.6f\n",ed_time-st_time);
+    //printf("Time: %0.6f\n",ed_time-st_time);
 
-    delete manager;
+    //delete manager;
 
 FINISH:
     return 0;