fragment_lookup_init Subroutine

private pure subroutine fragment_lookup_init(this, estimated_entries)

Initialize hash table with estimated size

Type Bound

fragment_lookup_t

Arguments

Type IntentOptional Attributes Name
class(fragment_lookup_t), intent(inout) :: this
integer(kind=int64), intent(in) :: estimated_entries

Calls

proc~~fragment_lookup_init~~CallsGraph proc~fragment_lookup_init fragment_lookup_t%fragment_lookup_init proc~next_prime_internal next_prime_internal proc~fragment_lookup_init->proc~next_prime_internal

Called by

proc~~fragment_lookup_init~~CalledByGraph proc~fragment_lookup_init fragment_lookup_t%fragment_lookup_init proc~build_mbe_lookup_table build_mbe_lookup_table proc~build_mbe_lookup_table->proc~fragment_lookup_init proc~compute_mbe compute_mbe proc~compute_mbe->proc~build_mbe_lookup_table proc~global_coordinator global_coordinator proc~global_coordinator->proc~compute_mbe proc~serial_fragment_processor serial_fragment_processor proc~serial_fragment_processor->proc~compute_mbe interface~global_coordinator global_coordinator interface~global_coordinator->proc~global_coordinator interface~serial_fragment_processor serial_fragment_processor interface~serial_fragment_processor->proc~serial_fragment_processor proc~mbe_run_distributed mbe_context_t%mbe_run_distributed proc~mbe_run_distributed->interface~global_coordinator proc~mbe_run_serial mbe_context_t%mbe_run_serial proc~mbe_run_serial->interface~serial_fragment_processor

Variables

Type Visibility Attributes Name Initial
integer, private :: i

Source Code

   pure subroutine fragment_lookup_init(this, estimated_entries)
      !! Initialize hash table with estimated size
      class(fragment_lookup_t), intent(inout) :: this
      integer(int64), intent(in) :: estimated_entries

      integer :: i

      ! Use prime number close to estimated size for better distribution
      this%table_size = next_prime_internal(int(estimated_entries*1.3_dp))
      allocate (this%table(this%table_size))

      ! Initialize all entries as empty
      do i = 1, this%table_size
         nullify (this%table(i)%next)
      end do

      this%n_entries = 0
      this%initialized = .true.
   end subroutine fragment_lookup_init