safe_shared_memory_dealloc_cmplx Subroutine

private subroutine safe_shared_memory_dealloc_cmplx(this)

wrapper for shared_deallocate_mpi that tests if the pointer is associated @param[in,out] win MPI shared memory window for internal MPI usage @param[in,out] ptr pointer to be deallocated (if associated)

Type Bound



Type IntentOptional Attributes Name
class(shared_array_cmplx_t) :: this


Source Code

    subroutine safe_shared_memory_dealloc_cmplx (this)
        class(shared_array_cmplx_t) :: this
        character(*), parameter :: t_r = "shared_dealloc"

        ! assume that if ptr is associated, it points to mpi shared memory
        if (associated(this%ptr)) call shared_deallocate_mpi(this%win, this%ptr)
        ! First, check if we have to log the deallocation
        if (this%tag /= 0) call LogMemDealloc(t_r, this%tag)
    end subroutine safe_shared_memory_dealloc_cmplx