view Nov-2013/19th.html @ 0:c9b2998eb516

add slide
author Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
date Tue, 10 Dec 2013 15:25:07 +0900
parents
children
line wrap: on
line source

<!DOCTYPE html>

<!--
  Google HTML5 slide template

  Authors: Luke Mahé (code)
           Marcin Wichary (code and design)
           
           Dominic Mazzoni (browser compatibility)
           Charles Chen (ChromeVox support)

  URL: http://code.google.com/p/html5slides/
-->

<html>
  <head>
    <title>2013-11-19</title>

    <meta charset='utf-8'>
    <script
      src='http://html5slides.googlecode.com/svn/trunk/slides.js'></script>
  </head>

  <style>
    /* Your individual styles here, or just use inline styles if that’s
       what you want. */
  .slides article { background-image: none !important; background-color: white; }

  </style>

  <body style='display: none'>

    <section class='slides layout-regular template-default'>

      <!-- Your slides (<article>s) go here. Delete or comment out the
           slides below.-->

      <article>
        <h1>
          Cerium Task Manager
          <br>
          による正規表現の実装
        </h1>
        <p>
          Masataka Kohagura
          <br>
          19th November , 2013
        </p>
      </article>

      <article>
        <h3>
        研究目的
        </h3>
        <p>
        マルチコア CPU を最大限に活かすためには、並列プログラミングによる並列度を向上させなければならないが、実装が難しい。
        当研究室では Cerium Libraryを提供することによって並列プログラミングを容易にしているが、ファイル読み込み等のI/O部分に関してはまだ実装されていない。
        </p>
        <p>
        本研究ではその例題として正規表現を実装し、I/Oの並列化の設計・実装によって既存の正規表現の処理速度、処理効率を上げる。
        </p>
        </article>

        <article>
        <h3>
        今週のしたこと
        </h3>
        <p>
    ・検索文字列のハードコーディングの脱却<br>
(set_inData,get_input絡みでバグ??)
    </p>
    </article>

    <!--
    <article class='smaller'>
    <h3>I/O並列化のシーケンス図(mmap)</h3>
    <div align="center">
    <IMG SRC="mmap.png">
    </div>
    <li>
codeがシンプル(readを書いて読み込まなくていいため)
    </li>
    <li>
    memoryより大きなファイルは開けない
    </li>
    <li>
    readの先読みがOS依存
    </li>

    </article>
    -->


    <article>
    <h3>
    WordCount.h
    </h3>
    <section><pre>
typedef struct wordCount {
    struct wordCount *self;
    int size;             // remaining file size
    int division_size;    // for each word count task
    (中略)
<font color="red">    unsigned char *search_word;
    int search_word_len;</font>
    HTaskPtr t_print;
} WordCount;
</pre></section>
</article>

    <article>
    <h3>
    main.cc(task生成部分)
    </h3>
    <section><pre>
run_tasks(SchedTask *manager,…)
{

    if(size != w->size){ //最後のタスクかどうかの判定
        t_exec[k]->set_param(0,&set_one_task_length + EXTRA_LENGTH);
        t_exec[k]->set_inData(0,w->file_mmap + a*w->division_size, size+EXTRA_LENGTH);
        <font color="red">t_exec[k]->set_inData(1,w->search_word, w->search_word_len); </font>
    }else{
        t_exec[k]->set_param(0,&set_one_task_length);
        t_exec[k]->set_inData(0,w->file_mmap + a*w->division_size, size);
        <font color="red">t_exec[k]->set_inData(1,w->search_word, w->search_word_len); </font>
    }

}
</pre></section>

</article>


    <article>
    <h3>
    main.cc(task生成部分)
    </h3>
    <section><pre>
run_tasks(SchedTask *manager,…)
{

    if(size != w->size){ //最後のタスクかどうかの判定
        t_exec[k]->set_param(0,&set_one_task_length + EXTRA_LENGTH);
        t_exec[k]->set_inData(0,w->file_mmap + a*w->division_size, size+EXTRA_LENGTH);
        <font color="red">t_exec[k]->set_inData(1,w->search_word, w->search_word_len); </font>
    }else{
        t_exec[k]->set_param(0,&set_one_task_length);
        t_exec[k]->set_inData(0,w->file_mmap + a*w->division_size, size);
        <font color="red">t_exec[k]->set_inData(1,w->search_word, w->search_word_len); </font>
    }

}
</pre></section>

</article>

    <article>
    <h3>
    問題点
    </h3>
    <li>
    複数の文字列をタスクに渡そうとすると、最初に渡す文字列に関しては渡せるが、後に渡す文字列がうまく渡らない。
    </li>
    <p>Exec.cc(get_input)</p>
    <section><pre>
run(SchedTask *s, void *rbuf, void *wbuf)
{
    unsigned char *i_data = (unsigned char *)s->get_input(rbuf,0);
    unsigned char *search_word = (unsigned char*)s->get_input(rbuf,1);

    s->printf("[i_data]\n%s\n",i_data);
    s->printf("[search_word]\n%s\n",search_word);

    return 0;
}
</pre></section>

    <p>result</p>
    <section><pre>
(lldb) p i_data
(unsigned char *) $2 = 0x000000010202ca00 "aaa bbb …"
(lldb) p search_word
(unsigned char *) $3 = 0x000000010202ca00 "aaa bbb …"
</pre></section>
    <li>文字列を複数受け取ろうとすると、index(1)のアドレスがindex(0)のアドレスと同じ場所を示す</li>
    <li>この時のi_data sizeは8byte、search_word sizeは6Byteである。</li>
    <li>i_data size = search_word sizeにしても同様</li>

</article>

</body>
</html>