5 #include "MPI_Object.h"
8 #include "MPI_Environment.h"
27 std::valarray<T> mMemory;
35 MPI_Type::GetSize<T>(mMPITSize);
50 memset(&mMemory[0],0,
sizeof(T)*mMemory.size());
52 for(
auto& v:mMemory) {
66 MPI_Win_create(&mMemory[0],(tMPIByte) mMPITSize*n,mMPITSize,MPI_INFO_NULL,env.
getWorld(),&mWin);
77 MPI_Win_fence(0,mWin);
87 inline void read(std::valarray<T>& values,
const tMPICoreId& srcCore) {
88 MPI_Get(&values[0],values.size(),MPI_Type::GetPrimaryType<T>(),
89 srcCore,0,values.size(),MPI_Type::GetPrimaryType<T>(),mWin);
95 inline void write(
const std::valarray<T>& values,
const tMPICoreId& destCore) {
96 MPI_Put(&values[0],values.size(),MPI_Type::GetPrimaryType<T>(),
97 destCore,0,values.size(),MPI_Type::GetPrimaryType<T>(),mWin);
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
This class is a class to modify directctly memory between 2 cores.
Definition: MPI_RAMIO.h:23
void closeRAMWindow()
close a ram window
Definition: MPI_RAMIO.h:70
MPI_RAMIO()
create
Definition: MPI_RAMIO.h:34
void openRAMWindow(const MPI_Environment &env, const tMPICount &n)
open a ram window of size n within the core this
Definition: MPI_RAMIO.h:64
void flush()
open the asscess
Definition: MPI_RAMIO.h:76
virtual ~MPI_RAMIO(void)
destroy
Definition: MPI_RAMIO.h:41
void read(std::valarray< T > &values, const tMPICoreId &srcCore)
read the memory
Definition: MPI_RAMIO.h:87
void write(const std::valarray< T > &values, const tMPICoreId &destCore)
read the memory
Definition: MPI_RAMIO.h:95
MPI_RAMIO< T > & operator=(const T &value)
initialize the RAM values
Definition: MPI_RAMIO.h:48