Mercurial > hg > Game > Cerium
annotate example/send_args/ppe/Exec.cc @ 2048:6796d85f3d6b draft
remove error
author | Masataka Kohagura <kohagura@cr.ie.u-ryukyu.ac.jp> |
---|---|
date | Thu, 28 Jan 2016 00:05:49 +0900 |
parents | 3babb36ac459 |
children |
rev | line source |
---|---|
1780 | 1 #include <stdio.h> |
2 #include <string.h> | |
3 #include <unistd.h> | |
4 #include <sys/stat.h> | |
5 #include <iostream> | |
6 #include <vector> | |
7 #include <cstdlib> | |
8 | |
9 #include "SchedTask.h" | |
10 #include "Exec.h" | |
11 #include "Func.h" | |
12 | |
13 /* これは必須 */ | |
14 SchedDefineTask(Exec); | |
15 | |
16 | |
17 | |
18 static int | |
19 run(SchedTask *s, void *rbuf, void *wbuf) | |
20 { | |
1798
3babb36ac459
array(bmskip table) allocate size change 256 to 256*sizeof(int)
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
1796
diff
changeset
|
21 char *receive_word = (char *)s->get_input(rbuf,0); |
1796
355304646b4b
send array to task
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
1794
diff
changeset
|
22 int *intTable = (int *)s->get_input(rbuf,1); |
355304646b4b
send array to task
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
1794
diff
changeset
|
23 int intTable_size = (int)s->get_inputSize(1); |
1780 | 24 |
1796
355304646b4b
send array to task
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
1794
diff
changeset
|
25 long task_number = (long)s->get_param(0); |
1780 | 26 |
27 //s->xはiteraterで繰り返した数 | |
1796
355304646b4b
send array to task
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
1794
diff
changeset
|
28 for(int i = 0; i < intTable_size;i++){ |
355304646b4b
send array to task
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
1794
diff
changeset
|
29 s->printf("%d ",intTable[i]); |
355304646b4b
send array to task
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
1794
diff
changeset
|
30 } |
355304646b4b
send array to task
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
1794
diff
changeset
|
31 s->printf("\n"); |
1780 | 32 |
1796
355304646b4b
send array to task
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
1794
diff
changeset
|
33 s->printf("task number: %d\n",task_number + 1); |
1798
3babb36ac459
array(bmskip table) allocate size change 256 to 256*sizeof(int)
Masataka Kohagura <e085726@ie.u-ryukyu.ac.jp>
parents:
1796
diff
changeset
|
34 s->printf("args : %s\n",receive_word); |
1791 | 35 |
1780 | 36 |
37 return 0; | |
38 } |