Changeset 1506 for XIOS/dev/branch_openmp
- Timestamp:
- 05/29/18 13:12:21 (6 years ago)
- Location:
- XIOS/dev/branch_openmp/extern/ep_dev
- Files:
-
- 2 edited
Legend:
- Unmodified
- Added
- Removed
-
XIOS/dev/branch_openmp/extern/ep_dev/ep_split.cpp
r1504 r1506 131 131 MPI_Allgather(&key, 1, MPI_INT, all_key.data(),1, MPI_INT, comm); 132 132 MPI_Allgather_local(&key, 1, MPI_INT, all_key_loc.data(), comm); 133 134 vector<int> all_ep_rank(ep_size); 135 vector<int> all_ep_rank_loc(num_ep); 136 137 vector<int> colored_ep_rank[num_color]; 138 vector<int> colored_ep_rank_loc[num_color]; 139 140 MPI_Allgather(&ep_rank, 1, MPI_INT, all_ep_rank.data(),1, MPI_INT, comm); 141 MPI_Allgather_local(&ep_rank, 1, MPI_INT, all_ep_rank_loc.data(), comm); 133 142 134 143 for(int i=0; i<num_ep; i++) … … 139 148 { 140 149 colored_key_loc[j].push_back(all_key_loc[i]); 150 colored_ep_rank_loc[j].push_back(all_ep_rank_loc[i]); 141 151 } 142 152 } … … 150 160 { 151 161 colored_key[j].push_back(all_key[i]); 152 } 153 } 154 } 162 colored_ep_rank[j].push_back(all_ep_rank[i]); 163 } 164 } 165 } 166 167 int my_offset=0; 168 for(int i=0; i<colored_key[number_of_color].size(); i++) 169 { 170 if(key == colored_key[number_of_color][i]) 171 { 172 if(ep_rank != colored_ep_rank[number_of_color][i]) 173 { 174 my_offset++; 175 } 176 else 177 break; 178 } 179 } 180 181 int my_offset_loc=0; 182 for(int i=0; i<colored_key_loc[number_of_color].size(); i++) 183 { 184 if(key == colored_key_loc[number_of_color][i]) 185 { 186 if(ep_rank != colored_ep_rank_loc[number_of_color][i]) 187 { 188 my_offset_loc++; 189 } 190 else 191 break; 192 } 193 } 194 195 155 196 156 197 for(int i=0; i<num_color; i++) … … 166 207 if(key == colored_key[number_of_color][i]) 167 208 { 168 new_ep_rank = i ;209 new_ep_rank = i+my_offset; 169 210 break; 170 211 } … … 177 218 if(key == colored_key_loc[number_of_color][i]) 178 219 { 179 new_ep_rank_loc = i ;220 new_ep_rank_loc = i+my_offset_loc; 180 221 break; 181 222 } … … 272 313 } 273 314 } 274 275 /*for(int i=0; i<ep_size; i++) 315 316 #ifdef _Memory_check 317 for(int i=0; i<ep_size; i++) 276 318 { 277 319 MPI_Barrier(comm); … … 288 330 MPI_Barrier(comm); 289 331 MPI_Barrier(comm); 290 }*/ 332 } 333 #endif 291 334 292 335 return 0; -
XIOS/dev/branch_openmp/extern/ep_dev/main.cpp
r1504 r1506 686 686 MPI_Comm_size(comm, &size); 687 687 688 //int color = rank%2; 689 int tab_color[16]={2,2,2,3,0,1,1,3,2,1,3,0,0,2,0,0}; 690 int tab_key[16]={3,11,10,5,6,8,15,7,2,1,9,13,4,14,12,0}; 688 //int tab_color[16]={2,2,2,3,0,1,1,3,2,1,3,0,0,2,0,0}; // OK 689 //int tab_key[16]={3,11,10,5,6,8,15,7,2,1,9,13,4,14,12,0}; // OK 690 691 692 int tab_color[16]={2,2,1,1,1,1,0,1,1,1,0,1,1,1,2,0}; 693 //int tab_key[16]={3,11,12,4,6,15,10,5,2,8,14,7,13,9,1,0}; 694 int tab_key[16]={3,11,7,7,6,15,10,5,2,8,14,7,13,9,1,0}; 695 691 696 int color = tab_color[rank]; 692 697 int key = tab_key[rank]; … … 700 705 MPI_Comm_rank(split_comm, &split_rank); 701 706 702 printf("rank = %d, color = %d, key = %d, split_rank = %d \n", rank, color, key, split_rank);707 printf("rank = %d, color = %d, key = %d, split_rank = %d, local_rank=%d\n", rank, color, key, split_rank, split_comm->ep_comm_ptr->size_rank_info[1].first); 703 708 704 709
Note: See TracChangeset
for help on using the changeset viewer.