dbcsr_distribution_release Subroutine

public subroutine dbcsr_distribution_release(dist)

Releases and potentially destroys a distribution

Arguments

Type IntentOptional Attributes Name
type(dbcsr_distribution_obj), intent(inout) :: dist

Source Code

   SUBROUTINE dbcsr_distribution_release(dist)
      !! Releases and potentially destroys a distribution
      TYPE(dbcsr_distribution_obj), INTENT(INOUT)        :: dist

!   ---------------------------------------------------------------------------

      IF (ASSOCIATED(dist%d)) THEN
         dist%d%refcount = dist%d%refcount - 1
         IF (dist%d%refcount .EQ. 0) THEN
            CALL array_release(dist%d%row_dist_block)
            CALL array_release(dist%d%col_dist_block)
            CALL array_release(dist%d%local_rows)
            CALL array_release(dist%d%local_cols)
            CALL dbcsr_mp_release(dist%d%mp_env)
            IF (dist%d%has_thread_dist) &
               CALL array_release(dist%d%thread_dist)
            CALL array_release(dist%d%row_map)
            CALL array_release(dist%d%col_map)
            CALL dbcsr_dist_release_locals(dist)
            DEALLOCATE (dist%d)
         END IF
      END IF
   END SUBROUTINE dbcsr_distribution_release