Ignore:
Timestamp:
10/04/17 11:45:14 (4 years ago)
Author:
yushan
Message:

EP updated

File:
1 edited

Legend:

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

    r1134 r1287  
    66{ 
    77 
    8  
    9  
    108  int MPI_Comm_free(MPI_Comm *comm) 
    119  { 
     
    1311    if(! comm->is_ep) 
    1412    { 
    15       if(comm->mpi_comm != MPI_COMM_NULL_STD) 
     13      if(comm->mpi_comm != static_cast< ::MPI_Comm>(MPI_COMM_NULL.mpi_comm)) 
    1614      { 
    1715        ::MPI_Comm mpi_comm = static_cast< ::MPI_Comm>(comm->mpi_comm); 
     
    4139        Debug("comm is EP, mpi_comm_ptr != NULL\n"); 
    4240 
    43         if(comm->my_buffer != NULL) 
    44         { 
    45           if(comm->my_buffer->buf_int != NULL) delete[] comm->my_buffer->buf_int; Debug("buf_int freed\n"); 
    46           if(comm->my_buffer->buf_float != NULL) delete[] comm->my_buffer->buf_float; Debug("buf_float freed\n"); 
    47           if(comm->my_buffer->buf_double != NULL) delete[] comm->my_buffer->buf_double; Debug("buf_double freed\n"); 
    48           if(comm->my_buffer->buf_long != NULL) delete[] comm->my_buffer->buf_long; Debug("buf_long freed\n"); 
    49           if(comm->my_buffer->buf_ulong != NULL) delete[] comm->my_buffer->buf_ulong; Debug("buf_ulong freed\n"); 
    50           if(comm->my_buffer->buf_char != NULL) delete[] comm->my_buffer->buf_char; Debug("buf_char freed\n"); 
    51         } 
    5241 
    5342        if(comm->ep_barrier != NULL) 
     
    7766        } 
    7867 
    79         if(comm->mpi_comm != MPI_COMM_NULL_STD) 
     68        if(  comm->mpi_comm != static_cast< ::MPI_Comm>(MPI_COMM_NULL.mpi_comm)  
     69          && comm->mpi_comm != static_cast< ::MPI_Comm>(MPI_COMM_WORLD.mpi_comm)) 
    8070        { 
    8171          ::MPI_Comm mpi_comm = static_cast< ::MPI_Comm>(comm->mpi_comm); 
     
    10797      Debug("comm is EP, mpi_comm_ptr != NULL\n"); 
    10898 
    109       if(comm->my_buffer != NULL) 
    110       { 
    111         if(comm->my_buffer->buf_int != NULL) delete[] comm->my_buffer->buf_int; Debug("buf_int freed\n"); 
    112         if(comm->my_buffer->buf_float != NULL) delete[] comm->my_buffer->buf_float; Debug("buf_float freed\n"); 
    113         if(comm->my_buffer->buf_double != NULL) delete[] comm->my_buffer->buf_double; Debug("buf_double freed\n"); 
    114         if(comm->my_buffer->buf_long != NULL) delete[] comm->my_buffer->buf_long; Debug("buf_long freed\n"); 
    115         if(comm->my_buffer->buf_ulong != NULL) delete[] comm->my_buffer->buf_ulong; Debug("buf_ulong freed\n"); 
    116         if(comm->my_buffer->buf_char != NULL) delete[] comm->my_buffer->buf_char; Debug("buf_char freed\n"); 
    117       } 
    11899 
    119100      if(comm->ep_barrier != NULL) 
     
    151132      } 
    152133 
    153       if(comm->mpi_comm != MPI_COMM_NULL_STD) 
     134      if(comm->mpi_comm != static_cast< ::MPI_Comm>(MPI_COMM_NULL.mpi_comm)) 
    154135      { 
    155136        ::MPI_Comm mpi_comm = static_cast< ::MPI_Comm>(comm->mpi_comm); 
Note: See TracChangeset for help on using the changeset viewer.