annotate example/word_count3/README @ 639:70c5c2d2eb24

fix
author Shinji KONO <kono@ie.u-ryukyu.ac.jp>
date Thu, 19 Nov 2009 18:45:24 +0900
parents 7d9d209bdc82
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
527
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
1 /*
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
2 * $Id: README,v 1.2 2008/10/21 07:38:41 gongo Exp $
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
3 */
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
4
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
5 - 概要
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
6
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
7 基本的には HelloWorld と同じなんですが、
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
8 Hello Task が終了すると、set_post で指定した関数を呼び出すようにしています。
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
9 この関数を使えば、タスクが終了した事が検知できる。きっと多分。
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
10 引数は void* のみです。特に問題はないと信じてます。
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
11
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
12 API
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
13 set_post(void (*func)(void*), void *arg);
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
14
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
15 func の実装
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
16 void
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
17 func(void *p) {}
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
18
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
19 - 実行方法
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
20
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
21 % ./post [-cpu CPU_NUM] [-count COUNT]
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
22
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
23 -cpu 使用する SPU の数です。
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
24 -count 表示する "Hello, World!!" の数。
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
25 正確には post_func を使って繰り返し呼ぶ Hello Task の数。
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
26
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
27 - 実行例
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
28
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
29 % ./post
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
30 Hello, World!! post_func output 1
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
31 post function : 1
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
32
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
33 % ./post -count 10
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
34 Hello, World!! post_func output 10
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
35 post function : 10
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
36 Hello, World!! post_func output 9
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
37 post function : 9
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
38 Hello, World!! post_func output 8
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
39 post function : 8
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
40 Hello, World!! post_func output 7
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
41 post function : 7
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
42 Hello, World!! post_func output 6
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
43 post function : 6
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
44 Hello, World!! post_func output 5
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
45 post function : 5
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
46 Hello, World!! post_func output 4
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
47 post function : 4
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
48 Hello, World!! post_func output 3
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
49 post function : 3
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
50 Hello, World!! post_func output 2
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
51 post function : 2
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
52 Hello, World!! post_func output 1
7d9d209bdc82 add word_count3
yutaka@henri.cr.ie.u-ryukyu.ac.jp
parents:
diff changeset
53 post function : 1