C++ mpi module for stochmagnet_main Package
MPI_CoreToCoreSMessage.h
1 #ifndef MPI_CoreToCoreSMessage_H
2 #define MPI_CoreToCoreSMessage_H
3 
4 //mpi header
5 #include "MPI_Object.h"
6 
7 //MPI environement header
8 #include "MPI_Environment.h"
9 
10 //MPI type
11 #include "MPI_Type.h"
12 
34 template<typename T>
36 
37  //attributes
38 private :
39 public:
40  // CONSTRUCTORS
44 
45  }
46 
47  // DESTRUCTORS
50  virtual ~MPI_CoreToCoreSMessage(void) {
51 
52  }
53 
54 public:
57  virtual tMemSize getMemorySize() const override{
58  return sizeof(*this)+getContentsMemorySize();
59  }
60 
61  //sender methods
62  //===============
71  inline static void Send(const MPI_Environment& env,const tMPICoreId& dstCore,
72  const T& data,const tMPITag& flag) {
73  MPI_Ssend(&data,1,MPI_Type::GetPrimaryType<T>(),dstCore,flag,env.getWorld());
74  }
75 
76 
77 
78 
79 
80 };
81 
82 #endif
virtual tMemSize getContentsMemorySize() const
return nthe memory size of the included associations
Definition: CORE_Object.h:278
This class is a class to send / receive synchonized messages from one to core to one core.
Definition: MPI_CoreToCoreSMessage.h:35
static void Send(const MPI_Environment &env, const tMPICoreId &dstCore, const T &data, const tMPITag &flag)
synchonize sent of a data with flag to dstCore
Definition: MPI_CoreToCoreSMessage.h:71
virtual tMemSize getMemorySize() const override
return the memory size of the class
Definition: MPI_CoreToCoreSMessage.h:57
virtual ~MPI_CoreToCoreSMessage(void)
destroy
Definition: MPI_CoreToCoreSMessage.h:50
MPI_CoreToCoreSMessage()
create
Definition: MPI_CoreToCoreSMessage.h:43
This class is a Environment class to define MPI world.
Definition: MPI_Environment.h:36
const tMPIComm & getWorld() const
get the world of the environment for reading
Definition: MPI_Environment.h:165
This class is a base class of E-MicromM core package.
Definition: MPI_Object.h:32