Mercurial > hg > Game > Cerium
changeset 1681:7bc7780e8ece draft
add time.pl
author | Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp> |
---|---|
date | Wed, 07 Aug 2013 02:27:44 +0900 |
parents | e44e5a18392c |
children | 7d01a2891710 |
files | example/regex_mas/main.cc example/regex_mas/time.pl |
diffstat | 2 files changed, 42 insertions(+), 6 deletions(-) [+] |
line wrap: on
line diff
--- a/example/regex_mas/main.cc Tue Aug 06 05:00:04 2013 +0900 +++ b/example/regex_mas/main.cc Wed Aug 07 02:27:44 2013 +0900 @@ -44,6 +44,7 @@ off_t size; } st_mmap_t; +//simple_task_creater自体がもういらない static void simple_task_creater(int in_total_size, int out_total_size, int command, int in_data_size, int out_data_size, void *in_data, void *out_data, SchedTask *manager, @@ -196,11 +197,6 @@ if (task_count<=0) return; } - if (use_task_creater) { - simple_task_creater(w->file_size, w->division_out_size * w->task_num, TASK_EXEC, w->division_size, w->division_out_size, - w->file_mmap, w->o_data, manager, w->t_print, 0); - } - if (use_task_array) { int spl = spe_num * array_task_num; @@ -214,7 +210,7 @@ HTask **task_array = (HTask**)manager->allocate(sizeof(HTask*)*spe_num); Task **t_exec = (Task**)manager->allocate(sizeof(Task*)*spe_num); - for (int k = 0; k < spe_num; k++) { + for (int k = 0; k < spe_num; k++) { //このfor文いらない?? task_array[k] = manager->create_task_array(TASK_EXEC,array_task_num,1,1,1); t_exec[k] = 0; if (all) {
--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/example/regex_mas/time.pl Wed Aug 07 02:27:44 2013 +0900 @@ -0,0 +1,40 @@ +#!/usr/bin/perl +use strict; +use warnings; + +my $loop_count = 0; +my $exec_result = 0; +my $time_result = 0; +my $total_time = 0; +my $min_time = 0; +my $max_time = 0; +my $ave_time = 0; #average_time + +print "------setting------\n"; +print " cpu_num = $ARGV[0]\n"; +print "regex_exec_num = $ARGV[1]\n"; +print "------result(ms)---\n"; + +while ($loop_count < $ARGV[1]){ + + $exec_result = `./regex -file c.txt -cpu $ARGV[0]`; + + if($exec_result =~ /(\d+\.\d+)/ ){ + $time_result = $1 * 1000; #元の単位がsなので、ここでmsに変換 + + if($min_time == 0) {$min_time = $time_result}; + if($time_result < $min_time) {$min_time = $time_result}; + if($time_result > $max_time) {$max_time = $time_result}; + + $total_time += $time_result; + } + + #print "time:$time_result\n"; + ++$loop_count; +} + +$ave_time = $total_time / $ARGV[1]; + +print "max:$max_time\n"; +print "min:$min_time\n"; +print "ave:$ave_time\n"; #有効数字3桁なので、平均も有効数字3桁にする???