38 #ifndef TRANSFER_MPIWINFULL_H
39 #define TRANSFER_MPIWINFULL_H
116 unsigned long blockCount,
117 unsigned long blockSize,
127 unsigned int typeSize = type.
size();
134 if (MPI_Win_create(data,
135 blockCount * blockSize * typeSize * numaComm.
totalDomains(),
161 void transfer(
int remoteRank,
unsigned long offset,
162 unsigned char *cache)
164 int mpiResult; NDBG_UNUSED(mpiResult);
168 #ifndef THREADSAFE_MPI
172 std::lock_guard<threads::Mutex> winLock(*
m_winMutex);
173 #endif // THREADSAFE_MPI
175 mpiResult = MPI_Win_lock(MPI_LOCK_SHARED, remoteRank,
177 assert(mpiResult == MPI_SUCCESS);
179 mpiResult = MPI_Get(cache,
187 assert(mpiResult == MPI_SUCCESS);
189 mpiResult = MPI_Win_unlock(remoteRank,
m_window);
190 assert(mpiResult == MPI_SUCCESS);
194 #endif // ASAGI_NOMPI
198 #endif // TRANSFER_MPIWINFULL_H
unsigned long m_blockSize
threads::Mutex * m_winMutex
unsigned int m_numaDomainId
asagi::Grid::Error broadcast(T &value, unsigned int rootDomain=0)
asagi::Grid::Error init(unsigned char *data, unsigned long blockCount, unsigned long blockSize, const types::Type &type, const mpi::MPIComm &mpiComm, numa::NumaComm &numaComm)
Include file for C and C++ API.
unsigned int domainId() const
unsigned int totalDomains() const
virtual MPI_Datatype getMPIType() const =0
virtual unsigned int size() const =0
void transfer(int remoteRank, unsigned long offset, unsigned char *cache)