Changeset 1373


Ignore:
Timestamp:
12/13/17 14:42:26 (4 years ago)
Author:
yushan
Message:

unify type : MPI_Request

Location:
XIOS/dev/branch_openmp
Files:
8 edited

Legend:

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

    r1369 r1373  
    100100ep_lib::MPI_Comm MPI_COMM_NULL(&MPI_COMM_NULL_STD); 
    101101 
    102 ep_lib::MPI_Request MPI_REQUEST_NULL(MPI_REQUEST_NULL_STD); 
     102ep_lib::MPI_Request MPI_REQUEST_NULL(&MPI_REQUEST_NULL_STD); 
    103103ep_lib::MPI_Info MPI_INFO_NULL(&MPI_INFO_NULL_STD); 
    104104 
  • XIOS/dev/branch_openmp/extern/src_ep_dev/ep_recv.cpp

    r1362 r1373  
    6161      ::MPI_Irecv(buf, count, to_mpi_type(datatype), src<0? MPI_ANY_SOURCE : src, tag<0? MPI_ANY_TAG: tag, to_mpi_comm(comm.mpi_comm), &mpi_request); 
    6262 
    63       request->mpi_request = mpi_request; 
     63      request->mpi_request = new ::MPI_Request(mpi_request); 
    6464      request->ep_src = src; 
    6565      request->ep_datatype = datatype; 
     
    6767    } 
    6868 
    69     request->mpi_request = MPI_REQUEST_NULL.mpi_request; 
    7069    request->buf = buf; 
    7170    request->comm = comm; 
     
    106105    //::MPI_Imrecv(buf, count, to_mpi_type(datatype), &mpi_message, &mpi_request); 
    107106 
    108     request->mpi_request = mpi_request; 
     107    request->mpi_request = new ::MPI_Request(mpi_request); 
    109108    request->ep_datatype = datatype; 
    110109    request->ep_tag = message->ep_tag; 
  • XIOS/dev/branch_openmp/extern/src_ep_dev/ep_send.cpp

    r1328 r1373  
    7474      ::MPI_Isend(buf, count, to_mpi_type(datatype), dest, tag, to_mpi_comm(comm.mpi_comm), &mpi_request); 
    7575 
    76       request->mpi_request = mpi_request; 
     76      request->mpi_request = new ::MPI_Request(mpi_request); 
    7777 
    7878      request->ep_src = src_rank; 
     
    104104    ::MPI_Isend(buf, count, to_mpi_type(datatype), mpi_dest, mpi_tag, to_mpi_comm(comm.mpi_comm), &mpi_request); 
    105105 
    106     request->mpi_request = mpi_request; 
     106    request->mpi_request = new ::MPI_Request(mpi_request); 
    107107    request->type = 1;    // used in wait 
    108108    request->comm = comm; 
     
    131131      ::MPI_Issend(buf, count, to_mpi_type(datatype), dest, tag, to_mpi_comm(comm.mpi_comm), &mpi_request); 
    132132 
    133       request->mpi_request = mpi_request; 
     133      request->mpi_request = new ::MPI_Request(mpi_request); 
    134134      request->ep_src = src_rank; 
    135135      request->ep_tag = tag; 
     
    160160    ::MPI_Issend(buf, count, to_mpi_type(datatype), mpi_dest, mpi_tag, to_mpi_comm(comm.mpi_comm), &mpi_request); 
    161161 
    162     request->mpi_request = mpi_request; 
     162    request->mpi_request = new ::MPI_Request(mpi_request); 
    163163    request->type = 1;    // used in wait 
    164164    request->comm = comm; 
     
    206206      ::MPI_Isend(buf, count, to_mpi_type(datatype), mpi_dest, mpi_tag, to_mpi_comm(comm.mpi_comm), &mpi_request); 
    207207 
    208       request->mpi_request = mpi_request; 
     208      request->mpi_request = new ::MPI_Request(mpi_request); 
    209209      request->type = 1;    // used in wait 
    210210      request->comm = comm; 
     
    227227      ::MPI_Isend(buf, count, to_mpi_type(datatype), mpi_dest, mpi_tag, to_mpi_comm(comm.ep_comm_ptr->intercomm->mpi_inter_comm), &mpi_request); 
    228228 
    229       request->mpi_request = mpi_request; 
     229      request->mpi_request = new ::MPI_Request(mpi_request); 
    230230      request->type = 1;    // used in wait 
    231231      request->comm = comm; 
     
    277277      ::MPI_Issend(buf, count, to_mpi_type(datatype), mpi_dest, mpi_tag, to_mpi_comm(comm.mpi_comm), &mpi_request); 
    278278 
    279       request->mpi_request = mpi_request; 
     279      request->mpi_request = new ::MPI_Request(mpi_request); 
    280280      request->type = 1;    // used in wait 
    281281      request->comm = comm; 
     
    298298      ::MPI_Issend(buf, count, to_mpi_type(datatype), mpi_dest, mpi_tag, to_mpi_comm(comm.ep_comm_ptr->intercomm->mpi_inter_comm), &mpi_request); 
    299299 
    300       request->mpi_request = mpi_request; 
     300      request->mpi_request = new ::MPI_Request(mpi_request); 
    301301      request->type = 1;    // used in wait 
    302302      request->comm = comm; 
  • XIOS/dev/branch_openmp/extern/src_ep_dev/ep_test.cpp

    r1295 r1373  
    2525    { 
    2626      ::MPI_Status mpi_status; 
    27       ::MPI_Test(&(request->mpi_request), flag, &mpi_status); 
     27      ::MPI_Test((request->mpi_request), flag, &mpi_status); 
    2828       
    2929      if(*flag)  
     
    5050      ::MPI_Status mpi_status; 
    5151       
    52       ::MPI_Test(&(request->mpi_request), flag, &mpi_status); 
     52      ::MPI_Test((request->mpi_request), flag, &mpi_status); 
    5353       
    5454       
  • XIOS/dev/branch_openmp/extern/src_ep_dev/ep_type.cpp

    r1369 r1373  
    6767  } 
    6868   
     69  MPI_Request::MPI_Request(int* request) 
     70  { 
     71    //mpi_request = request; 
     72    mpi_request = new int; 
     73    *mpi_request = *request; 
     74  } 
     75   
    6976//  MPI_Request::MPI_Request(void* request) 
    7077//  { 
    71 //    mpi_request = new ::MPI_Request; 
    72 //    *(static_cast< ::MPI_Request*>(mpi_request)) = *(static_cast< ::MPI_Request*>(request)); 
     78//    //mpi_request = request; 
     79//    mpi_request = new int; 
     80//    static_cast< ::MPI_Request>(*mpi_request) = *(static_cast< ::MPI_Request*>(request); 
    7381//  } 
     82   
     83  MPI_Request::MPI_Request() 
     84  { 
     85    //mpi_request = request; 
     86    mpi_request = new int; 
     87    //*(static_cast< ::MPI_Request*>(mpi_request)) = *(static_cast< ::MPI_Request*>(request)); 
     88  } 
     89   
    7490  MPI_Aint::MPI_Aint(void* aint) 
    7591  { 
  • XIOS/dev/branch_openmp/extern/src_ep_dev/ep_type.hpp

    r1369 r1373  
    230230    public: 
    231231 
    232       int mpi_request; 
     232      int* mpi_request; 
    233233 
    234234      int type; //! type of the non-blocking communication. 1: Isend; 2:Irecv; 3:Imrecv; 4:Issend 
     
    241241      MPI_Comm comm;    //! EP communicator related to the communication 
    242242 
    243       MPI_Request() {} 
    244       MPI_Request(int request):mpi_request(request) {} 
     243      MPI_Request(); 
     244      MPI_Request(int* request); 
    245245      bool operator == (MPI_Request right); 
    246246 
  • XIOS/dev/branch_openmp/extern/src_ep_dev/ep_wait.cpp

    r1362 r1373  
    3434    //::MPI_Request mpi_request = static_cast< ::MPI_Request >(request->mpi_request); 
    3535    ::MPI_Status mpi_status; 
    36     ::MPI_Wait(&(request->mpi_request), &mpi_status); 
     36    ::MPI_Wait((request->mpi_request), &mpi_status); 
    3737 
    3838    
     
    8080        { 
    8181          finished.at(i) = 1; 
    82           mpi_request[i] = static_cast< ::MPI_Request >(array_of_requests[i].mpi_request); 
     82          //mpi_request[i] = static_cast< ::MPI_Request >(array_of_requests[i].mpi_request); 
     83          mpi_request[i] = *(array_of_requests[i].mpi_request); 
    8384        } 
    8485      }     
     
    8990    for(int i=0; i<count; i++) 
    9091    { 
    91       array_of_statuses[i].mpi_status = &mpi_status; 
     92      array_of_statuses[i].mpi_status = &mpi_status[i]; 
    9293      array_of_statuses[i].ep_src = array_of_requests[i].ep_src; 
    9394      array_of_statuses[i].ep_tag = array_of_requests[i].ep_tag; 
  • XIOS/dev/branch_openmp/src/client_client_dht_template_impl.hpp

    r1328 r1373  
    827827  std::vector<ep_lib::MPI_Request> request(sendBuffSize+recvBuffSize); 
    828828  std::vector<ep_lib::MPI_Status> requestStatus(sendBuffSize+recvBuffSize); 
    829  
    830829  int nRequest = 0; 
    831830  for (int idx = 0; idx < recvBuffSize; ++idx) 
    832831  { 
    833832    ep_lib::MPI_Irecv(&recvBuff[0]+2*idx, 2, MPI_INT, 
    834               recvRank[idx], MPI_DHT_INDEX_0, this->internalComm_, &request[nRequest]); 
    835     ++nRequest; 
     833              recvRank[idx], MPI_DHT_INDEX_0, this->internalComm_, &request[nRequest++]); 
    836834  } 
    837835 
     
    846844  { 
    847845    ep_lib::MPI_Isend(&sendBuff[idx*2], 2, MPI_INT, 
    848               sendRank[idx], MPI_DHT_INDEX_0, this->internalComm_, &request[nRequest]); 
    849     ++nRequest; 
     846              sendRank[idx], MPI_DHT_INDEX_0, this->internalComm_, &request[nRequest++]); 
    850847  } 
    851848 
Note: See TracChangeset for help on using the changeset viewer.