Ignore:
Timestamp:
05/28/18 09:54:32 (6 years ago)
Author:
yushan
Message:

save dev

File:
1 edited

Legend:

Unmodified
Added
Removed
  • XIOS/dev/branch_openmp/extern/ep_dev/ep_intercomm.cpp

    r1499 r1500  
    1010  int MPI_Intercomm_create(MPI_Comm local_comm, int local_leader, MPI_Comm peer_comm, int remote_leader, int tag, MPI_Comm *newintercomm) 
    1111  { 
    12     assert(local_comm.is_ep); 
     12    assert(local_comm->is_ep); 
    1313 
    1414    int ep_rank, ep_rank_loc, mpi_rank; 
    1515    int ep_size, num_ep, mpi_size; 
    1616 
    17     ep_rank = local_comm.ep_comm_ptr->size_rank_info[0].first; 
    18     ep_rank_loc = local_comm.ep_comm_ptr->size_rank_info[1].first; 
    19     mpi_rank = local_comm.ep_comm_ptr->size_rank_info[2].first; 
    20     ep_size = local_comm.ep_comm_ptr->size_rank_info[0].second; 
    21     num_ep = local_comm.ep_comm_ptr->size_rank_info[1].second; 
    22     mpi_size = local_comm.ep_comm_ptr->size_rank_info[2].second; 
     17    ep_rank = local_comm->ep_comm_ptr->size_rank_info[0].first; 
     18    ep_rank_loc = local_comm->ep_comm_ptr->size_rank_info[1].first; 
     19    mpi_rank = local_comm->ep_comm_ptr->size_rank_info[2].first; 
     20    ep_size = local_comm->ep_comm_ptr->size_rank_info[0].second; 
     21    num_ep = local_comm->ep_comm_ptr->size_rank_info[1].second; 
     22    mpi_size = local_comm->ep_comm_ptr->size_rank_info[2].second; 
    2323 
    2424 
     
    6262      { 
    6363        if(ep_rank == local_leader) Debug("calling MPI_Intercomm_create_unique_leader\n"); 
    64         local_comm.ep_comm_ptr->comm_label = -99; 
     64        local_comm->ep_comm_ptr->comm_label = -99; 
    6565 
    6666        return MPI_Intercomm_create_unique_leader(local_comm, local_leader, peer_comm, remote_leader, tag, newintercomm); 
     
    7777            // change leader 
    7878            is_decider = true; 
    79             int target = local_comm.rank_map->at(local_leader).second; 
     79            int target = local_comm->rank_map->at(local_leader).second; 
    8080            { 
    8181              for(int i=0; i<ep_size; i++) 
    8282              { 
    83                 if(local_comm.rank_map->at(i).second != target && local_comm.rank_map->at(i).first == 0) 
     83                if(local_comm->rank_map->at(i).second != target && local_comm->rank_map->at(i).first == 0) 
    8484                { 
    8585                  new_local_leader = i; 
     
    100100            // change leader 
    101101            is_decider = true; 
    102             int target = local_comm.rank_map->at(local_leader).second; 
     102            int target = local_comm->rank_map->at(local_leader).second; 
    103103            { 
    104104              for(int i=0; i<ep_size; i++) 
    105105              { 
    106                 if(local_comm.rank_map->at(i).second != target && local_comm.rank_map->at(i).first == 0) 
     106                if(local_comm->rank_map->at(i).second != target && local_comm->rank_map->at(i).first == 0) 
    107107                { 
    108108                  new_local_leader = i; 
     
    146146        if(ep_rank == new_local_leader) 
    147147        { 
    148           ::MPI_Comm_rank(to_mpi_comm(MPI_COMM_WORLD.mpi_comm), &leader_in_world[0]); 
     148          ::MPI_Comm_rank(to_mpi_comm(MPI_COMM_WORLD->mpi_comm), &leader_in_world[0]); 
    149149        } 
    150150 
     
    165165        MPI_Bcast(&leader_in_world[1], 1, MPI_INT, local_leader, local_comm); 
    166166 
    167         local_comm.ep_comm_ptr->comm_label = tag; 
     167        local_comm->ep_comm_ptr->comm_label = tag; 
    168168 
    169169        if(ep_rank == local_leader) Debug("calling MPI_Intercomm_create_from_world\n"); 
    170170 
    171         return MPI_Intercomm_create_from_world(local_comm, new_local_leader, MPI_COMM_WORLD.mpi_comm, leader_in_world[1], new_tag_in_world, newintercomm); 
     171        return MPI_Intercomm_create_from_world(local_comm, new_local_leader, MPI_COMM_WORLD->mpi_comm, leader_in_world[1], new_tag_in_world, newintercomm); 
    172172         
    173173      } 
     
    183183  { 
    184184    *flag = false; 
    185     if(comm.is_ep) 
    186     { 
    187       *flag = comm.is_intercomm; 
     185    if(comm->is_ep) 
     186    { 
     187      *flag = comm->is_intercomm; 
    188188      return 0; 
    189189    }  
    190     else if(comm.mpi_comm != static_cast< ::MPI_Comm*>(MPI_COMM_NULL.mpi_comm)) 
    191     { 
    192       ::MPI_Comm mpi_comm = to_mpi_comm(comm.mpi_comm); 
     190    else if(comm->mpi_comm != static_cast< ::MPI_Comm*>(MPI_COMM_NULL->mpi_comm)) 
     191    { 
     192      ::MPI_Comm mpi_comm = to_mpi_comm(comm->mpi_comm); 
    193193       
    194194      ::MPI_Comm_test_inter(mpi_comm, flag); 
Note: See TracChangeset for help on using the changeset viewer.