#ifndef MSG_H
#define MSG_H
#ifdef MPI_YES
#include <mpi.h>
#else
#include <mpi_dummy.h>
#endif
namespace CSLIB_NS {
class Msg {
public:
int nsend,nrecv;
MPI_Comm world;
Msg(int, const void *, MPI_Comm);
Msg(int, const void *);
virtual ~Msg() {}
virtual void send(int, int *, int, char *) = 0;
virtual void recv(int &, int *&, int &, char *&) = 0;
protected:
int me,nprocs;
int client,server;
int nfield;
int *fieldID,*fieldtype,*fieldlen;
int lengths[2];
void init(int);
void allocate(int, int &, int *&, int, int &, char *&);
void *smalloc(int);
void sfree(void *);
void error_all(const char *);
void error_one(const char *);
};
}
#endif