Replaced uses of CkIndex with CkReductionTarget in examples.
[charm.git] / examples / charm++ / load_balancing / stencil3d / stencil3d.ci
blob874e96c05ac3f4e0e28e1baaa7db955384e1c84c
1 mainmodule stencil3d {
3   readonly CProxy_Main mainProxy;
4   readonly int arrayDimX;
5   readonly int arrayDimY;
6   readonly int arrayDimZ;
7   readonly int blockDimX;
8   readonly int blockDimY;
9   readonly int blockDimZ;
11   readonly int num_chare_x;
12   readonly int num_chare_y;
13   readonly int num_chare_z;
15   mainchare Main {
16     entry Main(CkArgMsg *m);
17     entry [reductiontarget] void report();
18   };
20   array [3D] Stencil {
21     entry Stencil(void);
22     entry void begin_iteration(void);
23     entry void receiveGhosts(int iter, int dir, int height, int width,
24                              double ghosts[height*width]);
26     entry [reductiontarget] void doStep() {
27       serial "begin_iteration" {
28         begin_iteration();
29       }
30       for(imsg = 0; imsg < 6; imsg++) {
31         // "iterations" keeps track of messages across steps
32         when receiveGhosts[iterations] (int iter, int dir, int height, 
33                                      int width, double ghosts[height*width])
34           serial "process_ghosts" {
35             processGhosts(dir, height, width, ghosts);
36           }
37       }
38       serial "do_work" {
39         check_and_compute();
40       }
41     };
42   };