Ignore:
Timestamp:
01/22/19 16:15:03 (5 years ago)
Author:
yushan
Message:

dev on ADA

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/trunk/src/cxios.cpp

    r1622 r1638  
    2626  bool CXios::isClient ; 
    2727  bool CXios::isServer ; 
    28   MPI_Comm CXios::globalComm ; 
     28  ep_lib::MPI_Comm CXios::globalComm ; 
    2929  bool CXios::usingOasis ; 
    3030  bool CXios::usingServer = false; 
     
    9090 
    9191    checkEventSync = getin<bool>("check_event_sync", checkEventSync); 
    92  
     92    #ifdef _usingMPI 
    9393    globalComm=MPI_COMM_WORLD ; 
     94    #elif _usingEP 
     95    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    #endif 
    94101  } 
    95102 
     
    100107  \param [in/out] returnComm communicator corresponding to group of client with same codeId 
    101108  */ 
    102   void CXios::initClientSide(const string& codeId, MPI_Comm& localComm, MPI_Comm& returnComm) 
     109  void CXios::initClientSide(const string& codeId, ep_lib::MPI_Comm& localComm, ep_lib::MPI_Comm& returnComm) 
    103110  TRY 
    104111  { 
     112    isClient = true; 
     113    isServer = false; 
     114 
    105115    initialize() ; 
    106116 
    107     isClient = true; 
    108117 
    109118    CClient::initialize(codeId,localComm,returnComm) ; 
    110119    if (CClient::getRank()==0) globalRegistry = new CRegistry(returnComm) ; 
     120 
    111121 
    112122    // If there are no server processes then we are in attached mode 
     
    167177  void CXios::initServerSide(void) 
    168178  { 
     179    isClient = false; 
     180    isServer = true; 
     181 
    169182    initServer(); 
    170183    isClient = false; 
    171184    isServer = true; 
    172  
    173185    // Initialize all aspects MPI 
    174186    CServer::initialize(); 
     
    223235        int firstPoolGlobalRank = secondaryServerGlobalRanks[0]; 
    224236        int rankGlobal; 
    225         MPI_Comm_rank(globalComm, &rankGlobal); 
     237        ep_lib::MPI_Comm_rank(globalComm, &rankGlobal); 
    226238 
    227239        // Merge registries defined on each pools 
     
    235247            globalRegistrySndServers.mergeRegistry(*globalRegistry) ; 
    236248            int registrySize = globalRegistrySndServers.size(); 
    237             MPI_Send(&registrySize,1,MPI_LONG,firstPoolGlobalRank,15,CXios::globalComm) ; 
     249            ep_lib::MPI_Send(&registrySize,1,EP_LONG,firstPoolGlobalRank,15,CXios::globalComm) ; 
    238250            CBufferOut buffer(registrySize) ; 
    239251            globalRegistrySndServers.toBuffer(buffer) ; 
    240             MPI_Send(buffer.start(),registrySize,MPI_CHAR,firstPoolGlobalRank,15,CXios::globalComm) ; 
     252            ep_lib::MPI_Send(buffer.start(),registrySize,EP_CHAR,firstPoolGlobalRank,15,CXios::globalComm) ; 
    241253          } 
    242254        } 
     
    245257        if (rankGlobal == firstPoolGlobalRank) 
    246258        { 
    247           MPI_Status status; 
     259          ep_lib::MPI_Status status; 
    248260          char* recvBuff; 
    249261 
     
    254266            int rank = secondaryServerGlobalRanks[i]; 
    255267            int registrySize = 0; 
    256             MPI_Recv(&registrySize, 1, MPI_LONG, rank, 15, CXios::globalComm, &status); 
     268            ep_lib::MPI_Recv(&registrySize, 1, EP_LONG, rank, 15, CXios::globalComm, &status); 
    257269            recvBuff = new char[registrySize]; 
    258             MPI_Recv(recvBuff, registrySize, MPI_CHAR, rank, 15, CXios::globalComm, &status); 
     270            ep_lib::MPI_Recv(recvBuff, registrySize, EP_CHAR, rank, 15, CXios::globalComm, &status); 
    259271            CBufferIn buffer(recvBuff, registrySize) ; 
    260272            CRegistry recvRegistry; 
Note: See TracChangeset for help on using the changeset viewer.