Ignore:
Timestamp:
12/06/17 15:22:17 (4 years ago)
Author:
yushan
Message:

unify type : MPI_Message MPI_Info

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

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_openmp/extern/remap/src/mpi_routing.cpp

    r1328 r1362  
    152152        { 
    153153                #ifdef _usingEP 
    154                 MPI_Irecv(&sourceRank[i], 1, MPI_INT, -2, 0, communicator, &request[indexRequest]); 
     154                MPI_Irecv(&sourceRank[i], 1, MPI_INT, -2, 0, communicator, &request[indexRequest++]); 
    155155                #else 
    156                 MPI_Irecv(&sourceRank[i], 1, MPI_INT, MPI_ANY_SOURCE, 0, communicator, &request[indexRequest]); 
     156                MPI_Irecv(&sourceRank[i], 1, MPI_INT, MPI_ANY_SOURCE, 0, communicator, &request[indexRequest++]); 
    157157                #endif 
    158                 indexRequest++; 
    159         } 
    160         MPI_Barrier(communicator); 
    161         for (int i = 0; i < nbTarget; i++) 
    162         { 
    163                 MPI_Isend(&mpiRank, 1, MPI_INT, targetRank[i], 0, communicator, &request[indexRequest]); 
    164                 indexRequest++; 
     158        } 
     159        MPI_Barrier(communicator); 
     160        for (int i = 0; i < nbTarget; i++) 
     161        { 
     162                MPI_Isend(&mpiRank, 1, MPI_INT, targetRank[i], 0, communicator, &request[indexRequest++]); 
    165163        } 
    166164        MPI_Waitall(indexRequest, request, status); 
  • XIOS/dev/branch_openmp/extern/src_ep_dev/ep_declaration.cpp

    r1354 r1362  
    103103 
    104104ep_lib::MPI_Request MPI_REQUEST_NULL(MPI_REQUEST_NULL_STD); 
    105 ep_lib::MPI_Info MPI_INFO_NULL(MPI_INFO_NULL_STD); 
     105ep_lib::MPI_Info MPI_INFO_NULL(&MPI_INFO_NULL_STD); 
    106106 
    107107 
  • XIOS/dev/branch_openmp/extern/src_ep_dev/ep_lib.cpp

    r1356 r1362  
    251251 
    252252 
    253  
    254  
    255  
    256  
    257  
     253MPI_Message to_mpi_message(void* message) 
     254{ 
     255  return *(static_cast< MPI_Message* >(message)); 
     256} 
     257 
     258MPI_Info to_mpi_info(void* info) 
     259{ 
     260  return *(static_cast< MPI_Info* >(info)); 
     261} 
     262 
     263 
     264 
     265 
     266 
  • XIOS/dev/branch_openmp/extern/src_ep_dev/ep_memory.cpp

    r1287 r1362  
    1010  int MPI_Alloc_mem(MPI_Aint size, MPI_Info info, void *baseptr) 
    1111  { 
    12     ::MPI_Alloc_mem(size.mpi_aint, static_cast< ::MPI_Info>(info.mpi_info), baseptr); 
     12    ::MPI_Alloc_mem(size.mpi_aint, *(static_cast< ::MPI_Info*>(info.mpi_info)), baseptr); 
    1313    //::MPI_Alloc_mem(size.mpi_aint, MPI_INFO_NULL_STD, baseptr); 
    1414    return 0; 
     
    1717  int MPI_Alloc_mem(unsigned long size, MPI_Info info, void *baseptr) 
    1818  { 
    19     ::MPI_Alloc_mem(size, static_cast< ::MPI_Info>(info.mpi_info), baseptr); 
     19    ::MPI_Alloc_mem(size, *(static_cast< ::MPI_Info*>(info.mpi_info)), baseptr); 
    2020    //::MPI_Alloc_mem(size, MPI_INFO_NULL_STD, baseptr); 
    2121    return 0; 
  • XIOS/dev/branch_openmp/extern/src_ep_dev/ep_message.cpp

    r1355 r1362  
    6969 
    7070        MPI_Message *msg_block = new MPI_Message;  
    71         msg_block->mpi_message = message;   
     71        msg_block->mpi_message = new ::MPI_Message; 
     72        *(static_cast< ::MPI_Message*>(msg_block->mpi_message)) = message;   
    7273        msg_block->ep_tag = bitset<15>(status.MPI_TAG >> 16).to_ulong();  
    7374        int src_loc       = bitset<8> (status.MPI_TAG >> 8) .to_ulong();  
     
    135136 
    136137        MPI_Message *msg_block = new MPI_Message; 
    137  
    138         msg_block->mpi_message = message; 
     138        msg_block->mpi_message = new ::MPI_Message; 
     139        *(static_cast< ::MPI_Message*>(msg_block->mpi_message)) = message; 
    139140        msg_block->ep_tag = bitset<15>(status.MPI_TAG >> 16).to_ulong(); 
    140141        int src_loc       = bitset<8> (status.MPI_TAG >> 8) .to_ulong(); 
     
    188189 
    189190        MPI_Message *msg_block = new MPI_Message; 
    190         
    191         msg_block->mpi_message = message; 
     191        msg_block->mpi_message = new ::MPI_Message; 
     192        *(static_cast< ::MPI_Message*>(msg_block->mpi_message)) = message; 
    192193        msg_block->ep_tag = bitset<15>(status.MPI_TAG >> 16).to_ulong(); 
    193194        int src_loc       = bitset<8> (status.MPI_TAG >> 8) .to_ulong(); 
  • XIOS/dev/branch_openmp/extern/src_ep_dev/ep_mpi.hpp

    r1356 r1362  
    77MPI_Op       to_mpi_op(ep_lib::MPI_Op op); 
    88MPI_Comm     to_mpi_comm(void* comm); 
     9MPI_Message  to_mpi_message(void* message); 
     10MPI_Info     to_mpi_info(void* info); 
    911 
    1012#endif // EP_MPI_HPP_INCLUDED 
  • XIOS/dev/branch_openmp/extern/src_ep_dev/ep_probe.cpp

    r1295 r1362  
    8585      status->ep_tag = tag; 
    8686 
    87       message->mpi_message = mpi_message; 
     87      message->mpi_message = new ::MPI_Message; 
     88      *(static_cast< ::MPI_Message*>(message->mpi_message)) = mpi_message; 
    8889      message->ep_src = src; 
    8990      message->ep_tag = tag; 
  • XIOS/dev/branch_openmp/extern/src_ep_dev/ep_recv.cpp

    r1295 r1362  
    8989    EP_PendingRequests->push_back(request); 
    9090 
     91 
    9192    Request_Check(); 
    9293 
     
    101102 
    102103    ::MPI_Request mpi_request; 
    103     ::MPI_Message mpi_message = static_cast< ::MPI_Message >(message->mpi_message); 
    104                  
    105     ::MPI_Imrecv(buf, count, to_mpi_type(datatype), &mpi_message, &mpi_request); 
     104    //::MPI_Message mpi_message = *(static_cast< ::MPI_Message* >(message->mpi_message)); 
     105    ::MPI_Imrecv(buf, count, to_mpi_type(datatype), static_cast< ::MPI_Message* >(message->mpi_message), &mpi_request);          
     106    //::MPI_Imrecv(buf, count, to_mpi_type(datatype), &mpi_message, &mpi_request); 
    106107 
    107108    request->mpi_request = mpi_request; 
     
    109110    request->ep_tag = message->ep_tag; 
    110111    request->ep_src = message->ep_src; 
     112     
     113    delete message->mpi_message; 
    111114 
    112115    return 0; 
     
    119122 
    120123    ::MPI_Status mpi_status; 
    121     ::MPI_Message mpi_message = static_cast< ::MPI_Message >(message->mpi_message); 
    122      
    123     ::MPI_Mrecv(buf, count, to_mpi_type(datatype), &mpi_message, &mpi_status); 
     124    //::MPI_Message mpi_message = *(static_cast< ::MPI_Message* >(message->mpi_message)); 
     125    ::MPI_Mrecv(buf, count, to_mpi_type(datatype), static_cast< ::MPI_Message* >(message->mpi_message), &mpi_status); 
     126    //::MPI_Mrecv(buf, count, to_mpi_type(datatype), &mpi_message, &mpi_status); 
    124127 
    125128    status->mpi_status = new ::MPI_Status(mpi_status); 
     
    127130    status->ep_datatype = datatype; 
    128131    status->ep_tag = message->ep_tag; 
     132 
     133    delete message->mpi_message; 
    129134 
    130135    //check_sum_recv(buf, count, datatype, message->ep_src, message->ep_tag); 
  • XIOS/dev/branch_openmp/extern/src_ep_dev/ep_type.cpp

    r1359 r1362  
    4848    intercomm = NULL; 
    4949  } 
     50 
     51  MPI_Message::MPI_Message(void* message) 
     52  { 
     53    mpi_message = new ::MPI_Message; 
     54    *(static_cast< ::MPI_Message*>(mpi_message)) = *(static_cast< ::MPI_Message*>(message)); 
     55  } 
     56 
     57  MPI_Info::MPI_Info(void* info) 
     58  { 
     59    mpi_info = new ::MPI_Info; 
     60    *(static_cast< ::MPI_Info*>(mpi_info)) = *(static_cast< ::MPI_Info*>(info)); 
     61  } 
     62   
     63//  MPI_Request::MPI_Request(void* request) 
     64//  { 
     65//    mpi_request = new ::MPI_Request; 
     66//    *(static_cast< ::MPI_Request*>(mpi_request)) = *(static_cast< ::MPI_Request*>(request)); 
     67//  } 
    5068 
    5169 
  • XIOS/dev/branch_openmp/extern/src_ep_dev/ep_type.hpp

    r1356 r1362  
    6767    public: 
    6868 
    69       int mpi_message; 
     69      void* mpi_message; 
    7070      int ep_src; 
    7171      int ep_tag; 
     
    7373 
    7474      MPI_Message() {} 
    75       MPI_Message(int message): mpi_message(message) {} 
     75      MPI_Message(void* message); 
    7676  }; 
    7777 
     
    201201    EP_Comm ep_comm_ptr; 
    202202    MPI_Comm *mem_bridge; 
    203     int* mpi_bridge; 
     203    void* mpi_bridge; 
    204204 
    205205    MPI_Comm();   
     
    219219    public: 
    220220 
    221       int mpi_info; 
     221      void* mpi_info; 
    222222 
    223223      MPI_Info(){ } 
    224       MPI_Info(int info): mpi_info(info) {} 
     224      MPI_Info(void* info); 
    225225  }; 
    226226 
     
    242242 
    243243      MPI_Request() {} 
    244       MPI_Request(int request): mpi_request(request) {} 
     244      MPI_Request(int request):mpi_request(request) {} 
    245245      bool operator == (MPI_Request right); 
    246246 
  • XIOS/dev/branch_openmp/extern/src_ep_dev/ep_wait.cpp

    r1295 r1362  
    3535    ::MPI_Status mpi_status; 
    3636    ::MPI_Wait(&(request->mpi_request), &mpi_status); 
    37        
     37 
     38    
     39            
     40  
    3841    // request->mpi_request = mpi_request; 
    3942 
     
    4245    status->ep_tag = request->ep_tag; 
    4346    status->ep_datatype = request->ep_datatype; 
     47     
     48 
    4449 
    4550    return MPI_SUCCESS; 
     
    9398    delete[] mpi_status; 
    9499     
     100     
    95101    return MPI_SUCCESS; 
    96102  }  /* end of mpi_waitall*/ 
Note: See TracChangeset for help on using the changeset viewer.