Fixed a memory allocation problem with the Uentries array in the SStructMatrix
data structure.
This commit is contained in:
parent
6e7fc7d69d
commit
fb4f84a511
@ -74,6 +74,7 @@ HYPRE_SStructGraphCreate( MPI_Comm comm,
|
||||
hypre_SStructGraphIUVEntries(graph) = NULL;
|
||||
hypre_SStructGraphUVEntries(graph) = NULL;
|
||||
hypre_SStructGraphUVESize(graph) = 0;
|
||||
hypre_SStructGraphUEMaxSize(graph) = 0;
|
||||
hypre_SStructGraphUVEOffsets(graph) = NULL;
|
||||
|
||||
hypre_SStructGraphRefCount(graph) = 1;
|
||||
@ -605,6 +606,8 @@ HYPRE_SStructGraphAssemble( HYPRE_SStructGraph graph )
|
||||
}
|
||||
hypre_SStructUVEntryNUEntries(Uventry) = nUentries;
|
||||
hypre_SStructUVEntryUEntries(Uventry) = Uentries;
|
||||
hypre_SStructGraphUEMaxSize(graph) =
|
||||
hypre_max(hypre_SStructGraphUEMaxSize(graph), nUentries);
|
||||
|
||||
i = nUentries - 1;
|
||||
hypre_SStructUVEntryToPart(Uventry, i) = to_part;
|
||||
|
||||
@ -129,9 +129,10 @@ HYPRE_SStructMatrixCreate( MPI_Comm comm,
|
||||
size = hypre_max(size, hypre_SStructStencilSize(stencils[part][vi]));
|
||||
}
|
||||
}
|
||||
hypre_SStructMatrixEntriesSize(matrix) = size;
|
||||
hypre_SStructMatrixSEntries(matrix) = hypre_TAlloc(HYPRE_Int, size);
|
||||
size += hypre_SStructGraphUEMaxSize(graph);
|
||||
hypre_SStructMatrixUEntries(matrix) = hypre_TAlloc(HYPRE_Int, size);
|
||||
hypre_SStructMatrixEntriesSize(matrix) = size;
|
||||
hypre_SStructMatrixTmpColCoords(matrix) = NULL;
|
||||
hypre_SStructMatrixTmpCoeffs(matrix) = NULL;
|
||||
|
||||
|
||||
@ -457,6 +457,7 @@ typedef struct hypre_SStructGraph_struct
|
||||
HYPRE_Int *iUventries; /* rank indexes into Uventries */
|
||||
hypre_SStructUVEntry **Uventries;
|
||||
HYPRE_Int Uvesize; /* size of Uventries array */
|
||||
HYPRE_Int Uemaxsize; /* max size of Uentries */
|
||||
HYPRE_Int **Uveoffsets; /* offsets for computing rank indexes */
|
||||
|
||||
HYPRE_Int ref_count;
|
||||
@ -501,6 +502,7 @@ typedef struct hypre_SStructGraph_struct
|
||||
#define hypre_SStructGraphUVEntries(graph) ((graph) -> Uventries)
|
||||
#define hypre_SStructGraphUVEntry(graph, i) ((graph) -> Uventries[i])
|
||||
#define hypre_SStructGraphUVESize(graph) ((graph) -> Uvesize)
|
||||
#define hypre_SStructGraphUEMaxSize(graph) ((graph) -> Uemaxsize)
|
||||
#define hypre_SStructGraphUVEOffsets(graph) ((graph) -> Uveoffsets)
|
||||
#define hypre_SStructGraphUVEOffset(graph, p, v)((graph) -> Uveoffsets[p][v])
|
||||
|
||||
|
||||
@ -78,6 +78,7 @@ typedef struct hypre_SStructGraph_struct
|
||||
HYPRE_Int *iUventries; /* rank indexes into Uventries */
|
||||
hypre_SStructUVEntry **Uventries;
|
||||
HYPRE_Int Uvesize; /* size of Uventries array */
|
||||
HYPRE_Int Uemaxsize; /* max size of Uentries */
|
||||
HYPRE_Int **Uveoffsets; /* offsets for computing rank indexes */
|
||||
|
||||
HYPRE_Int ref_count;
|
||||
@ -122,6 +123,7 @@ typedef struct hypre_SStructGraph_struct
|
||||
#define hypre_SStructGraphUVEntries(graph) ((graph) -> Uventries)
|
||||
#define hypre_SStructGraphUVEntry(graph, i) ((graph) -> Uventries[i])
|
||||
#define hypre_SStructGraphUVESize(graph) ((graph) -> Uvesize)
|
||||
#define hypre_SStructGraphUEMaxSize(graph) ((graph) -> Uemaxsize)
|
||||
#define hypre_SStructGraphUVEOffsets(graph) ((graph) -> Uveoffsets)
|
||||
#define hypre_SStructGraphUVEOffset(graph, p, v)((graph) -> Uveoffsets[p][v])
|
||||
|
||||
|
||||
Loading…
Reference in New Issue
Block a user