Ignore:
Timestamp:
03/08/17 16:55:00 (7 years ago)
Author:
yushan
Message:

server mode OK tested with test_complete

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_yushan/extern/src_ep_dev/ep_dup.cpp

    r1063 r1067  
    55namespace ep_lib 
    66{ 
    7  
    8  
    9  
    10   int MPI_Comm_dup_dev(MPI_Comm comm, MPI_Comm *newcomm) 
    11   { 
    12     if(!comm.is_ep) 
    13     { 
    14       Debug("Comm_dup MPI\n"); 
    15       newcomm = new MPI_Comm; 
    16       newcomm->is_ep = comm.is_ep; 
    17  
    18       ::MPI_Comm input = static_cast< ::MPI_Comm>(comm.mpi_comm); 
    19       ::MPI_Comm output; 
    20  
    21        
    22       ::MPI_Comm_dup(input, &output); 
    23  
    24       newcomm->mpi_comm = output; 
    25  
    26       return 0; 
    27     } 
    28  
    29     if(!comm.mpi_comm) return 0; 
    30  
    31  
    32     int my_rank = comm.ep_comm_ptr->size_rank_info[1].first; 
    33     int num_ep  = comm.ep_comm_ptr->size_rank_info[1].second; 
    34  
    35  
    36     if(0 == my_rank) 
    37     { 
    38       MPI_Info info; 
    39       ::MPI_Comm mpi_dup; 
    40  
    41       ::MPI_Comm in_comm = static_cast< ::MPI_Comm>(comm.mpi_comm); 
    42  
    43       ::MPI_Comm_dup(in_comm, &mpi_dup); 
    44  
    45       MPI_Comm_create_endpoints(mpi_dup, num_ep, info, newcomm); 
    46       comm.ep_comm_ptr->comm_list->mem_bridge = newcomm; 
    47     } 
    48  
    49     MPI_Barrier_local(comm); 
    50  
    51     newcomm = &(comm.ep_comm_ptr->comm_list->mem_bridge[my_rank]); 
    52  
    53     return MPI_SUCCESS; 
    54   } 
    55  
    56  
    577 
    588  int MPI_Comm_dup(MPI_Comm comm, MPI_Comm *newcomm) 
Note: See TracChangeset for help on using the changeset viewer.