From 6a7e9c53577eb4772fe0133eff9a63ccc73b4d88 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fabien=20P=C3=A9an?= <99172565+FabienPean-Virtonomy@users.noreply.github.com> Date: Tue, 1 Aug 2023 10:24:16 +0200 Subject: [PATCH] Remove preallocation of memory in cells It was currently allocating memory for all cells even is the body particles are sparse within the bounding box. This led to a huge amount of memory wasted, sometimes intractable for complex models (e.g. 100GB for only 2M created) --- src/for_3D_build/meshes/cell_linked_list_supplementary.cpp | 7 ------- 1 file changed, 7 deletions(-) diff --git a/src/for_3D_build/meshes/cell_linked_list_supplementary.cpp b/src/for_3D_build/meshes/cell_linked_list_supplementary.cpp index abe80b98d5..b3f31f6218 100644 --- a/src/for_3D_build/meshes/cell_linked_list_supplementary.cpp +++ b/src/for_3D_build/meshes/cell_linked_list_supplementary.cpp @@ -15,13 +15,6 @@ void CellLinkedList ::allocateMeshDataMatrix() { Allocate3dArray(cell_index_lists_, all_cells_); Allocate3dArray(cell_data_lists_, all_cells_); - - mesh_parallel_for(MeshRange(Array3i::Zero(), all_cells_), - [&](int i, int j, int k) - { - cell_index_lists_[i][j][k].reserve(36); - cell_data_lists_[i][j][k].reserve(36); - }); } //=================================================================================================// void CellLinkedList ::deleteMeshDataMatrix()