shm_clean Subroutine

public subroutine shm_clean()

FIXME : Add documentation

Arguments

None

Contents

Source Code


Source Code

  subroutine shm_clean()
    ! the linked list used o store shm data
    ! must be called before mpi_finalize or after
    ! all shm business is finished
    ! Probabale mpi finalise does a similar think
    implicit none

    integer ierr
    type (shm_node_pointers_t), pointer :: current => null(), aux => null()

    call shm_node_barrier

    current => shm_ptr_head
    do while (associated(current))
       if ( current%win /= MPI_WIN_NULL) then 
          call mpi_win_free(current%win,ierr)
       endif
       deallocate(current%nd, current%se)
       aux => current
       current => current%next
       deallocate(aux)
    end do
  end subroutine shm_clean