Changeset 1356


Ignore:
Timestamp:
12/05/17 17:40:02 (3 years ago)
Author:
yushan
Message:

unify MPI_Comm type

Location:
XIOS/dev/branch_openmp
Files:
11 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_openmp/extern/src_ep_dev/ep_create.cpp

    r1355 r1356  
    179179   
    180180   
    181   int MPI_Comm_create_endpoints(int* base_comm_ptr, int num_ep, MPI_Info info, MPI_Comm *& out_comm_hdls) 
     181  int MPI_Comm_create_endpoints(void* base_comm_ptr, int num_ep, MPI_Info info, MPI_Comm *& out_comm_hdls) 
    182182  { 
    183183 
     
    200200      out_comm_hdls[idx].is_intercomm = false; 
    201201      out_comm_hdls[idx].ep_comm_ptr = new ep_communicator;      
    202       *(out_comm_hdls[idx].mpi_comm) = *base_comm_ptr; 
     202      *(static_cast< ::MPI_Comm*>(out_comm_hdls[idx].mpi_comm)) = *(static_cast< ::MPI_Comm*>(base_comm_ptr)); 
    203203      out_comm_hdls[idx].ep_comm_ptr->comm_list = out_comm_hdls; 
    204204      out_comm_hdls[idx].ep_comm_ptr->comm_label = 0; 
  • XIOS/dev/branch_openmp/extern/src_ep_dev/ep_free.cpp

    r1354 r1356  
    8080 
    8181      } 
     82 
    8283      return 0; 
    8384    } 
     
    142143      } 
    143144 
    144       // if(comm->ep_comm_ptr->intercomm->mpi_inter_comm != MPI_COMM_NULL_STD) 
    145       // { 
    146          // ::MPI_Comm mpi_comm = static_cast< ::MPI_Comm>(comm->ep_comm_ptr->comm_list->ep_comm_ptr->intercomm->mpi_inter_comm); 
    147          // ::MPI_Comm_free(&mpi_comm); 
    148       //   Debug("mpi_intercomm freed\n"); 
    149       // } 
     145      if(comm->ep_comm_ptr->intercomm->mpi_inter_comm != static_cast< ::MPI_Comm*>(MPI_COMM_NULL.mpi_comm)) 
     146      { 
     147        ::MPI_Comm mpi_comm = to_mpi_comm(comm->ep_comm_ptr->comm_list->ep_comm_ptr->intercomm->mpi_inter_comm); 
     148        ::MPI_Comm_free(&mpi_comm); 
     149        Debug("mpi_intercomm freed\n"); 
     150      } 
    150151 
    151152     if(comm != NULL) {delete[] comm->ep_comm_ptr->comm_list; Debug("comm freed\n");} 
    152153 
    153154    } 
     155 
     156     
    154157     
    155158    return 0; 
  • XIOS/dev/branch_openmp/extern/src_ep_dev/ep_intercomm_world.cpp

    r1355 r1356  
    538538 
    539539  // #elif _intelmpi 
    540   int MPI_Intercomm_create_from_world(MPI_Comm local_comm, int local_leader, int* peer_comm_ptr, int mpi_remote_leader, int tag, MPI_Comm *newintercomm) 
     540  int MPI_Intercomm_create_from_world(MPI_Comm local_comm, int local_leader, void* peer_comm_ptr, int mpi_remote_leader, int tag, MPI_Comm *newintercomm) 
    541541  { 
    542542    int ep_rank, ep_rank_loc, mpi_rank; 
  • XIOS/dev/branch_openmp/extern/src_ep_dev/ep_lib.cpp

    r1355 r1356  
    246246} 
    247247 
    248 MPI_Comm to_mpi_comm(int* comm) 
     248MPI_Comm to_mpi_comm(void* comm) 
    249249{ 
    250   return static_cast< MPI_Comm >(*comm); 
     250  return *(static_cast< MPI_Comm* >(comm)); 
    251251 
    252252 
  • XIOS/dev/branch_openmp/extern/src_ep_dev/ep_lib.hpp

    r1355 r1356  
    4949  // #endif 
    5050   
    51   int MPI_Comm_create_endpoints(int* base_comm_ptr, int num_ep, MPI_Info info, MPI_Comm *& out_comm_hdls); // from EP to create endpoints 
     51  int MPI_Comm_create_endpoints(void* base_comm_ptr, int num_ep, MPI_Info info, MPI_Comm *& out_comm_hdls); // from EP to create endpoints 
    5252 
    5353  int MPI_Send(void *buf, int count, MPI_Datatype datatype, int dest, int tag, MPI_Comm comm); 
  • XIOS/dev/branch_openmp/extern/src_ep_dev/ep_lib_intercomm.hpp

    r1355 r1356  
    4141  // #endif 
    4242 
    43   int MPI_Intercomm_create_from_world(MPI_Comm local_comm, int local_leader, int* peer_comm_ptr, int mpi_remote_leader, int tag, MPI_Comm *newintercomm); 
     43  int MPI_Intercomm_create_from_world(MPI_Comm local_comm, int local_leader, void* peer_comm_ptr, int mpi_remote_leader, int tag, MPI_Comm *newintercomm); 
    4444   
    4545  int MPI_Intercomm_create_unique_leader(MPI_Comm local_comm, int local_leader, MPI_Comm peer_comm, int remote_leader, int tag, MPI_Comm *newintercomm); 
  • XIOS/dev/branch_openmp/extern/src_ep_dev/ep_mpi.hpp

    r1355 r1356  
    66MPI_Datatype to_mpi_type(ep_lib::MPI_Datatype type); 
    77MPI_Op       to_mpi_op(ep_lib::MPI_Op op); 
    8 MPI_Comm     to_mpi_comm(int* comm); 
     8MPI_Comm     to_mpi_comm(void* comm); 
    99 
    1010#endif // EP_MPI_HPP_INCLUDED 
  • XIOS/dev/branch_openmp/extern/src_ep_dev/ep_type.hpp

    r1355 r1356  
    134134    public: 
    135135 
    136     int *mpi_inter_comm; 
     136    void *mpi_inter_comm; 
    137137 
    138138    RANK_MAP *intercomm_rank_map; 
     
    148148 
    149149    ep_intercomm(); 
     150    //~ep_intercomm(){delete mpi_inter_comm;} 
    150151    bool operator == (ep_intercomm right); 
    151152    bool operator != (ep_intercomm right); 
     
    197198    OMPbarrier *ep_barrier; 
    198199    RANK_MAP   *rank_map; 
    199     int* mpi_comm; 
     200    void* mpi_comm; 
    200201    EP_Comm ep_comm_ptr; 
    201202    MPI_Comm *mem_bridge; 
     
    203204 
    204205    MPI_Comm();   
    205     //MPI_Comm(const MPI_Comm &comm); 
    206     MPI_Comm(int* comm); 
     206    MPI_Comm(void* comm); 
     207    //~MPI_Comm(){delete mpi_comm;} 
    207208 
    208209 
  • XIOS/dev/branch_openmp/src/context_client.cpp

    r1355 r1356  
    2727      intraComm = intraComm_; 
    2828      interComm = interComm_; 
    29       *(intraComm.mpi_comm) = *(intraComm_.mpi_comm); 
    30       *(interComm.mpi_comm) = *(interComm_.mpi_comm); 
    31       *(interComm.ep_comm_ptr->intercomm->mpi_inter_comm) = *(interComm_.ep_comm_ptr->intercomm->mpi_inter_comm); 
     29      *(static_cast< ::MPI_Comm* >(intraComm.mpi_comm)) = *(static_cast< ::MPI_Comm* >(intraComm_.mpi_comm)); 
     30      *(static_cast< ::MPI_Comm* >(interComm.mpi_comm)) = *(static_cast< ::MPI_Comm* >(interComm_.mpi_comm)); 
     31      *(static_cast< ::MPI_Comm* >(interComm.ep_comm_ptr->intercomm->mpi_inter_comm)) = *(static_cast< ::MPI_Comm* >(interComm_.ep_comm_ptr->intercomm->mpi_inter_comm)); 
    3232      //MPI_Comm_dup(intraComm_, &intraComm); 
    3333      //MPI_Comm_dup(interComm_, &interComm); 
  • XIOS/dev/branch_openmp/src/io/inetcdf4.cpp

    r1355 r1356  
    2323    // even if Parallel NetCDF ends up being used. 
    2424    if (mpi) 
    25       CNetCdfInterface::openPar(filename, NC_NOWRITE | NC_MPIIO, static_cast<MPI_Comm>(*(comm->mpi_comm)), info_null.mpi_info, this->ncidp); 
     25      CNetCdfInterface::openPar(filename, NC_NOWRITE | NC_MPIIO, *(static_cast<MPI_Comm*>(comm->mpi_comm)), info_null.mpi_info, this->ncidp); 
    2626      //CNetCdfInterface::openPar(filename, NC_NOWRITE | NC_MPIIO, *(static_cast<MPI_Comm*>(comm->mpi_comm)), info_null.mpi_info, this->ncidp); 
    2727    else 
  • XIOS/dev/branch_openmp/src/io/onetcdf4.cpp

    r1355 r1356  
    5858            CTimer::get("Files : create").resume(); 
    5959            if (wmpi) 
    60                CNetCdfInterface::createPar(filename, mode, static_cast<MPI_Comm>(*(comm->mpi_comm)), info_null.mpi_info, this->ncidp); 
     60               CNetCdfInterface::createPar(filename, mode, *(static_cast<MPI_Comm*>(comm->mpi_comm)), info_null.mpi_info, this->ncidp); 
    6161               //CNetCdfInterface::createPar(filename, mode, *(static_cast<MPI_Comm*>(comm->mpi_comm)), info_null.mpi_info, this->ncidp); 
    6262            else 
     
    7171            CTimer::get("Files : open").resume(); 
    7272            if (wmpi) 
    73                CNetCdfInterface::openPar(filename, mode, static_cast<MPI_Comm>(*(comm->mpi_comm)), info_null.mpi_info, this->ncidp); 
     73               CNetCdfInterface::openPar(filename, mode, *(static_cast<MPI_Comm*>(comm->mpi_comm)), info_null.mpi_info, this->ncidp); 
    7474               //CNetCdfInterface::openPar(filename, mode, *(static_cast<MPI_Comm*>(comm->mpi_comm)), info_null.mpi_info, this->ncidp); 
    7575            else 
Note: See TracChangeset for help on using the changeset viewer.