Mercurial > hg > Members > yuuhi > slide
changeset 4:f23d647ae3fa
hoge
author | Yuhi TOMARI <yuhi@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Tue, 12 Aug 2014 17:11:48 +0900 |
parents | 3d5fd010131d |
children | 220243d8ef68 |
files | s6/blank.html |
diffstat | 1 files changed, 64 insertions(+), 13 deletions(-) [+] |
line wrap: on
line diff
--- a/s6/blank.html Wed Jul 09 14:53:16 2014 +0900 +++ b/s6/blank.html Tue Aug 12 17:11:48 2014 +0900 @@ -88,7 +88,7 @@ <table width="90%" height="90%" border="0" align="center"> <tr> <td><div align="center"> - <h1><font color="#808db5">CeriumにおけるGPUとMultiCore CPUの同時実行</font></h1> + <h1><font color="#808db5">CeriumにおけるGPGPUの最適化</font></h1> </div></td> </tr> <tr> @@ -132,34 +132,85 @@ <div class='slide'> <h2>進捗</h2> <ul> + <li><dt>CPU固定でthreadを生成するAPI</dt></li> <li><dt>glibcの環境構築</dt> <dd>実はまだgcc...</dd></li> - <li><dt>mallocを(ようやく)読み始めた</dt></li> + </ul> + </div> + + <div class='slide'> + <h2>CPU固定でthreadを生成するAPI(Linux)</h2> + <pre class="code"> +int sched_setaffinity(pid_t pid, + size_t cpusetsize, const cpu_set_t *mask); + </pre> + + <ul> + <li><dt>affinity(親和度、cpu_set_t)は、そのスレッドが実行を許可されているCPUの集合を決定する + <dd>maskにCPUをsetするときは、CPU_SETを使用する(例:CPU_SET(cpu_id,&mask)</dd></dt></li> + <li><dt>スレッドのaffinityマスクを一つのCPUに設定し、スレッドをCPUに括りつけることができる(Man page)</dt></li> </ul> </div> <div class='slide'> + <h2>sched_setaffinity Sample</h2> + <pre class="code"> +void +bind_cpu() +{ + cpu_set_t mask; + __CPU_ZERO(&mask); + + char *p = getenv("BIND_CPU_ID"); + int cpu_id = atoi(p); + __CPU_SET(cpu_id, &mask); + sched_setaffinity(0, sizeof(mask), &mask) +}</pre> + <p>sarコマンドで確認できるらしい……</p> + こんな感じ + <pre> +% sar -P ALL 1 1000 + +17:51:28 CPU %user %nice %system %iowait %steal %idle +17:51:29 all 50.00 0.00 0.00 0.00 0.00 50.00 +17:51:29 0 0.00 0.00 0.00 0.00 0.00 100.00 +17:51:29 1 100.00 0.00 0.00 0.00 0.00 0.00 + +17:51:29 CPU %user %nice %system %iowait %steal %idle +17:51:30 all 50.25 0.00 0.00 0.00 0.00 49.75 +17:51:30 0 0.00 0.00 0.00 0.00 0.00 100.00 +17:51:30 1 100.00 0.00 0.00 0.00 0.00 0.00 + </pre> + </div> + + <div class='slide'> + <h2>CPU固定でthreadを生成するAPI(OSX)</h2> + <p>apple developerのKernel Programming Guide</p> + </div> + + <div class='slide'> <h2>glibc 環境構築</h2> <p>install</p> <pre class="code"> - $ mkdir build;cd build - $ ../configure --prefix=/home/hiyoko/glibc-2.19/build/bin - $ make <font color="red">--debug</font> -j - $ make install</pre> +$ mkdir build;cd build +$ ../configure --prefix=/home/hiyoko/glibc-2.19/build/bin +$ make <font color="red">--debug</font> -j +$ make install</pre> <p>compile</p> <pre class="code"> - $ g++ -Wall -g -O0 -c malloc_sample.cc -o malloc_sample.o - $ g++ -o malloc_sample malloc_sample.o -g <font color="red">-static</font> - -I../glibc-2.19/build/bin/include -L../glibc-2.19/build/bin/lib</pre> +$ g++ -Wall -g -O0 -c malloc_sample.cc -o malloc_sample.o +$ g++ -o malloc_sample malloc_sample.o -g <font color="red">-static</font> + -I../glibc-2.19/build/bin/include + -L../glibc-2.19/build/bin/lib</pre> </div> <div class='slide'> - <h2>次やること</h2> + <h2>Todo</h2> <ul> + <li><dt>調べたAPIの例題の作成</dt></li> <li><dt>malloc読み終わる</dt></li> - <li><dt>2-2n allocater</dt></li> - <li><dt>内定者研修に向けて</dt> - <dd>swiftの勉強...?</dd></li> + <li><dt>Cyber Agentインターンシップの告知</dt> + <dd>2016年度新卒、インターンシップ面接(?)免除</dd></li> </ul> </div> </div>