From de0b4a4da12348c53196c6c120a6d94c3dde8c2e Mon Sep 17 00:00:00 2001 From: Martin Kronbichler Date: Fri, 1 Nov 2024 19:47:48 +0100 Subject: [PATCH] MatrixFree: Fix DoFInfo::memory_consumption --- source/matrix_free/dof_info.cc | 30 ++++++++++++++++++++++++++++++ 1 file changed, 30 insertions(+) diff --git a/source/matrix_free/dof_info.cc b/source/matrix_free/dof_info.cc index 4804548a36..91bbfcdfaa 100644 --- a/source/matrix_free/dof_info.cc +++ b/source/matrix_free/dof_info.cc @@ -1527,15 +1527,45 @@ namespace internal DoFInfo::memory_consumption() const { std::size_t memory = sizeof(*this); + for (const auto &storage : index_storage_variants) + memory += storage.capacity() * sizeof(storage[0]); memory += (row_starts.capacity() * sizeof(std::pair)); memory += MemoryConsumption::memory_consumption(dof_indices); + memory += MemoryConsumption::memory_consumption(dof_indices_interleaved); + memory += MemoryConsumption::memory_consumption(dof_indices_contiguous); + memory += + MemoryConsumption::memory_consumption(dof_indices_contiguous_sm); + memory += + MemoryConsumption::memory_consumption(dof_indices_interleave_strides); + memory += + MemoryConsumption::memory_consumption(n_vectorization_lanes_filled); + memory += MemoryConsumption::memory_consumption( + hanging_node_constraint_masks_comp); memory += MemoryConsumption::memory_consumption(hanging_node_constraint_masks); + memory += MemoryConsumption::memory_consumption(constrained_dofs); memory += MemoryConsumption::memory_consumption(row_starts_plain_indices); memory += MemoryConsumption::memory_consumption(plain_dof_indices); memory += MemoryConsumption::memory_consumption(constraint_indicator); memory += MemoryConsumption::memory_consumption(*vector_partitioner); + memory += MemoryConsumption::memory_consumption(n_components); + memory += MemoryConsumption::memory_consumption(start_components); + memory += MemoryConsumption::memory_consumption(component_to_base_index); + memory += + MemoryConsumption::memory_consumption(component_dof_indices_offset); + memory += MemoryConsumption::memory_consumption(dofs_per_cell); + memory += MemoryConsumption::memory_consumption(dofs_per_face); + memory += MemoryConsumption::memory_consumption(cell_active_fe_index); + memory += MemoryConsumption::memory_consumption(fe_index_conversion); + memory += + MemoryConsumption::memory_consumption(vector_zero_range_list_index); + memory += MemoryConsumption::memory_consumption(vector_zero_range_list); + memory += MemoryConsumption::memory_consumption(cell_loop_pre_list_index); + memory += MemoryConsumption::memory_consumption(cell_loop_pre_list); + memory += + MemoryConsumption::memory_consumption(cell_loop_post_list_index); + memory += MemoryConsumption::memory_consumption(cell_loop_post_list); return memory; } } // namespace MatrixFreeFunctions -- 2.39.5