Changeset 1639 for XIOS/trunk/src/cxios.cpp
- Timestamp:
- 01/22/19 16:43:32 (5 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/trunk/src/cxios.cpp
r1638 r1639 26 26 bool CXios::isClient ; 27 27 bool CXios::isServer ; 28 ep_lib::MPI_Comm CXios::globalComm ;28 MPI_Comm CXios::globalComm ; 29 29 bool CXios::usingOasis ; 30 30 bool CXios::usingServer = false; … … 90 90 91 91 checkEventSync = getin<bool>("check_event_sync", checkEventSync); 92 #ifdef _usingMPI 92 93 93 globalComm=MPI_COMM_WORLD ; 94 #elif _usingEP95 ep_lib::MPI_Comm *ep_comm;96 ep_lib::MPI_Info info;97 ep_lib::MPI_Comm_create_endpoints(EP_COMM_WORLD->mpi_comm, 1, info, ep_comm);98 ep_lib::passage = ep_comm;99 globalComm=ep_lib::passage[0] ;100 #endif101 94 } 102 95 … … 107 100 \param [in/out] returnComm communicator corresponding to group of client with same codeId 108 101 */ 109 void CXios::initClientSide(const string& codeId, ep_lib::MPI_Comm& localComm, ep_lib::MPI_Comm& returnComm)102 void CXios::initClientSide(const string& codeId, MPI_Comm& localComm, MPI_Comm& returnComm) 110 103 TRY 111 104 { 105 initialize() ; 106 112 107 isClient = true; 113 isServer = false;114 115 initialize() ;116 117 108 118 109 CClient::initialize(codeId,localComm,returnComm) ; 119 110 if (CClient::getRank()==0) globalRegistry = new CRegistry(returnComm) ; 120 121 111 122 112 // If there are no server processes then we are in attached mode … … 177 167 void CXios::initServerSide(void) 178 168 { 179 isClient = false;180 isServer = true;181 182 169 initServer(); 183 170 isClient = false; 184 171 isServer = true; 172 185 173 // Initialize all aspects MPI 186 174 CServer::initialize(); … … 235 223 int firstPoolGlobalRank = secondaryServerGlobalRanks[0]; 236 224 int rankGlobal; 237 ep_lib::MPI_Comm_rank(globalComm, &rankGlobal);225 MPI_Comm_rank(globalComm, &rankGlobal); 238 226 239 227 // Merge registries defined on each pools … … 247 235 globalRegistrySndServers.mergeRegistry(*globalRegistry) ; 248 236 int registrySize = globalRegistrySndServers.size(); 249 ep_lib::MPI_Send(®istrySize,1,EP_LONG,firstPoolGlobalRank,15,CXios::globalComm) ;237 MPI_Send(®istrySize,1,MPI_LONG,firstPoolGlobalRank,15,CXios::globalComm) ; 250 238 CBufferOut buffer(registrySize) ; 251 239 globalRegistrySndServers.toBuffer(buffer) ; 252 ep_lib::MPI_Send(buffer.start(),registrySize,EP_CHAR,firstPoolGlobalRank,15,CXios::globalComm) ;240 MPI_Send(buffer.start(),registrySize,MPI_CHAR,firstPoolGlobalRank,15,CXios::globalComm) ; 253 241 } 254 242 } … … 257 245 if (rankGlobal == firstPoolGlobalRank) 258 246 { 259 ep_lib::MPI_Status status;247 MPI_Status status; 260 248 char* recvBuff; 261 249 … … 266 254 int rank = secondaryServerGlobalRanks[i]; 267 255 int registrySize = 0; 268 ep_lib::MPI_Recv(®istrySize, 1, EP_LONG, rank, 15, CXios::globalComm, &status);256 MPI_Recv(®istrySize, 1, MPI_LONG, rank, 15, CXios::globalComm, &status); 269 257 recvBuff = new char[registrySize]; 270 ep_lib::MPI_Recv(recvBuff, registrySize, EP_CHAR, rank, 15, CXios::globalComm, &status);258 MPI_Recv(recvBuff, registrySize, MPI_CHAR, rank, 15, CXios::globalComm, &status); 271 259 CBufferIn buffer(recvBuff, registrySize) ; 272 260 CRegistry recvRegistry;
Note: See TracChangeset
for help on using the changeset viewer.