changeset 331:9566ac92fe2e

cerium script fix
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Fri, 12 Jun 2009 16:05:03 +0900
parents 71ca8637fcc1
children f88c350bb7b1
files bin/cerium
diffstat 1 files changed, 2 insertions(+), 84 deletions(-) [+]
line wrap: on
line diff
--- a/bin/cerium	Fri Jun 12 16:01:14 2009 +0900
+++ b/bin/cerium	Fri Jun 12 16:05:03 2009 +0900
@@ -100,97 +100,14 @@
 }
 EOFEOF
 }
-} else {
-    &help;
-}
-exit 0;
-
-sub help {
-    print "$0 init ... initialize cerium application\n";
-}
-
-sub init {
-# setup initial cerium configuration
-    mkdir "Task";
-    if (! -e $main ) &make_main;
-    if (! -e $task_config ) &make_task_config;
-}
-
-sub make_main {
-    open(F,">$main") or die("Can't write $main\n");
-    print F <<'EOFEOF';
-#include <stdio.h>
-#include <stdlib.h>
-#include <string.h>
-#include "TaskManager.h"
-#include "Func.h"
-
-extern void task_init(void);
-
-const char *usr_help_str = "Usage: ./main [-cpu spe_num] [-count N]\n\
-  -cpu    Number of SPE (default 1) \n\";
-
-int
-init(int argc, char **argv)
-{
-    for (int i = 1; argv[i]; ++i) {
-	if (strcmp(argv[i], "-count") == 0) {
-            count = atoi(argv[++i]);
-        }
-
-    }
-
-    return 0;
-}
 
-void
-hello_init(void)
-{
-    HTask *hello;
 
-    for (int i = 0; i < count; i++) {
-	/**
-	 * Create Task
-	 *   create_task(Task ID);
-	 */
-	hello = manager->create_task(HELLO_TASK);
-
-	/**
-	 * Select CPU
-	 *   SPE_0, SPE_1, SPE_2, SPE_3, SPE_4, SPE_5, SPE_ANY
-	 *   if you do not call this, execute PPE.
-	 */
-	hello->set_cpu(SPE_ANY);
-
-	/**
-	 * Set 32bits parameter
-	 *   add_param(32bit parameter);
-	 */
-	hello->add_param(i);
-
-	hello->spawn();
-    }
-}
-
-int
-TMmain(int argc, char *argv[])
-{
-    if (init(argc, argv) < 0) {
-	return -1;
-    }
-    task_init();
-    init();
-
-    return 0;
-}
-EOFEOF
-}
 
 sub make {
 
     return if ( ! -e $task_config );
 
-    my $xml = XML::LibXML->new();
+    my $parser = XML::LibXML->new();
     my $doc = $parser->parse_file("$cerium_path/lib/tasks.xml");
     my $root = $doc->documentElement();
     for my $e ($root->childNodes) {
@@ -198,6 +115,7 @@
     }
 }
 
+
 __END__
 
 =head1 NAME