Ignore:
Timestamp:
05/31/18 16:32:39 (3 years ago)
Author:
yushan
Message:

save dev

File:
1 edited

Legend:

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

    r1511 r1515  
    2424 
    2525    MPI_Barrier(local_comm); 
     26 
     27    int leader_ranks_in_peer[3];  // local_leader_rank_in_peer 
     28                                  // remote_leader_rank_in_peer 
     29                                  // size of peer 
     30 
     31    if(ep_rank == local_leader) 
     32    { 
     33      MPI_Comm_rank(peer_comm, &leader_ranks_in_peer[0]); 
     34      leader_ranks_in_peer[1] = remote_leader; 
     35      MPI_Comm_size(peer_comm, &leader_ranks_in_peer[2]); 
     36    } 
     37 
     38    MPI_Bcast(leader_ranks_in_peer, 3, MPI_INT, local_leader, local_comm); 
     39 
     40    if(leader_ranks_in_peer[0] != leader_ranks_in_peer[2]) 
     41    { 
     42      Debug("calling MPI_Intercomm_create_kernel\n"); 
     43      return MPI_Intercomm_create_kernel(local_comm, local_leader, peer_comm, remote_leader, tag, newintercomm); 
     44    } 
     45 
     46    else 
     47    { 
     48      if(leader_ranks_in_peer[2] == 1) 
     49      { 
     50        Debug("calling MPI_Intercomm_create_unique\n"); 
     51        return MPI_Intercomm_create_unique_leader(local_comm, local_leader, peer_comm, remote_leader, tag, newintercomm);  
     52         
     53      } 
     54      else 
     55      { 
     56        Debug("calling MPI_Intercomm_create_world\n"); 
     57        return MPI_Intercomm_create_from_world(local_comm, local_leader, peer_comm, remote_leader, tag, newintercomm);    
     58      } 
     59       
     60    } 
     61 
     62 
    2663 
    2764 
     
    174211    } 
    175212 
    176     if(ep_rank == local_leader) printf("calling MPI_Intercomm_create_kernel\n"); 
    177  
    178     return MPI_Intercomm_create_kernel(local_comm, local_leader, peer_comm, remote_leader, tag, newintercomm); 
     213     
    179214 
    180215  } 
Note: See TracChangeset for help on using the changeset viewer.