Skip to content

Commit 49e4cd7

Browse files
author
Charles PIGNEROL
committed
lima 7.9.4 recipe, VTK 7.1.1 patch against sub-allocation for meshes >= 10 millions of cells.
1 parent d03d4e5 commit 49e4cd7

File tree

3 files changed

+26
-0
lines changed

3 files changed

+26
-0
lines changed

meshing/packages/lima/package.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -36,6 +36,7 @@ class Lima(CMakePackage):
3636
patch('cmake-7.6.0.patch', when='@7.6.0')
3737

3838
version('main', branch='main')
39+
version('7.9.4', sha256='ab2fae0938b08c86685b0b2809dff5f6f69bb139e50179c952b391447d5833ec')
3940
version('7.9.3', sha256='4ef65333269ad9ba3a522a4b82d621b4a9ae6d920042a67361fe0a404c4fd0c1')
4041
version('7.9.2', sha256='fee1d16d12b6b2beaa6680903f67feba0fe10a0b1159a61dd926816f89e635fa')
4142
version('7.9.1', sha256='da517fa87a6df3b07e793d8a6a300865614803fa84cf1d3ec1994605e69b4571')

meshing_supersede/packages/vtk-maillage/package.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -50,6 +50,8 @@ class VtkMaillage(CMakePackage):
5050
# when compiling vtk7 with gcc >= 11
5151
patch('vtk-maillage_gcc11_const.patch', when='%gcc@11:')
5252

53+
# patch against underallocations for meshes of more than 10 million nodes/meshs
54+
patch('vtk-maillage_vtkAbstractArray_SetNumberOfValues.patch')
5355

5456
depends_on('mpi', when='+mpi')
5557

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
diff -Naur VTK-7.1.1.old/Common/Core/vtkAbstractArray.cxx VTK-7.1.1/Common/Core/vtkAbstractArray.cxx
2+
--- VTK-7.1.1.old/Common/Core/vtkAbstractArray.cxx 2023-11-10 08:09:27.968215356 +0100
3+
+++ VTK-7.1.1/Common/Core/vtkAbstractArray.cxx 2023-11-10 08:20:58.107217364 +0100
4+
@@ -187,8 +187,17 @@
5+
//----------------------------------------------------------------------------
6+
void vtkAbstractArray::SetNumberOfValues(vtkIdType numValues)
7+
{
8+
- if (this->Resize(std::ceil(numValues /
9+
- static_cast<float>(this->NumberOfComponents))))
10+
+/* VTK code 7.1.1.
11+
+ * If NumberOfComponents is 1 and numValues ​​is 46640545, then numValues ​​/static_cast<float>(this->NumberOfComponents),
12+
+ * of floating type, will be 46640544 (the floating precision is 7 significant digits,
13+
+ * cf. https://www.h-schmidt .net/FloatConverter/IEEE754.html)
14+
+ * => insufficient memory allocation causing crash and revealed by valgrind
15+
+ * if (this->Resize(std::ceil(numValues /
16+
+ * static_cast<float>(this->NumberOfComponents))))
17+
+*/
18+
+// Replacement VTK 8.2.0 code :
19+
+ vtkIdType numTuples = this->NumberOfComponents == 1 ? numValues : (numValues + this->NumberOfComponents - 1) / this->NumberOfComponents;
20+
+ if (this->Resize(numTuples))
21+
{
22+
this->MaxId = numValues - 1;
23+
}

0 commit comments

Comments
 (0)