particle_soa_state_hash Function

private function particle_soa_state_hash(this) result(digest)

32-bit FNV-1a digest of the container’s live state.

Folds the schema string, then the element count as an explicit int64, then every field’s live slice in declaration order. Two runs that reach identical state therefore produce identical digests, on any supported compiler and in both default_int builds, which is what makes this usable to validate a checkpoint.

Changing any single element of any single field changes the digest. See pic_array_hash for how -0.0 and NaN are canonicalised.

Type Bound

particle_soa_t

Arguments

Type IntentOptional Attributes Name
class(particle_soa_t), intent(in) :: this

Container to fingerprint.

Return Value integer(kind=int32)


Calls

proc~~particle_soa_state_hash~~CallsGraph proc~particle_soa_state_hash particle_soa_t%particle_soa_state_hash interface~soa_hash_begin soa_hash_begin proc~particle_soa_state_hash->interface~soa_hash_begin interface~soa_hash_field soa_hash_field proc~particle_soa_state_hash->interface~soa_hash_field proc~array_hash_digest array_hash_t%array_hash_digest proc~particle_soa_state_hash->proc~array_hash_digest proc~soa_hash_begin_32 soa_hash_begin_32 interface~soa_hash_begin->proc~soa_hash_begin_32 proc~soa_hash_begin_64 soa_hash_begin_64 interface~soa_hash_begin->proc~soa_hash_begin_64 proc~soa_hash64_int32_field soa_hash64_int32_field interface~soa_hash_field->proc~soa_hash64_int32_field proc~soa_hash64_int64_field soa_hash64_int64_field interface~soa_hash_field->proc~soa_hash64_int64_field proc~soa_hash64_logical_field soa_hash64_logical_field interface~soa_hash_field->proc~soa_hash64_logical_field proc~soa_hash64_real_dp_field soa_hash64_real_dp_field interface~soa_hash_field->proc~soa_hash64_real_dp_field proc~soa_hash64_real_sp_field soa_hash64_real_sp_field interface~soa_hash_field->proc~soa_hash64_real_sp_field proc~soa_hash_int32_field soa_hash_int32_field interface~soa_hash_field->proc~soa_hash_int32_field proc~soa_hash_int64_field soa_hash_int64_field interface~soa_hash_field->proc~soa_hash_int64_field proc~soa_hash_logical_field soa_hash_logical_field interface~soa_hash_field->proc~soa_hash_logical_field proc~soa_hash_real_dp_field soa_hash_real_dp_field interface~soa_hash_field->proc~soa_hash_real_dp_field proc~soa_hash_real_sp_field soa_hash_real_sp_field interface~soa_hash_field->proc~soa_hash_real_sp_field none~update~2 array_hash64_t%update proc~soa_hash64_int32_field->none~update~2 proc~soa_hash64_int64_field->none~update~2 proc~soa_hash64_logical_field->none~update~2 proc~soa_hash64_real_dp_field->none~update~2 proc~soa_hash64_real_sp_field->none~update~2 none~update array_hash_t%update proc~soa_hash_begin_32->none~update proc~array_hash_reset array_hash_t%array_hash_reset proc~soa_hash_begin_32->proc~array_hash_reset proc~soa_hash_begin_64->none~update~2 proc~array_hash64_reset array_hash64_t%array_hash64_reset proc~soa_hash_begin_64->proc~array_hash64_reset proc~soa_hash_int32_field->none~update proc~soa_hash_int64_field->none~update proc~soa_hash_logical_field->none~update proc~soa_hash_real_dp_field->none~update proc~soa_hash_real_sp_field->none~update proc~update_cdp_0 array_hash_t%update_cdp_0 none~update->proc~update_cdp_0 proc~update_cdp_1 array_hash_t%update_cdp_1 none~update->proc~update_cdp_1 proc~update_cdp_2 array_hash_t%update_cdp_2 none~update->proc~update_cdp_2 proc~update_cdp_3 array_hash_t%update_cdp_3 none~update->proc~update_cdp_3 proc~update_char_0 array_hash_t%update_char_0 none~update->proc~update_char_0 proc~update_char_1 array_hash_t%update_char_1 none~update->proc~update_char_1 proc~update_csp_0 array_hash_t%update_csp_0 none~update->proc~update_csp_0 proc~update_csp_1 array_hash_t%update_csp_1 none~update->proc~update_csp_1 proc~update_csp_2 array_hash_t%update_csp_2 none~update->proc~update_csp_2 proc~update_csp_3 array_hash_t%update_csp_3 none~update->proc~update_csp_3 proc~update_int16_0 array_hash_t%update_int16_0 none~update->proc~update_int16_0 proc~update_int16_1 array_hash_t%update_int16_1 none~update->proc~update_int16_1 proc~update_int16_2 array_hash_t%update_int16_2 none~update->proc~update_int16_2 proc~update_int16_3 array_hash_t%update_int16_3 none~update->proc~update_int16_3 proc~update_int32_0 array_hash_t%update_int32_0 none~update->proc~update_int32_0 proc~update_int32_1 array_hash_t%update_int32_1 none~update->proc~update_int32_1 proc~update_int32_2 array_hash_t%update_int32_2 none~update->proc~update_int32_2 proc~update_int32_3 array_hash_t%update_int32_3 none~update->proc~update_int32_3 proc~update_int64_0 array_hash_t%update_int64_0 none~update->proc~update_int64_0 proc~update_int64_1 array_hash_t%update_int64_1 none~update->proc~update_int64_1 proc~update_int64_2 array_hash_t%update_int64_2 none~update->proc~update_int64_2 proc~update_int64_3 array_hash_t%update_int64_3 none~update->proc~update_int64_3 proc~update_int8_0 array_hash_t%update_int8_0 none~update->proc~update_int8_0 proc~update_int8_1 array_hash_t%update_int8_1 none~update->proc~update_int8_1 proc~update_int8_2 array_hash_t%update_int8_2 none~update->proc~update_int8_2 proc~update_int8_3 array_hash_t%update_int8_3 none~update->proc~update_int8_3 proc~update_logical_0 array_hash_t%update_logical_0 none~update->proc~update_logical_0 proc~update_logical_1 array_hash_t%update_logical_1 none~update->proc~update_logical_1 proc~update_logical_2 array_hash_t%update_logical_2 none~update->proc~update_logical_2 proc~update_logical_3 array_hash_t%update_logical_3 none~update->proc~update_logical_3 proc~update_rdp_0 array_hash_t%update_rdp_0 none~update->proc~update_rdp_0 proc~update_rdp_1 array_hash_t%update_rdp_1 none~update->proc~update_rdp_1 proc~update_rdp_2 array_hash_t%update_rdp_2 none~update->proc~update_rdp_2 proc~update_rdp_3 array_hash_t%update_rdp_3 none~update->proc~update_rdp_3 proc~update_rsp_0 array_hash_t%update_rsp_0 none~update->proc~update_rsp_0 proc~update_rsp_1 array_hash_t%update_rsp_1 none~update->proc~update_rsp_1 proc~update_rsp_2 array_hash_t%update_rsp_2 none~update->proc~update_rsp_2 proc~update_rsp_3 array_hash_t%update_rsp_3 none~update->proc~update_rsp_3 proc~update64_cdp_0 array_hash64_t%update64_cdp_0 none~update~2->proc~update64_cdp_0 proc~update64_cdp_1 array_hash64_t%update64_cdp_1 none~update~2->proc~update64_cdp_1 proc~update64_cdp_2 array_hash64_t%update64_cdp_2 none~update~2->proc~update64_cdp_2 proc~update64_cdp_3 array_hash64_t%update64_cdp_3 none~update~2->proc~update64_cdp_3 proc~update64_char_0 array_hash64_t%update64_char_0 none~update~2->proc~update64_char_0 proc~update64_char_1 array_hash64_t%update64_char_1 none~update~2->proc~update64_char_1 proc~update64_csp_0 array_hash64_t%update64_csp_0 none~update~2->proc~update64_csp_0 proc~update64_csp_1 array_hash64_t%update64_csp_1 none~update~2->proc~update64_csp_1 proc~update64_csp_2 array_hash64_t%update64_csp_2 none~update~2->proc~update64_csp_2 proc~update64_csp_3 array_hash64_t%update64_csp_3 none~update~2->proc~update64_csp_3 proc~update64_int16_0 array_hash64_t%update64_int16_0 none~update~2->proc~update64_int16_0 proc~update64_int16_1 array_hash64_t%update64_int16_1 none~update~2->proc~update64_int16_1 proc~update64_int16_2 array_hash64_t%update64_int16_2 none~update~2->proc~update64_int16_2 proc~update64_int16_3 array_hash64_t%update64_int16_3 none~update~2->proc~update64_int16_3 proc~update64_int32_0 array_hash64_t%update64_int32_0 none~update~2->proc~update64_int32_0 proc~update64_int32_1 array_hash64_t%update64_int32_1 none~update~2->proc~update64_int32_1 proc~update64_int32_2 array_hash64_t%update64_int32_2 none~update~2->proc~update64_int32_2 proc~update64_int32_3 array_hash64_t%update64_int32_3 none~update~2->proc~update64_int32_3 proc~update64_int64_0 array_hash64_t%update64_int64_0 none~update~2->proc~update64_int64_0 proc~update64_int64_1 array_hash64_t%update64_int64_1 none~update~2->proc~update64_int64_1 proc~update64_int64_2 array_hash64_t%update64_int64_2 none~update~2->proc~update64_int64_2 proc~update64_int64_3 array_hash64_t%update64_int64_3 none~update~2->proc~update64_int64_3 proc~update64_int8_0 array_hash64_t%update64_int8_0 none~update~2->proc~update64_int8_0 proc~update64_int8_1 array_hash64_t%update64_int8_1 none~update~2->proc~update64_int8_1 proc~update64_int8_2 array_hash64_t%update64_int8_2 none~update~2->proc~update64_int8_2 proc~update64_int8_3 array_hash64_t%update64_int8_3 none~update~2->proc~update64_int8_3 proc~update64_logical_0 array_hash64_t%update64_logical_0 none~update~2->proc~update64_logical_0 proc~update64_logical_1 array_hash64_t%update64_logical_1 none~update~2->proc~update64_logical_1 proc~update64_logical_2 array_hash64_t%update64_logical_2 none~update~2->proc~update64_logical_2 proc~update64_logical_3 array_hash64_t%update64_logical_3 none~update~2->proc~update64_logical_3 proc~update64_rdp_0 array_hash64_t%update64_rdp_0 none~update~2->proc~update64_rdp_0 proc~update64_rdp_1 array_hash64_t%update64_rdp_1 none~update~2->proc~update64_rdp_1 proc~update64_rdp_2 array_hash64_t%update64_rdp_2 none~update~2->proc~update64_rdp_2 proc~update64_rdp_3 array_hash64_t%update64_rdp_3 none~update~2->proc~update64_rdp_3 proc~update64_rsp_0 array_hash64_t%update64_rsp_0 none~update~2->proc~update64_rsp_0 proc~update64_rsp_1 array_hash64_t%update64_rsp_1 none~update~2->proc~update64_rsp_1 proc~update64_rsp_2 array_hash64_t%update64_rsp_2 none~update~2->proc~update64_rsp_2 proc~update64_rsp_3 array_hash64_t%update64_rsp_3 none~update~2->proc~update64_rsp_3 proc~feed_real_dp64 feed_real_dp64 proc~update64_cdp_0->proc~feed_real_dp64 proc~update64_cdp_1->proc~feed_real_dp64 proc~update64_cdp_2->none~update~2 proc~update64_cdp_3->none~update~2 proc~feed_integer64 feed_integer64 proc~update64_char_0->proc~feed_integer64 proc~update64_char_1->none~update~2 proc~feed_real_sp64 feed_real_sp64 proc~update64_csp_0->proc~feed_real_sp64 proc~update64_csp_1->proc~feed_real_sp64 proc~update64_csp_2->none~update~2 proc~update64_csp_3->none~update~2 proc~update64_int16_0->proc~feed_integer64 proc~update64_int16_1->proc~feed_integer64 proc~update64_int16_2->none~update~2 proc~update64_int16_3->none~update~2 proc~update64_int32_0->proc~feed_integer64 proc~update64_int32_1->proc~feed_integer64 proc~update64_int32_2->none~update~2 proc~update64_int32_3->none~update~2 proc~update64_int64_0->proc~feed_integer64 proc~update64_int64_1->proc~feed_integer64 proc~update64_int64_2->none~update~2 proc~update64_int64_3->none~update~2 proc~update64_int8_0->proc~feed_integer64 proc~update64_int8_1->proc~feed_integer64 proc~update64_int8_2->none~update~2 proc~update64_int8_3->none~update~2 proc~feed_logical64 feed_logical64 proc~update64_logical_0->proc~feed_logical64 proc~update64_logical_1->proc~feed_logical64 proc~update64_logical_2->none~update~2 proc~update64_logical_3->none~update~2 proc~update64_rdp_0->proc~feed_real_dp64 proc~update64_rdp_1->proc~feed_real_dp64 proc~update64_rdp_2->none~update~2 proc~update64_rdp_3->none~update~2 proc~update64_rsp_0->proc~feed_real_sp64 proc~update64_rsp_1->proc~feed_real_sp64 proc~update64_rsp_2->none~update~2 proc~update64_rsp_3->none~update~2 proc~feed_real_dp feed_real_dp proc~update_cdp_0->proc~feed_real_dp proc~update_cdp_1->proc~feed_real_dp proc~update_cdp_2->none~update proc~update_cdp_3->none~update proc~feed_integer feed_integer proc~update_char_0->proc~feed_integer proc~update_char_1->none~update proc~feed_real_sp feed_real_sp proc~update_csp_0->proc~feed_real_sp proc~update_csp_1->proc~feed_real_sp proc~update_csp_2->none~update proc~update_csp_3->none~update proc~update_int16_0->proc~feed_integer proc~update_int16_1->proc~feed_integer proc~update_int16_2->none~update proc~update_int16_3->none~update proc~update_int32_0->proc~feed_integer proc~update_int32_1->proc~feed_integer proc~update_int32_2->none~update proc~update_int32_3->none~update proc~update_int64_0->proc~feed_integer proc~update_int64_1->proc~feed_integer proc~update_int64_2->none~update proc~update_int64_3->none~update proc~update_int8_0->proc~feed_integer proc~update_int8_1->proc~feed_integer proc~update_int8_2->none~update proc~update_int8_3->none~update proc~feed_logical feed_logical proc~update_logical_0->proc~feed_logical proc~update_logical_1->proc~feed_logical proc~update_logical_2->none~update proc~update_logical_3->none~update proc~update_rdp_0->proc~feed_real_dp proc~update_rdp_1->proc~feed_real_dp proc~update_rdp_2->none~update proc~update_rdp_3->none~update proc~update_rsp_0->proc~feed_real_sp proc~update_rsp_1->proc~feed_real_sp proc~update_rsp_2->none~update proc~update_rsp_3->none~update

Variables

Type Visibility Attributes Name Initial
type(array_hash_t), private :: hasher
integer(kind=default_int), private :: n

Source Code

   function particle_soa_state_hash(this) result(digest)
      !! 32-bit FNV-1a digest of the container's live state.
      !!
      !! Folds the schema string, then the element count as an explicit
      !! `int64`, then every field's live slice in declaration order. Two runs
      !! that reach identical state therefore produce identical digests, on any
      !! supported compiler and in both `default_int` builds, which is what
      !! makes this usable to validate a checkpoint.
      !!
      !! Changing any single element of any single field changes the digest.
      !! See `pic_array_hash` for how -0.0 and NaN are canonicalised.
      class(particle_soa_t), intent(in) :: this
         !! Container to fingerprint.
      integer(int32) :: digest

      type(array_hash_t) :: hasher
      integer(default_int) :: n

      n = this%extent%used
      call soa_hash_begin(hasher, PARTICLE_SOA_SCHEMA, n)
      call soa_hash_field(hasher, this%id, n)
      call soa_hash_field(hasher, this%x, n)
      call soa_hash_field(hasher, this%y, n)
      call soa_hash_field(hasher, this%z, n)
      call soa_hash_field(hasher, this%mass, n)
      call soa_hash_field(hasher, this%active, n)
      digest = hasher%digest()
   end function particle_soa_state_hash