Ignore:
Timestamp:
06/07/18 19:39:07 (3 years ago)
Author:
yushan
Message:

save dev : intercomm_create via intracomm. To do : modif related intercomm communication routines, barrier, free, rank, size...

File:
1 edited

Legend:

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

    r1517 r1525  
    103103 
    104104 
    105  
     105  int MPI_Comm_free2(MPI_Comm *comm) 
     106  { 
     107    Debug("MPI_Comm_free with EP_intracomm\n"); 
     108 
     109    int ep_rank_loc, num_ep; 
     110 
     111    ep_rank_loc = (*comm)->ep_comm_ptr->size_rank_info[1].first; 
     112    num_ep = (*comm)->ep_comm_ptr->size_rank_info[1].second; 
     113 
     114    MPI_Barrier2(*comm); 
     115 
     116    if(ep_rank_loc == 0) 
     117    { 
     118 
     119#ifdef _showinfo 
     120      printf("delete (*comm)->my_buffer = %p\n", (*comm)->my_buffer); 
     121#endif 
     122      delete (*comm)->my_buffer; 
     123 
     124 
     125       
     126#ifdef _showinfo         
     127      printf("delete (*comm)->ep_barrier = %p\n", (*comm)->ep_barrier); 
     128#endif 
     129      delete (*comm)->ep_barrier; 
     130       
     131 
     132 
     133      (*comm)->ep_rank_map->clear(); 
     134#ifdef _showinfo 
     135      printf("delete (*comm)->ep_rank_map = %p\n", (*comm)->ep_rank_map); 
     136#endif 
     137      delete (*comm)->ep_rank_map; 
     138       
     139 
     140      for(int i=0; i<num_ep; i++) 
     141      { 
     142        if((*comm)->is_intercomm) 
     143        { 
     144          (*comm)->ep_comm_ptr->comm_list[i]->inter_rank_map->clear(); 
     145#ifdef _showinfo 
     146          printf("delete (*comm)->ep_comm_ptr->comm_list[%d]->inter_rank_map = %p\n", i, (*comm)->ep_comm_ptr->comm_list[i]->inter_rank_map); 
     147#endif 
     148          delete (*comm)->ep_comm_ptr->comm_list[i]->inter_rank_map; 
     149        } 
     150 
     151        (*comm)->ep_comm_ptr->comm_list[i]->ep_comm_ptr->message_queue->clear(); 
     152#ifdef _showinfo 
     153        printf("delete (*comm)->ep_comm_ptr->comm_list[%d]->ep_comm_ptr->message_queue = %p\n", i, (*comm)->ep_comm_ptr->comm_list[i]->ep_comm_ptr->message_queue); 
     154#endif 
     155        delete (*comm)->ep_comm_ptr->comm_list[i]->ep_comm_ptr->message_queue; 
     156           
     157 
     158#ifdef _showinfo 
     159        printf("delete (*comm)->ep_comm_ptr->comm_list[%d]->ep_comm_ptr = %p\n", i, (*comm)->ep_comm_ptr->comm_list[i]->ep_comm_ptr); 
     160#endif 
     161        delete (*comm)->ep_comm_ptr->comm_list[i]->ep_comm_ptr; 
     162 
     163 
     164#ifdef _showinfo 
     165        printf("delete (*comm)->ep_comm_ptr->comm_list[%d] = %p\n", i, (*comm)->ep_comm_ptr->comm_list[i]); 
     166#endif 
     167        delete (*comm)->ep_comm_ptr->comm_list[i]; 
     168      } 
     169 
     170#ifdef _showinfo 
     171      printf("delete (*comm)->mpi_comm = %p\n", (*comm)->mpi_comm); 
     172#endif 
     173      ::MPI_Comm_free(to_mpi_comm_ptr((*comm)->mpi_comm)); 
     174       
     175#ifdef _showinfo 
     176      printf("delete (*comm)->ep_comm_ptr->comm_list = %p\n", (*comm)->ep_comm_ptr->comm_list); 
     177#endif 
     178      delete[] (*comm)->ep_comm_ptr->comm_list; 
     179    } 
     180  } 
    106181 
    107182 
Note: See TracChangeset for help on using the changeset viewer.