
#include "receiver.h"

#include "jacobi.decl.h"

class DataMsg : public CMessage_DataMsg {
public:
  int fromLeft;
  int size;
  double b[200]; // border up to 200 elements can be sent. use varsize later.
};


class main : public Chare
{
private:
  CkArrayID A;

public:
  main(CkMigrateMessage *m) {}
  main(CkArgMsg *m);
  void allDone(CkQdMsg *);
};

class jacobi: public receiver 
{
private:
  int iterations;
  CellData *data;
  void sendToNeighbors();

  char *buf1, *buf2;

public:
   jacobi();
   jacobi(CkMigrateMessage *m) {}
   void pup(PUP::er &p);
   void borderValues(); 
   void resumeFromWait();
};

