Ignore:
Timestamp:
06/04/18 19:25:08 (6 years ago)
Author:
yushan
Message:

save dev. TO DO : test with xios

Location:
XIOS/dev/branch_openmp/src
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_openmp/src/buffer_client.cpp

    r1460 r1520  
    1515  size_t CClientBuffer::maxRequestSize = 0; 
    1616 
    17   CClientBuffer::CClientBuffer(MPI_Comm in_interComm, int serverRank, StdSize bufferSize, StdSize estimatedMaxEventSize, StdSize maxBufferedEvents):  
    18     //interComm(interComm) 
    19     serverRank(serverRank) 
     17  CClientBuffer::CClientBuffer(MPI_Comm interComm, int serverRank, StdSize bufferSize, StdSize estimatedMaxEventSize, StdSize maxBufferedEvents):  
     18    interComm(interComm) 
     19    , serverRank(serverRank) 
    2020    , bufferSize(bufferSize) 
    2121    , estimatedMaxEventSize(estimatedMaxEventSize) 
     
    2727    , pending(false) 
    2828  { 
    29     interComm = in_interComm; 
    30     *(static_cast< ::MPI_Comm*>(interComm.mpi_comm)) = *(static_cast< ::MPI_Comm*>(in_interComm.mpi_comm)); 
    31     *(static_cast< ::MPI_Comm*>(interComm.ep_comm_ptr->intercomm->mpi_inter_comm)) = *(static_cast< ::MPI_Comm*>(in_interComm.ep_comm_ptr->intercomm->mpi_inter_comm)); 
    3229    buffer[0] = new char[bufferSize]; // transform it with MPI_ALLOC_MEM later 
    3330    buffer[1] = new char[bufferSize]; 
  • XIOS/dev/branch_openmp/src/context_client.cpp

    r1482 r1520  
    2828      intraComm = intraComm_; 
    2929      interComm = interComm_; 
    30       *(static_cast< ::MPI_Comm* >(intraComm.mpi_comm)) = *(static_cast< ::MPI_Comm* >(intraComm_.mpi_comm)); 
    31       *(static_cast< ::MPI_Comm* >(interComm.mpi_comm)) = *(static_cast< ::MPI_Comm* >(interComm_.mpi_comm)); 
    32       *(static_cast< ::MPI_Comm* >(interComm.ep_comm_ptr->intercomm->mpi_inter_comm)) = *(static_cast< ::MPI_Comm* >(interComm_.ep_comm_ptr->intercomm->mpi_inter_comm)); 
    33       //MPI_Comm_dup(intraComm_, &intraComm); 
    34       //MPI_Comm_dup(interComm_, &interComm); 
    3530      MPI_Comm_rank(intraComm, &clientRank); 
    3631      MPI_Comm_size(intraComm, &clientSize); 
  • XIOS/dev/branch_openmp/src/context_server.cpp

    r1460 r1520  
    126126    { 
    127127       StdSize buffSize = 0; 
    128        MPI_Recv(&buffSize, 1, MPI_LONG, rank, 20, interComm, &status); 
     128       MPI_Request request; 
     129       MPI_Irecv(&buffSize, 1, MPI_LONG, rank, 20, interComm, &request); 
     130       MPI_Wait(&request, &status); 
     131       //MPI_Recv(&buffSize, 1, MPI_LONG, rank, 20, interComm, &status); 
    129132       mapBufferSize_.insert(std::make_pair(rank, buffSize)); 
    130133       it=(buffers.insert(pair<int,CServerBuffer*>(rank,new CServerBuffer(buffSize)))).first; 
  • XIOS/dev/branch_openmp/src/cxios.cpp

    r1460 r1520  
    106106    { 
    107107      MPI_Comm *ep_comm; 
    108       MPI_Comm_create_endpoints(MPI_COMM_WORLD.mpi_comm, num_ep, info, ep_comm);  // servers should reach here too. 
     108      MPI_Comm_create_endpoints(MPI_COMM_WORLD->mpi_comm, num_ep, info, ep_comm);  // servers should reach here too. 
    109109      passage = ep_comm;   
    110110    } 
  • XIOS/dev/branch_openmp/src/event_scheduler.cpp

    r1460 r1520  
    140140      if (received) 
    141141      { 
     142        printf("probed a message coming from parent\n"), 
    142143        recvRequest=new SPendingRequest ; 
    143144        MPI_Irecv(recvRequest->buffer, 3, MPI_UNSIGNED_LONG, -2, 1, communicator, &(recvRequest->request)) ; 
  • XIOS/dev/branch_openmp/src/io/inetcdf4.cpp

    r1491 r1520  
    22#include "netCdfInterface.hpp" 
    33#include "netCdf_cf_constant.hpp" 
    4  
     4#include "ep_mpi.hpp" 
    55#include <boost/algorithm/string.hpp> 
    66 
     
    2626    // even if Parallel NetCDF ends up being used. 
    2727    if (mpi) 
    28       CNetCdfInterface::openPar(filename, NC_NOWRITE | NC_MPIIO, *(static_cast<MPI_Comm*>(comm->mpi_comm)), *(static_cast<MPI_Info*>(info_null.mpi_info)), this->ncidp); 
    29       //CNetCdfInterface::openPar(filename, NC_NOWRITE | NC_MPIIO, *(static_cast<MPI_Comm*>(comm->mpi_comm)), info_null.mpi_info, this->ncidp); 
     28      CNetCdfInterface::openPar(filename, NC_NOWRITE | NC_MPIIO, to_mpi_comm((*comm)->mpi_comm), to_mpi_info(info_null), this->ncidp); 
    3029    else 
    3130      CNetCdfInterface::open(filename, NC_NOWRITE, this->ncidp); 
  • XIOS/dev/branch_openmp/src/io/netCdfInterface.cpp

    r1460 r1520  
    1010#include "netCdfInterface.hpp" 
    1111#include "netCdfException.hpp" 
    12  
     12#include "ep_mpi.hpp" 
    1313namespace xios 
    1414{ 
     
    4949int CNetCdfInterface::createPar(const StdString& fileName, int cMode, MPI_Comm comm, MPI_Info info, int& ncId) 
    5050{ 
    51   //int status = xios::nc_create_par(fileName.c_str(), cMode, comm, MPI_INFO_NULL.mpi_info, &ncId); 
    52   int status = xios::nc_create_par(fileName.c_str(), cMode, comm, *(static_cast< MPI_Info* >(MPI_INFO_NULL.mpi_info)), &ncId); 
     51  int status = xios::nc_create_par(fileName.c_str(), cMode, comm, to_mpi_info(MPI_INFO_NULL), &ncId); 
    5352  if (NC_NOERR != status) 
    5453  { 
     
    105104  int status; 
    106105  #pragma omp critical (_netcdf) 
    107   status = xios::nc_open_par(fileName.c_str(), oMode, comm, *(static_cast< MPI_Info* >(MPI_INFO_NULL.mpi_info)), &ncId); 
     106  status = xios::nc_open_par(fileName.c_str(), oMode, comm, to_mpi_info(MPI_INFO_NULL), &ncId); 
    108107   
    109108  if (NC_NOERR != status) 
  • XIOS/dev/branch_openmp/src/io/onetcdf4.cpp

    r1460 r1520  
    33#include "onetcdf4.hpp" 
    44#include "group_template.hpp" 
    5 //#include "mpi.hpp" 
     5#include "ep_mpi.hpp" 
    66#include "netcdf.hpp" 
    77#include "netCdfInterface.hpp" 
     
    5959            CTimer::get("Files : create").resume(); 
    6060            if (wmpi) 
    61                CNetCdfInterface::createPar(filename, mode, *(static_cast<MPI_Comm*>(comm->mpi_comm)), *(static_cast<MPI_Info*>(info_null.mpi_info)), this->ncidp); 
    62                //CNetCdfInterface::createPar(filename, mode, *(static_cast<MPI_Comm*>(comm->mpi_comm)), info_null.mpi_info, this->ncidp); 
     61               CNetCdfInterface::createPar(filename, mode, to_mpi_comm((*comm)->mpi_comm), to_mpi_info(info_null), this->ncidp); 
    6362            else 
    6463               CNetCdfInterface::create(filename, mode, this->ncidp); 
     
    7271            CTimer::get("Files : open").resume(); 
    7372            if (wmpi) 
    74                CNetCdfInterface::openPar(filename, mode, *(static_cast<MPI_Comm*>(comm->mpi_comm)), *(static_cast<MPI_Info*>(info_null.mpi_info)), this->ncidp); 
    75                //CNetCdfInterface::openPar(filename, mode, *(static_cast<MPI_Comm*>(comm->mpi_comm)), info_null.mpi_info, this->ncidp); 
     73               CNetCdfInterface::openPar(filename, mode, to_mpi_comm((*comm)->mpi_comm), to_mpi_info(info_null), this->ncidp); 
    7674            else 
    7775               CNetCdfInterface::open(filename, mode, this->ncidp); 
  • XIOS/dev/branch_openmp/src/server.cpp

    r1469 r1520  
    654654       if (flag==true) 
    655655       { 
     656         int my_count; 
    656657         counts.push_back(0); 
    657658         MPI_Get_count(&status,MPI_CHAR,&(counts.back())) ; 
  • XIOS/dev/branch_openmp/src/test/test_complete_omp.f90

    r1176 r1520  
    248248!#################################################################################### 
    249249 
    250     DO ts=1,24*2 
    251     !DO ts=1,24 
     250    !DO ts=1,24*2 
     251    DO ts=1,24 
    252252 
    253253      CALL xios_get_handle("atmosphere",ctx_hdl) 
  • XIOS/dev/branch_openmp/src/transformation/domain_algorithm_interpolate.cpp

    r1482 r1520  
    406406  CContext* context = CContext::getCurrent(); 
    407407  CContextClient* client=context->client; 
    408   int mykey; 
    409   ep_lib::MPI_Comm_rank(client->intraComm, &mykey); 
    410  
    411   ep_lib::MPI_Comm poleComme; 
    412   //ep_lib::MPI_Comm_split(client->intraComm, interMapValuePole.empty() ? 0 : 1, 0, &poleComme); 
    413   ep_lib::MPI_Comm_split(client->intraComm, interMapValuePole.empty() ? 0 : 1, mykey, &poleComme); 
    414   if (!poleComme.is_null()) 
     408  //int mykey; 
     409  //ep_lib::MPI_Comm_rank(client->intraComm, &mykey); 
     410 
     411  ep_lib::MPI_Comm poleComme = MPI_COMM_NULL; 
     412  ep_lib::MPI_Comm_split(client->intraComm, interMapValuePole.empty() ? 0 : 1, 0, &poleComme); 
     413  //ep_lib::MPI_Comm_split(client->intraComm, interMapValuePole.empty() ? 0 : 1, mykey, &poleComme); 
     414  //if (!poleComme.is_null()) 
     415  if (poleComme!=MPI_COMM_NULL) 
    415416  { 
    416417    int nbClientPole; 
Note: See TracChangeset for help on using the changeset viewer.