#include "one_sided_client_buffer.hpp" #include "event_client.hpp" #include "timer.hpp" namespace xios { extern CLogType logProtocol; COneSidedClientBuffer::COneSidedClientBuffer(MPI_Comm& interComm, int serverRank, MPI_Comm& commSelf, MPI_Comm& interCommMerged, int intraServerRank) : interComm_(interComm), serverRank_(serverRank) { MPI_Alloc_mem(controlSize_*sizeof(MPI_Aint), MPI_INFO_NULL, &control_) ; control_[CONTROL_ADDR] = 0 ; control_[CONTROL_FINALIZE] = 0 ; sendNewBuffer() ; createWindow(commSelf, interCommMerged, intraServerRank ) ; } void COneSidedClientBuffer::createWindow(MPI_Comm& commSelf, MPI_Comm& interCommMerged, int intraServerRank ) { CTimer::get("create Windows").resume() ; MPI_Comm interComm ; MPI_Intercomm_create(commSelf, 0, interCommMerged, intraServerRank, 0, &interComm) ; MPI_Intercomm_merge(interComm, false, &winComm_) ; int rank ; MPI_Comm_rank(winComm_,&rank) ; info(logProtocol)<<"Windows rank="<start(),request.buffer->count(), MPI_CHAR, serverRank_, 20, interComm_, &request.mpiRequest ) ; if (info.isActive(logProtocol)) CTimer::get("sendTimelineEvent : MPI_Isend").suspend() ; info(logProtocol)<start(),request.buffer->count(), MPI_CHAR, serverRank_, 20, interComm_, &request.mpiRequest ) ; requests_.push_back(request) ; } void COneSidedClientBuffer::sendNewBuffer(void) { MPI_Aint controlAddr ; MPI_Get_address(control_, &controlAddr) ; MPI_Send(&controlAddr, 1, MPI_AINT, serverRank_, 20, interComm_) ; } }