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

save dev

File:
1 edited

Legend:

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

    r1512 r1515  
    3333  int get_ep_rank(MPI_Comm comm, int ep_rank_loc, int mpi_rank) 
    3434  { 
    35     for(int i=0; i<comm->ep_rank_map->size(); i++) 
    36     { 
    37       if(   ( comm->ep_rank_map->at(i).first  == ep_rank_loc ) 
    38          && ( comm->ep_rank_map->at(i).second == mpi_rank ) ) 
     35    for(std::map<int, std::pair<int, int> >::iterator it = comm->ep_rank_map->begin(); it != comm->ep_rank_map->end(); it++) 
     36    { 
     37      if(   ( it->second.first  == ep_rank_loc ) 
     38         && ( it->second.second == mpi_rank ) ) 
    3939      { 
    40         return i; 
     40        return it->first; 
    4141      } 
    4242    } 
     
    4444  } 
    4545   
    46   int get_ep_rank_intercomm(MPI_Comm comm, int ep_rank_loc, int mpi_rank) 
    47   { 
    48     // intercomm 
    49     int inter_rank; 
    50     for(int i=0; i<comm->ep_comm_ptr->intercomm->intercomm_rank_map->size(); i++) 
    51     { 
    52       if(   ( comm->ep_comm_ptr->intercomm->inter_rank_map->at(i).first  == ep_rank_loc ) 
    53          && ( comm->ep_comm_ptr->intercomm->inter_rank_map->at(i).second == mpi_rank ) ) 
    54       { 
    55         inter_rank =  i; 
    56         break; 
    57       } 
    58     } 
    59  
    60     for(int i=0; i<comm->ep_comm_ptr->intercomm->remote_rank_map->size(); i++) 
    61     { 
    62       if(  comm->ep_comm_ptr->intercomm->remote_rank_map->at(i).first  == inter_rank  ) 
    63       { 
    64         //printf("get_ep_rank for intercomm, ep_rank_loc = %d, mpi_rank = %d => ep_src = %d\n", ep_rank_loc, mpi_rank, i); 
    65         return i; 
    66       } 
    67     } 
    68  
    69     printf("rank not find\n"); 
    70      
    71   } 
    72  
    7346 
    7447  int MPI_Get_count(const MPI_Status *status, MPI_Datatype datatype, int *count) 
Note: See TracChangeset for help on using the changeset viewer.