Merge branch 'charm' of charmgit:charm into charm
[charm.git] / examples / charm++ / manyToMany / manyToMany.ci
1 mainmodule manyToMany {
2
3         readonly CProxy_Main mainProxy;
4     readonly int max_iter;
5     readonly int numChares;
6     readonly int msgSize;
7
8         message manyToManyMsg {
9                 char data[];
10         };
11
12         mainchare Main {
13                 entry Main(CkArgMsg *m);
14                 entry [reductiontarget] void manyToManyReady();
15                 entry [reductiontarget] void nextmanyToMany();
16         };
17
18         array [2D] manyToMany {
19                 entry manyToMany();
20         entry void sendmanyToMany();
21                 entry void getmanyToMany(manyToManyMsg *m);
22         
23         entry void domanyToMany() {
24            
25             atomic {
26                 sendmanyToMany();
27             }
28
29             for(count = 0; count < numChares; ++count){
30                 when getmanyToMany[iter](manyToManyMsg *m) atomic {
31                     processmanyToMany(m);
32                 }
33             }
34             atomic {
35                             iter++;
36                                 finish();
37             }
38                 };
39         };
40 };