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

save dev. TO DO : test with xios

File:
1 edited

Legend:

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

    r1374 r1520  
    1111namespace ep_lib 
    1212{  
    13    
    14   ep_intercomm::ep_intercomm() 
     13  ep_comm::ep_comm(void* comm) 
    1514  { 
    16     intercomm_rank_map = NULL; 
    17     local_rank_map = NULL; 
    18     remote_rank_map = NULL; 
    19     mpi_inter_comm = new ::MPI_Comm; 
     15    is_ep = false; 
     16    is_intercomm = false; 
     17    mpi_comm = static_cast< ::MPI_Comm*>(comm); 
    2018  } 
    2119 
    22   bool ep_intercomm::operator == (ep_intercomm right) 
     20  ep_info::ep_info(void* info) 
    2321  { 
    24     bool a = intercomm_rank_map == right.intercomm_rank_map; 
    25     bool b = local_rank_map == right.local_rank_map; 
    26     bool c = remote_rank_map == right.remote_rank_map; 
    27     bool d = *(static_cast< ::MPI_Comm*>(mpi_inter_comm)) == *(static_cast< ::MPI_Comm*>(right.mpi_inter_comm)); 
    28     bool e = size_rank_info == right.size_rank_info; 
    29     bool f = intercomm_tag == right.intercomm_tag; 
    30     return a&&b&&c&&d&&e&&f; 
     22    mpi_info = static_cast< ::MPI_Info*>(info); 
    3123  } 
    3224 
    33   bool ep_intercomm::operator != (ep_intercomm right) 
     25  ep_request::ep_request(void* request) 
    3426  { 
    35     bool a = intercomm_rank_map != right.intercomm_rank_map; 
    36     bool b = local_rank_map != right.local_rank_map; 
    37     bool c = remote_rank_map != right.remote_rank_map; 
    38     bool d = *(static_cast< ::MPI_Comm*>(mpi_inter_comm)) != *(static_cast< ::MPI_Comm*>(right.mpi_inter_comm)); 
    39     bool e = size_rank_info != right.size_rank_info; 
    40     bool f = intercomm_tag != right.intercomm_tag; 
    41     return a||b||c||d||e||f; 
     27    mpi_request = static_cast< ::MPI_Request*>(request); 
     28  } 
     29   
     30  ep_status::ep_status(void* status) 
     31  { 
     32    mpi_status = static_cast< ::MPI_Status*>(status); 
    4233  } 
    4334 
    44   ep_communicator::ep_communicator() 
    45   { 
    46     comm_list = NULL; 
    47     message_queue = NULL; 
    48     intercomm = NULL; 
    49   } 
    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_Info::MPI_Info() 
    64   { 
    65     mpi_info = new ::MPI_Info; 
    66     *(static_cast< ::MPI_Info*>(mpi_info)) = *(static_cast< ::MPI_Info*>(MPI_INFO_NULL.mpi_info)); 
    67   } 
    68    
    69   MPI_Request::MPI_Request(void* request) 
    70   { 
    71     mpi_request = new ::MPI_Request; 
    72     *(static_cast< ::MPI_Request*>(mpi_request)) = *static_cast< ::MPI_Request*>(request); 
    73   } 
     35  /* 
    7436   
    7537  MPI_Aint::MPI_Aint(void* aint) 
     
    7739    mpi_aint = new ::MPI_Aint; 
    7840    *(static_cast< ::MPI_Aint*>(mpi_aint)) = *(static_cast< ::MPI_Aint*>(aint)); 
     41  } 
     42 
     43  MPI_Aint::MPI_Aint(int aint) 
     44  { 
     45    mpi_aint = new ::MPI_Aint; 
     46    *(static_cast< ::MPI_Aint*>(mpi_aint)) = aint; 
     47  } 
     48 
     49  MPI_Aint MPI_Aint::operator=(int a) 
     50  { 
     51    mpi_aint = new ::MPI_Aint; 
     52    *(static_cast< int*>(mpi_aint)) = a;  
    7953  } 
    8054   
     
    8559  } 
    8660 
    87   bool ep_communicator::operator == (ep_communicator right) 
    88   { 
    89     bool a = size_rank_info == right.size_rank_info; 
    90     bool b = comm_label == right.comm_label; 
    91     bool c = intercomm == right.intercomm; 
    92     return a&&b&&c; 
    93   } 
    94  
    95   bool ep_communicator::operator != (ep_communicator right) 
    96   { 
    97     bool a = size_rank_info != right.size_rank_info; 
    98     bool b = comm_label != right.comm_label; 
    99     bool c = intercomm != right.intercomm; 
    100     return a||b||c; 
    101   } 
    102  
    103   MPI_Comm::MPI_Comm() 
    104   { 
    105     is_ep = true; 
    106     is_intercomm = false; 
    107     my_buffer = NULL; 
    108     ep_barrier = NULL; 
    109     rank_map = NULL; 
    110     ep_comm_ptr = NULL; 
    111     mem_bridge = NULL; 
    112     mpi_bridge = NULL; 
    113     mpi_comm = new ::MPI_Comm; 
    114   } 
    115  
    11661   
    117  
    118   MPI_Comm::MPI_Comm(void* comm) 
    119   { 
    120     is_ep = false; 
    121     is_intercomm = false; 
    122     my_buffer = NULL; 
    123     ep_barrier = NULL; 
    124     rank_map = NULL; 
    125     ep_comm_ptr = NULL; 
    126     mem_bridge = NULL; 
    127     mpi_bridge = NULL; 
    128     mpi_comm = new ::MPI_Comm; 
    129     *(static_cast< ::MPI_Comm*>(mpi_comm)) = *(static_cast< ::MPI_Comm*>(comm)); 
    130   } 
    131  
     62*/ 
    13263   
    133  
    134   bool MPI_Comm::operator == (MPI_Comm right) 
    135   { 
    136     bool a = is_ep == right.is_ep; 
    137     bool b = is_intercomm == right.is_intercomm; 
    138     bool c = *(static_cast< ::MPI_Comm*>(mpi_comm)) == *(static_cast< ::MPI_Comm*>(right.mpi_comm)); 
    139     bool d = is_ep ? ep_comm_ptr == right.ep_comm_ptr : true; 
    140     return a&&b&&c&&d; 
    141   } 
    142  
    143   bool MPI_Comm::operator != (MPI_Comm right) 
    144   { 
    145     bool a = is_ep != right.is_ep; 
    146     bool b = is_intercomm != right.is_intercomm; 
    147     bool c = *(static_cast< ::MPI_Comm*>(mpi_comm)) != *(static_cast< ::MPI_Comm*>(right.mpi_comm)); 
    148     bool d = is_ep ? ep_comm_ptr != right.ep_comm_ptr : true; 
    149     return a||b||c||d; 
    150   } 
    151  
    152   bool MPI_Request::operator == (MPI_Request right) 
    153   { 
    154     bool b = type == right.type; 
    155     bool c = buf == right.buf; 
    156     bool d = ep_src == right.ep_src; 
    157     bool e = ep_tag == right.ep_tag; 
    158     bool f = ep_datatype == right.ep_datatype; 
    159     return b&&c&&d&&e&&f; 
    160   } 
    16164 
    16265 
Note: See TracChangeset for help on using the changeset viewer.