Return the minimum and maximum unique key id values actually stored.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
class(hash_table), | intent(in) | :: | self | The hash table. |
||
logical, | intent(in), | optional | :: | global | Check the global values on all CAF images rather only on the local image. |
Minimum and maximum id values actually stored.
pure function ids(self, global)
!---------------------------------------------------------------------------------------------------------------------------------
!< Return the minimum and maximum unique key id values actually stored.
!---------------------------------------------------------------------------------------------------------------------------------
class(hash_table), intent(in) :: self !< The hash table.
logical, intent(in), optional :: global !< Check the global values on all CAF images rather only on the local image.
integer(I8P) :: ids(1:2) !< Minimum and maximum id values actually stored.
integer(I4P) :: b !< Bucket index, namely hashed key.
#ifdef CAF
integer(I4P) :: i !< Counter.
#else
#endif
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
ids = [huge(1_I8P), -huge(1_I8P)]
if (self%is_initialized_) then
if (present(global)) then
if (global.and.self%images_number>1) then
#ifdef CAF
do i=1, self%images_number
do b=1, self%buckets_number
if (len(self%bucket(b)[i])>0) ids = [min(ids(1), self%ids_(1,b)[i]), max(ids(2), self%ids_(2,b)[i])]
enddo
enddo
#endif
endif
else
do b=1, self%buckets_number
if (len(self%bucket(b))>0) ids = [min(ids(1), self%ids_(1,b)), max(ids(2), self%ids_(2,b))]
enddo
endif
endif
if (ids(1)>ids(2)) ids = 0 ! nullify IDs in case of empty buckets
!---------------------------------------------------------------------------------------------------------------------------------
endfunction ids