Ignore:
Timestamp:
02/27/17 14:19:19 (7 years ago)
Author:
yushan
Message:

server mode OK for both multiple and one file mode. Tested with test_client

File:
1 edited

Legend:

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

    r1037 r1063  
    11#include "ep_lib.hpp" 
    22#include <mpi.h> 
    3 //#include "ep_declaration.hpp" 
     3#include "ep_declaration.hpp" 
    44 
    55namespace ep_lib 
    66{ 
    77 
    8  
    9  
    108  int MPI_Barrier(MPI_Comm comm) 
    119  { 
     10    if(comm.is_intercomm) return MPI_Barrier_intercomm(comm); 
    1211 
    1312    if(comm.is_ep) 
     
    2019      { 
    2120        ::MPI_Comm mpi_comm = static_cast< ::MPI_Comm > (comm.mpi_comm); 
     21 
    2222        ::MPI_Barrier(mpi_comm); 
    2323      } 
     
    2727      return 0; 
    2828    } 
    29     else if(comm.mpi_comm !=0 ) 
     29    else if(comm.mpi_comm != MPI_COMM_NULL_STD ) 
    3030    { 
    3131      ::MPI_Comm mpi_comm = static_cast< ::MPI_Comm> (comm.mpi_comm); 
     
    3737  } 
    3838 
     39 
     40  int MPI_Barrier_intercomm(MPI_Comm comm) 
     41  { 
     42 
     43    int ep_rank_loc = comm.ep_comm_ptr->size_rank_info[1].first; 
     44 
     45    MPI_Barrier_local(comm); 
     46 
     47    if(ep_rank_loc == 0) 
     48    { 
     49      ::MPI_Comm mpi_comm = static_cast< ::MPI_Comm > (comm.ep_comm_ptr->intercomm->mpi_inter_comm); 
     50      ::MPI_Barrier(mpi_comm); 
     51    } 
     52 
     53    MPI_Barrier_local(comm); 
     54 
     55    return 0; 
     56 
     57  } 
     58 
     59 
    3960  int MPI_Barrier_local(MPI_Comm comm) 
    4061  { 
    41     //Message_Check(comm); 
     62    Message_Check(comm); 
    4263    comm.ep_barrier->wait(); 
    4364  } 
Note: See TracChangeset for help on using the changeset viewer.