Return the number of (actually stored) nodes of the hash table, namely the hash table length.
Type | Intent | Optional | Attributes | Name | ||
---|---|---|---|---|---|---|
type(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. |
The hash table length.
elemental function hash_table_len(self, global) result(length)
!---------------------------------------------------------------------------------------------------------------------------------
!< Return the number of (actually stored) nodes of the hash table, namely the hash table length.
!---------------------------------------------------------------------------------------------------------------------------------
type(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(I4P) :: length !< The hash table length.
#ifdef CAF
integer(I4P) :: i !< Counter.
#endif
!---------------------------------------------------------------------------------------------------------------------------------
!---------------------------------------------------------------------------------------------------------------------------------
#ifdef CAF
length = 0
if (self%is_initialized_) then
length = self%nodes_number_
if (present(global)) then
if (global.and.self%images_number>1) then
if (self%images_number>1) then
do i=1, self%images_number
if (self%me==i) cycle
length = length + self%nodes_number_[i] ! blocking "get"
enddo
endif
endif
endif
endif
#else
length = self%nodes_number_
#endif
!---------------------------------------------------------------------------------------------------------------------------------
endfunction hash_table_len