periodic_operator_checksum Function

public pure function periodic_operator_checksum(target_nodes, operator) result(checksum)

Arguments

Type IntentOptional Attributes Name
integer(kind=i32), intent(in) :: target_nodes(:)
real(kind=dp), intent(in) :: operator(:,:,:)

Return Value integer(kind=int64)


Called by

proc~~periodic_operator_checksum~~CalledByGraph proc~periodic_operator_checksum periodic_operator_checksum proc~read_periodic_operator_cache read_periodic_operator_cache proc~read_periodic_operator_cache->proc~periodic_operator_checksum proc~write_periodic_operator_cache write_periodic_operator_cache proc~write_periodic_operator_cache->proc~periodic_operator_checksum proc~lookup_cell_cache lookup_cell_cache proc~lookup_cell_cache->proc~read_periodic_operator_cache proc~publish_cell_cache_and_unlock publish_cell_cache_and_unlock proc~publish_cell_cache_and_unlock->proc~write_periodic_operator_cache proc~precompute_periodic_root_operator precompute_periodic_root_operator proc~precompute_periodic_root_operator->proc~lookup_cell_cache proc~precompute_periodic_root_operator->proc~publish_cell_cache_and_unlock proc~core_complete_plan_impl core_complete_plan_impl proc~core_complete_plan_impl->proc~precompute_periodic_root_operator proc~core_build_panel_plan_impl core_build_panel_plan_impl proc~core_build_panel_plan_impl->proc~core_complete_plan_impl proc~core_build_plan_impl core_build_plan_impl proc~core_build_plan_impl->proc~core_complete_plan_impl

Source Code

  pure integer(int64) function periodic_operator_checksum(target_nodes, operator) result(checksum)
    integer(i32), intent(in) :: target_nodes(:)
    real(dp), intent(in) :: operator(:, :, :)
    integer(int8), allocatable :: bytes(:)
    integer :: target_idx

    checksum = -3750763034362895579_int64
    bytes = transfer(target_nodes, bytes, size(target_nodes)*storage_size(0_i32)/8)
    call hash_bytes(bytes, checksum)
    ! Hash one target block at a time in array element order: the same byte stream as the whole
    ! operator, without a byte copy of it.
    do target_idx = 1, size(operator, 3)
      bytes = transfer(operator(:, :, target_idx), bytes, size(operator, 1)*size(operator, 2)*storage_size(0.0_dp)/8)
      call hash_bytes(bytes, checksum)
    end do
  end function periodic_operator_checksum