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

save dev

File:
1 edited

Legend:

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

    r1499 r1500  
    1414    int ep_size, num_ep, mpi_size; 
    1515 
    16     ep_rank = local_comm.ep_comm_ptr->size_rank_info[0].first; 
    17     ep_rank_loc = local_comm.ep_comm_ptr->size_rank_info[1].first; 
    18     mpi_rank = local_comm.ep_comm_ptr->size_rank_info[2].first; 
    19     ep_size = local_comm.ep_comm_ptr->size_rank_info[0].second; 
    20     num_ep = local_comm.ep_comm_ptr->size_rank_info[1].second; 
    21     mpi_size = local_comm.ep_comm_ptr->size_rank_info[2].second; 
     16    ep_rank = local_comm->ep_comm_ptr->size_rank_info[0].first; 
     17    ep_rank_loc = local_comm->ep_comm_ptr->size_rank_info[1].first; 
     18    mpi_rank = local_comm->ep_comm_ptr->size_rank_info[2].first; 
     19    ep_size = local_comm->ep_comm_ptr->size_rank_info[0].second; 
     20    num_ep = local_comm->ep_comm_ptr->size_rank_info[1].second; 
     21    mpi_size = local_comm->ep_comm_ptr->size_rank_info[2].second; 
    2222 
    2323    std::vector<int> rank_info[4];  //! 0->rank_in_world of local_comm,  1->rank_in_local_parent of local_comm 
     
    3333 
    3434 
    35     ::MPI_Comm local_mpi_comm = to_mpi_comm(local_comm.mpi_comm); 
     35    ::MPI_Comm local_mpi_comm = to_mpi_comm(local_comm->mpi_comm); 
    3636 
    3737     
    38     ::MPI_Comm_rank(to_mpi_comm(MPI_COMM_WORLD.mpi_comm), &rank_in_world); 
     38    ::MPI_Comm_rank(to_mpi_comm(MPI_COMM_WORLD->mpi_comm), &rank_in_world); 
    3939    ::MPI_Comm_rank(local_mpi_comm, &rank_in_local_parent); 
    4040     
     
    4646 
    4747    if(ep_rank == local_leader) { is_proc_master = true; is_local_leader = true; is_final_master = true;} 
    48     if(ep_rank_loc == 0 && mpi_rank != local_comm.rank_map->at(local_leader).second) is_proc_master = true; 
     48    if(ep_rank_loc == 0 && mpi_rank != local_comm->rank_map->at(local_leader).second) is_proc_master = true; 
    4949 
    5050 
     
    9494        leader_info[1] = remote_leader; 
    9595 
    96         ::MPI_Comm_rank(to_mpi_comm(peer_comm.mpi_comm), &rank_in_peer_mpi[0]); 
     96        ::MPI_Comm_rank(to_mpi_comm(peer_comm->mpi_comm), &rank_in_peer_mpi[0]); 
    9797 
    9898        send_buf[0] = size_info[0]; 
     
    125125      send_buf[4] = rank_in_peer_mpi[1]; 
    126126 
    127       ::MPI_Bcast(send_buf.data(), 5, to_mpi_type(MPI_INT), local_comm.rank_map->at(local_leader).second, local_mpi_comm); 
     127      ::MPI_Bcast(send_buf.data(), 5, to_mpi_type(MPI_INT), local_comm->rank_map->at(local_leader).second, local_mpi_comm); 
    128128 
    129129      size_info[1] = send_buf[0]; 
     
    157157      } 
    158158 
    159       ::MPI_Bcast(recv_buf.data(), 3*size_info[1], to_mpi_type(MPI_INT), local_comm.rank_map->at(local_leader).second, local_mpi_comm); 
     159      ::MPI_Bcast(recv_buf.data(), 3*size_info[1], to_mpi_type(MPI_INT), local_comm->rank_map->at(local_leader).second, local_mpi_comm); 
    160160 
    161161      std::copy ( recv_buf.data(), recv_buf.data() + size_info[1], rank_info[2].begin() ); 
     
    281281      } 
    282282 
    283       ::MPI_Bcast(&size_info[2], 2, to_mpi_type(MPI_INT), local_comm.rank_map->at(local_leader).second, local_mpi_comm); 
     283      ::MPI_Bcast(&size_info[2], 2, to_mpi_type(MPI_INT), local_comm->rank_map->at(local_leader).second, local_mpi_comm); 
    284284 
    285285      new_rank_info[2].resize(size_info[3]); 
     
    305305      } 
    306306 
    307       ::MPI_Bcast(recv_buf.data(),   3*size_info[3], to_mpi_type(MPI_INT), local_comm.rank_map->at(local_leader).second, local_mpi_comm); 
     307      ::MPI_Bcast(recv_buf.data(),   3*size_info[3], to_mpi_type(MPI_INT), local_comm->rank_map->at(local_leader).second, local_mpi_comm); 
    308308 
    309309      std::copy ( recv_buf.data(), recv_buf.data() + size_info[3], new_rank_info[2].begin() ); 
     
    337337      } 
    338338 
    339       ::MPI_Bcast(&leader_info[2], 1, to_mpi_type(MPI_INT), local_comm.rank_map->at(local_leader).second, local_mpi_comm); 
    340  
    341       if(new_comm != static_cast< ::MPI_Comm*>(MPI_COMM_NULL.mpi_comm)) 
     339      ::MPI_Bcast(&leader_info[2], 1, to_mpi_type(MPI_INT), local_comm->rank_map->at(local_leader).second, local_mpi_comm); 
     340 
     341      if(new_comm != static_cast< ::MPI_Comm*>(MPI_COMM_NULL->mpi_comm)) 
    342342      { 
    343343 
    344344        ::MPI_Barrier(*new_comm); 
    345345 
    346         ::MPI_Intercomm_create(*new_comm, leader_info[2], to_mpi_comm(peer_comm.mpi_comm), rank_in_peer_mpi[1], tag, intercomm); 
     346        ::MPI_Intercomm_create(*new_comm, leader_info[2], to_mpi_comm(peer_comm->mpi_comm), rank_in_peer_mpi[1], tag, intercomm); 
    347347 
    348348        int id; 
     
    358358        for(int i= 0; i<my_num_ep; i++) 
    359359        { 
    360           ep_intercomm[i].is_intercomm = true; 
    361  
    362           ep_intercomm[i].ep_comm_ptr->intercomm = new ep_lib::ep_intercomm; 
    363           ep_intercomm[i].ep_comm_ptr->intercomm->mpi_inter_comm = intercomm; 
    364           ep_intercomm[i].ep_comm_ptr->comm_label = leader_info[0]; 
     360          ep_intercomm[i]->is_intercomm = true; 
     361 
     362          ep_intercomm[i]->ep_comm_ptr->intercomm = new ep_lib::ep_intercomm; 
     363          ep_intercomm[i]->ep_comm_ptr->intercomm->mpi_inter_comm = intercomm; 
     364          ep_intercomm[i]->ep_comm_ptr->comm_label = leader_info[0]; 
    365365        } 
    366366 
     
    470470    int intercomm_ep_size, intercomm_num_ep, intercomm_mpi_size; 
    471471 
    472     intercomm_ep_rank = newintercomm->ep_comm_ptr->size_rank_info[0].first; 
    473     intercomm_ep_rank_loc = newintercomm->ep_comm_ptr->size_rank_info[1].first; 
    474     intercomm_mpi_rank = newintercomm->ep_comm_ptr->size_rank_info[2].first; 
    475     intercomm_ep_size = newintercomm->ep_comm_ptr->size_rank_info[0].second; 
    476     intercomm_num_ep = newintercomm->ep_comm_ptr->size_rank_info[1].second; 
    477     intercomm_mpi_size = newintercomm->ep_comm_ptr->size_rank_info[2].second; 
     472    intercomm_ep_rank = (*newintercomm)->ep_comm_ptr->size_rank_info[0].first; 
     473    intercomm_ep_rank_loc = (*newintercomm)->ep_comm_ptr->size_rank_info[1].first; 
     474    intercomm_mpi_rank = (*newintercomm)->ep_comm_ptr->size_rank_info[2].first; 
     475    intercomm_ep_size = (*newintercomm)->ep_comm_ptr->size_rank_info[0].second; 
     476    intercomm_num_ep = (*newintercomm)->ep_comm_ptr->size_rank_info[1].second; 
     477    intercomm_mpi_size = (*newintercomm)->ep_comm_ptr->size_rank_info[2].second; 
    478478 
    479479    MPI_Bcast(&remote_ep_size, 1, MPI_INT, local_leader, local_comm); 
     
    482482 
    483483    my_rank_map_elem[0] = intercomm_ep_rank; 
    484     my_rank_map_elem[1] = (*newintercomm).ep_comm_ptr->comm_label; 
     484    my_rank_map_elem[1] = (*newintercomm)->ep_comm_ptr->comm_label; 
    485485 
    486486    vector<pair<int, int> > local_rank_map_array; 
     
    488488 
    489489 
    490     (*newintercomm).ep_comm_ptr->intercomm->local_rank_map = new RANK_MAP; 
    491     (*newintercomm).ep_comm_ptr->intercomm->local_rank_map->resize(local_ep_size); 
     490    (*newintercomm)->ep_comm_ptr->intercomm->local_rank_map = new RANK_MAP; 
     491    (*newintercomm)->ep_comm_ptr->intercomm->local_rank_map->resize(local_ep_size); 
    492492 
    493493    MPI_Allgather(my_rank_map_elem, 2, MPI_INT,  
    494       (*newintercomm).ep_comm_ptr->intercomm->local_rank_map->data(), 2, MPI_INT, local_comm); 
    495  
    496     (*newintercomm).ep_comm_ptr->intercomm->remote_rank_map = new RANK_MAP; 
    497     (*newintercomm).ep_comm_ptr->intercomm->remote_rank_map->resize(remote_ep_size); 
    498  
    499     (*newintercomm).ep_comm_ptr->intercomm->size_rank_info[0] = local_comm.ep_comm_ptr->size_rank_info[0]; 
    500     (*newintercomm).ep_comm_ptr->intercomm->size_rank_info[1] = local_comm.ep_comm_ptr->size_rank_info[1]; 
    501     (*newintercomm).ep_comm_ptr->intercomm->size_rank_info[2] = local_comm.ep_comm_ptr->size_rank_info[2]; 
     494      (*newintercomm)->ep_comm_ptr->intercomm->local_rank_map->data(), 2, MPI_INT, local_comm); 
     495 
     496    (*newintercomm)->ep_comm_ptr->intercomm->remote_rank_map = new RANK_MAP; 
     497    (*newintercomm)->ep_comm_ptr->intercomm->remote_rank_map->resize(remote_ep_size); 
     498 
     499    (*newintercomm)->ep_comm_ptr->intercomm->size_rank_info[0] = local_comm->ep_comm_ptr->size_rank_info[0]; 
     500    (*newintercomm)->ep_comm_ptr->intercomm->size_rank_info[1] = local_comm->ep_comm_ptr->size_rank_info[1]; 
     501    (*newintercomm)->ep_comm_ptr->intercomm->size_rank_info[2] = local_comm->ep_comm_ptr->size_rank_info[2]; 
    502502 
    503503    int local_intercomm_size = intercomm_ep_size; 
     
    513513      MPI_Status statuses[4]; 
    514514       
    515       MPI_Isend((*newintercomm).ep_comm_ptr->intercomm->local_rank_map->data(), 2*local_ep_size, MPI_INT, remote_leader, tag+4, peer_comm, &requests[0]); 
    516       MPI_Irecv((*newintercomm).ep_comm_ptr->intercomm->remote_rank_map->data(), 2*remote_ep_size, MPI_INT, remote_leader, tag+4, peer_comm, &requests[1]); 
     515      MPI_Isend((*newintercomm)->ep_comm_ptr->intercomm->local_rank_map->data(), 2*local_ep_size, MPI_INT, remote_leader, tag+4, peer_comm, &requests[0]); 
     516      MPI_Irecv((*newintercomm)->ep_comm_ptr->intercomm->remote_rank_map->data(), 2*remote_ep_size, MPI_INT, remote_leader, tag+4, peer_comm, &requests[1]); 
    517517 
    518518      MPI_Isend(&local_intercomm_size, 1, MPI_INT, remote_leader, tag+5, peer_comm, &requests[2]); 
     
    527527 
    528528 
    529     MPI_Bcast((*newintercomm).ep_comm_ptr->intercomm->remote_rank_map->data(), 2*remote_ep_size, MPI_INT, local_leader, local_comm); 
     529    MPI_Bcast((*newintercomm)->ep_comm_ptr->intercomm->remote_rank_map->data(), 2*remote_ep_size, MPI_INT, local_leader, local_comm); 
    530530    MPI_Bcast(&remote_intercomm_size, 1, MPI_INT, new_bcast_root, *newintercomm); 
    531531 
    532532 
    533     (*newintercomm).ep_comm_ptr->intercomm->intercomm_rank_map = new RANK_MAP; 
    534     (*newintercomm).ep_comm_ptr->intercomm->intercomm_rank_map->resize(remote_intercomm_size); 
     533    (*newintercomm)->ep_comm_ptr->intercomm->intercomm_rank_map = new RANK_MAP; 
     534    (*newintercomm)->ep_comm_ptr->intercomm->intercomm_rank_map->resize(remote_intercomm_size); 
    535535 
    536536 
     
    542542      MPI_Status statuses[2]; 
    543543       
    544       MPI_Isend((*newintercomm).rank_map->data(), 2*local_intercomm_size, MPI_INT, remote_leader, tag+6, peer_comm, &requests[0]); 
    545       MPI_Irecv((*newintercomm).ep_comm_ptr->intercomm->intercomm_rank_map->data(), 2*remote_intercomm_size, MPI_INT, remote_leader, tag+6, peer_comm, &requests[1]); 
     544      MPI_Isend((*newintercomm)->rank_map->data(), 2*local_intercomm_size, MPI_INT, remote_leader, tag+6, peer_comm, &requests[0]); 
     545      MPI_Irecv((*newintercomm)->ep_comm_ptr->intercomm->intercomm_rank_map->data(), 2*remote_intercomm_size, MPI_INT, remote_leader, tag+6, peer_comm, &requests[1]); 
    546546       
    547547      MPI_Waitall(2, requests, statuses); 
    548548    } 
    549549 
    550     MPI_Bcast((*newintercomm).ep_comm_ptr->intercomm->intercomm_rank_map->data(), 2*remote_intercomm_size, MPI_INT, new_bcast_root, *newintercomm); 
    551  
    552     (*newintercomm).ep_comm_ptr->intercomm->local_comm = &(local_comm.ep_comm_ptr->comm_list[ep_rank_loc]); 
    553     (*newintercomm).ep_comm_ptr->intercomm->intercomm_tag = tag; 
     550    MPI_Bcast((*newintercomm)->ep_comm_ptr->intercomm->intercomm_rank_map->data(), 2*remote_intercomm_size, MPI_INT, new_bcast_root, *newintercomm); 
     551 
     552    (*newintercomm)->ep_comm_ptr->intercomm->local_comm = (local_comm->ep_comm_ptr->comm_list[ep_rank_loc]); 
     553    (*newintercomm)->ep_comm_ptr->intercomm->intercomm_tag = tag; 
    554554 
    555555/* 
    556556    for(int i=0; i<local_ep_size; i++) 
    557     if(local_comm.ep_comm_ptr->comm_label == 0) printf("ep_rank (from EP) = %d, local_rank_map[%d] = (%d,%d)\n", intercomm_ep_rank, i, 
    558           (*newintercomm).ep_comm_ptr->intercomm->local_rank_map->at(i).first, (*newintercomm).ep_comm_ptr->intercomm->local_rank_map->at(i).second); 
     557    if(local_comm->ep_comm_ptr->comm_label == 0) printf("ep_rank (from EP) = %d, local_rank_map[%d] = (%d,%d)\n", intercomm_ep_rank, i, 
     558          (*newintercomm)->ep_comm_ptr->intercomm->local_rank_map->at(i).first, (*newintercomm)->ep_comm_ptr->intercomm->local_rank_map->at(i).second); 
    559559 
    560560    for(int i=0; i<remote_ep_size; i++) 
    561     if(local_comm.ep_comm_ptr->comm_label == 0) printf("ep_rank (from EP) = %d, remote_rank_map[%d] = (%d,%d)\n", intercomm_ep_rank, i, 
    562           (*newintercomm).ep_comm_ptr->intercomm->remote_rank_map->at(i).first, (*newintercomm).ep_comm_ptr->intercomm->remote_rank_map->at(i).second); 
     561    if(local_comm->ep_comm_ptr->comm_label == 0) printf("ep_rank (from EP) = %d, remote_rank_map[%d] = (%d,%d)\n", intercomm_ep_rank, i, 
     562          (*newintercomm)->ep_comm_ptr->intercomm->remote_rank_map->at(i).first, (*newintercomm)->ep_comm_ptr->intercomm->remote_rank_map->at(i).second); 
    563563 
    564564    for(int i=0; i<remote_intercomm_size; i++) 
    565     if(local_comm.ep_comm_ptr->comm_label == 0) printf("ep_rank (from EP) = %d, intercomm_rank_map[%d] = (%d,%d)\n", intercomm_ep_rank, i, 
    566           (*newintercomm).ep_comm_ptr->intercomm->intercomm_rank_map->at(i).first, (*newintercomm).ep_comm_ptr->intercomm->intercomm_rank_map->at(i).second); 
     565    if(local_comm->ep_comm_ptr->comm_label == 0) printf("ep_rank (from EP) = %d, intercomm_rank_map[%d] = (%d,%d)\n", intercomm_ep_rank, i, 
     566          (*newintercomm)->ep_comm_ptr->intercomm->intercomm_rank_map->at(i).first, (*newintercomm)->ep_comm_ptr->intercomm->intercomm_rank_map->at(i).second); 
    567567*/ 
    568568 
    569 //    for(int i=0; i<(*newintercomm).rank_map->size(); i++) 
    570 //    if(local_comm.ep_comm_ptr->comm_label != 99) printf("ep_rank = %d, rank_map[%d] = (%d,%d)\n", intercomm_ep_rank, i, 
    571 //          (*newintercomm).rank_map->at(i).first, (*newintercomm).rank_map->at(i).second); 
     569//    for(int i=0; i<(*newintercomm)->rank_map->size(); i++) 
     570//    if(local_comm->ep_comm_ptr->comm_label != 99) printf("ep_rank = %d, rank_map[%d] = (%d,%d)\n", intercomm_ep_rank, i, 
     571//          (*newintercomm)->rank_map->at(i).first, (*newintercomm)->rank_map->at(i).second); 
    572572 
    573573//    MPI_Comm *test_comm = newintercomm->ep_comm_ptr->intercomm->local_comm; 
     
    593593    int ep_size, num_ep, mpi_size; 
    594594 
    595     ep_rank = local_comm.ep_comm_ptr->size_rank_info[0].first; 
    596     ep_rank_loc = local_comm.ep_comm_ptr->size_rank_info[1].first; 
    597     mpi_rank = local_comm.ep_comm_ptr->size_rank_info[2].first; 
    598     ep_size = local_comm.ep_comm_ptr->size_rank_info[0].second; 
    599     num_ep = local_comm.ep_comm_ptr->size_rank_info[1].second; 
    600     mpi_size = local_comm.ep_comm_ptr->size_rank_info[2].second; 
     595    ep_rank = local_comm->ep_comm_ptr->size_rank_info[0].first; 
     596    ep_rank_loc = local_comm->ep_comm_ptr->size_rank_info[1].first; 
     597    mpi_rank = local_comm->ep_comm_ptr->size_rank_info[2].first; 
     598    ep_size = local_comm->ep_comm_ptr->size_rank_info[0].second; 
     599    num_ep = local_comm->ep_comm_ptr->size_rank_info[1].second; 
     600    mpi_size = local_comm->ep_comm_ptr->size_rank_info[2].second; 
    601601 
    602602 
     
    609609    int rank_in_peer_mpi[2]; 
    610610 
    611     ::MPI_Comm_rank(to_mpi_comm(MPI_COMM_WORLD.mpi_comm), &rank_in_world); 
     611    ::MPI_Comm_rank(to_mpi_comm(MPI_COMM_WORLD->mpi_comm), &rank_in_world); 
    612612 
    613613 
     
    666666        ::MPI_Comm *mpi_dup = new ::MPI_Comm; 
    667667         
    668         ::MPI_Comm_dup(to_mpi_comm(local_comm.mpi_comm), mpi_dup); 
     668        ::MPI_Comm_dup(to_mpi_comm(local_comm->mpi_comm), mpi_dup); 
    669669 
    670670        MPI_Comm *ep_intercomm; 
     
    675675        for(int i=0; i<total_num_ep; i++) 
    676676        { 
    677           ep_intercomm[i].is_intercomm = true; 
    678           ep_intercomm[i].ep_comm_ptr->intercomm = new ep_lib::ep_intercomm; 
    679           ep_intercomm[i].ep_comm_ptr->intercomm->mpi_inter_comm = 0; 
    680  
    681           ep_intercomm[i].ep_comm_ptr->comm_label = leader_rank_in_peer[0]; 
     677          ep_intercomm[i]->is_intercomm = true; 
     678          ep_intercomm[i]->ep_comm_ptr->intercomm = new ep_lib::ep_intercomm; 
     679          ep_intercomm[i]->ep_comm_ptr->intercomm->mpi_inter_comm = 0; 
     680 
     681          ep_intercomm[i]->ep_comm_ptr->comm_label = leader_rank_in_peer[0]; 
    682682        } 
    683683 
     
    751751    int intercomm_ep_size, intercomm_num_ep, intercomm_mpi_size; 
    752752 
    753     intercomm_ep_rank = newintercomm->ep_comm_ptr->size_rank_info[0].first; 
    754     intercomm_ep_rank_loc = newintercomm->ep_comm_ptr->size_rank_info[1].first; 
    755     intercomm_mpi_rank = newintercomm->ep_comm_ptr->size_rank_info[2].first; 
    756     intercomm_ep_size = newintercomm->ep_comm_ptr->size_rank_info[0].second; 
    757     intercomm_num_ep = newintercomm->ep_comm_ptr->size_rank_info[1].second; 
    758     intercomm_mpi_size = newintercomm->ep_comm_ptr->size_rank_info[2].second; 
    759  
    760  
    761  
    762     (*newintercomm).ep_comm_ptr->intercomm->local_rank_map  = new RANK_MAP; 
    763     (*newintercomm).ep_comm_ptr->intercomm->remote_rank_map = new RANK_MAP; 
    764     (*newintercomm).ep_comm_ptr->intercomm->local_rank_map->resize(local_num_ep); 
    765     (*newintercomm).ep_comm_ptr->intercomm->remote_rank_map->resize(remote_num_ep); 
    766  
    767     (*newintercomm).ep_comm_ptr->intercomm->size_rank_info[0] = local_comm.ep_comm_ptr->size_rank_info[0]; 
    768     (*newintercomm).ep_comm_ptr->intercomm->size_rank_info[1] = local_comm.ep_comm_ptr->size_rank_info[1]; 
    769     (*newintercomm).ep_comm_ptr->intercomm->size_rank_info[2] = local_comm.ep_comm_ptr->size_rank_info[2]; 
     753    intercomm_ep_rank = (*newintercomm)->ep_comm_ptr->size_rank_info[0].first; 
     754    intercomm_ep_rank_loc = (*newintercomm)->ep_comm_ptr->size_rank_info[1].first; 
     755    intercomm_mpi_rank = (*newintercomm)->ep_comm_ptr->size_rank_info[2].first; 
     756    intercomm_ep_size = (*newintercomm)->ep_comm_ptr->size_rank_info[0].second; 
     757    intercomm_num_ep = (*newintercomm)->ep_comm_ptr->size_rank_info[1].second; 
     758    intercomm_mpi_size = (*newintercomm)->ep_comm_ptr->size_rank_info[2].second; 
     759 
     760 
     761 
     762    (*newintercomm)->ep_comm_ptr->intercomm->local_rank_map  = new RANK_MAP; 
     763    (*newintercomm)->ep_comm_ptr->intercomm->remote_rank_map = new RANK_MAP; 
     764    (*newintercomm)->ep_comm_ptr->intercomm->local_rank_map->resize(local_num_ep); 
     765    (*newintercomm)->ep_comm_ptr->intercomm->remote_rank_map->resize(remote_num_ep); 
     766 
     767    (*newintercomm)->ep_comm_ptr->intercomm->size_rank_info[0] = local_comm->ep_comm_ptr->size_rank_info[0]; 
     768    (*newintercomm)->ep_comm_ptr->intercomm->size_rank_info[1] = local_comm->ep_comm_ptr->size_rank_info[1]; 
     769    (*newintercomm)->ep_comm_ptr->intercomm->size_rank_info[2] = local_comm->ep_comm_ptr->size_rank_info[2]; 
    770770 
    771771 
     
    773773    int local_rank_map_ele[2]; 
    774774    local_rank_map_ele[0] = intercomm_ep_rank; 
    775     local_rank_map_ele[1] = (*newintercomm).ep_comm_ptr->comm_label; 
     775    local_rank_map_ele[1] = (*newintercomm)->ep_comm_ptr->comm_label; 
    776776 
    777777    MPI_Allgather(local_rank_map_ele, 2, MPI_INT,  
    778       (*newintercomm).ep_comm_ptr->intercomm->local_rank_map->data(), 2, MPI_INT, local_comm); 
     778      (*newintercomm)->ep_comm_ptr->intercomm->local_rank_map->data(), 2, MPI_INT, local_comm); 
    779779 
    780780    if(ep_rank == local_leader) 
     
    783783      MPI_Request req_s, req_r; 
    784784 
    785       MPI_Isend((*newintercomm).ep_comm_ptr->intercomm->local_rank_map->data(), 2*local_num_ep, MPI_INT, remote_leader, tag, peer_comm, &req_s); 
    786       MPI_Irecv((*newintercomm).ep_comm_ptr->intercomm->remote_rank_map->data(), 2*remote_num_ep, MPI_INT, remote_leader, tag, peer_comm, &req_r); 
     785      MPI_Isend((*newintercomm)->ep_comm_ptr->intercomm->local_rank_map->data(), 2*local_num_ep, MPI_INT, remote_leader, tag, peer_comm, &req_s); 
     786      MPI_Irecv((*newintercomm)->ep_comm_ptr->intercomm->remote_rank_map->data(), 2*remote_num_ep, MPI_INT, remote_leader, tag, peer_comm, &req_r); 
    787787 
    788788 
     
    792792    } 
    793793 
    794     MPI_Bcast((*newintercomm).ep_comm_ptr->intercomm->remote_rank_map->data(), 2*remote_num_ep, MPI_INT, local_leader, local_comm); 
    795     (*newintercomm).ep_comm_ptr->intercomm->local_comm = &(local_comm.ep_comm_ptr->comm_list[ep_rank_loc]); 
    796     (*newintercomm).ep_comm_ptr->intercomm->intercomm_tag = tag; 
     794    MPI_Bcast((*newintercomm)->ep_comm_ptr->intercomm->remote_rank_map->data(), 2*remote_num_ep, MPI_INT, local_leader, local_comm); 
     795    (*newintercomm)->ep_comm_ptr->intercomm->local_comm = (local_comm->ep_comm_ptr->comm_list[ep_rank_loc]); 
     796    (*newintercomm)->ep_comm_ptr->intercomm->intercomm_tag = tag; 
    797797 
    798798 
Note: See TracChangeset for help on using the changeset viewer.