Skip to content

Commit a669fc4

Browse files
Merge pull request #156 from DrTimothyAldenDavis/master
Master
2 parents 1b8fddb + 14b0989 commit a669fc4

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

63 files changed

+712
-380
lines changed

CMakeLists.txt

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ endif ( )
2626
set ( CMAKE_MACOSX_RPATH TRUE )
2727

2828
# version of SuiteSparse:GraphBLAS
29-
set ( GraphBLAS_DATE "Aug 6, 2022" )
29+
set ( GraphBLAS_DATE "Aug 8, 2022" )
3030
set ( GraphBLAS_VERSION_MAJOR 7 )
3131
set ( GraphBLAS_VERSION_MINOR 2 )
3232
set ( GraphBLAS_VERSION_SUB 0 )
@@ -279,7 +279,7 @@ if ( "${CMAKE_C_COMPILER_ID}" STREQUAL "GNU" )
279279
# integer operations wrap
280280
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -fwrapv " )
281281
# check all warnings (uncomment for development only)
282-
# set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wpedantic -Werror " )
282+
# set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -Wall -Wextra -Wpedantic " )
283283
if ( CMAKE_C_COMPILER_VERSION VERSION_LESS 4.9 )
284284
message ( FATAL_ERROR "gcc version must be at least 4.9" )
285285
endif ( )

Config/GraphBLAS.h.in

Lines changed: 9 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -471,7 +471,7 @@ GrB_Info GrB_getVersion // runtime access to C API version number
471471
// done, and this setting has no effect.
472472
//
473473
// GxB_COMPRESSION: compression method for GxB_Matrix_serialize and
474-
// GxB_Vector_serialize. The default is LZ4.
474+
// GxB_Vector_serialize. The default is ZSTD (level 1).
475475
//
476476
// GxB_IMPORT: GxB_FAST_IMPORT (faster, for trusted input data) or
477477
// GxB_SECURE_IMPORT (slower, for untrusted input data), for the
@@ -11372,46 +11372,29 @@ GrB_Info GrB_Matrix_exportHint // suggest the best export format
1137211372

1137311373
// Currently implemented: no compression, LZ4, LZ4HC, and ZSTD
1137411374
#define GxB_COMPRESSION_NONE -1 // no compression
11375-
#define GxB_COMPRESSION_DEFAULT 0 // LZ4
11375+
#define GxB_COMPRESSION_DEFAULT 0 // ZSTD (level 1)
1137611376
#define GxB_COMPRESSION_LZ4 1000 // LZ4
1137711377
#define GxB_COMPRESSION_LZ4HC 2000 // LZ4HC, with default level 9
11378-
#define GxB_COMPRESSION_ZSTD 3000 // ZSTD, with default level 6
11378+
#define GxB_COMPRESSION_ZSTD 3000 // ZSTD, with default level 1
1137911379

11380-
// possible future methods that could be added:
11381-
// #define GxB_COMPRESSION_LZO 4000 // LZO, with default level 2
11382-
// #define GxB_COMPRESSION_BZIP2 5000 // BZIP2, with default level 9
11383-
// #define GxB_COMPRESSION_LZSS 6000 // LZSS
11384-
// #define GxB_COMPRESSION_ZLIB 7000 // ZLIB, with default level 6
11385-
// ...
11386-
11387-
// using the Intel IPP versions, if available (not yet supported);
11388-
#define GxB_COMPRESSION_INTEL 1000000
11380+
#define GxB_COMPRESSION_INTEL 1000000 // not yet supported
1138911381

1139011382
// Most of the above methods have a level parameter that controls the tradeoff
1139111383
// between run time and the amount of compression obtained. Higher levels
1139211384
// result in a more compact result, at the cost of higher run time:
1139311385

1139411386
// LZ4 no level setting
1139511387
// LZ4HC 1: fast, 9: default, 9: max
11396-
// ZSTD: 1: fast, 3: default, 19: max
11397-
11398-
// these methos are not yet supported but may be added in the future:
11399-
// ZLIB 1: fast, 6: default, 9: max
11400-
// LZO 1: fast (X1ST), 2: default (XST)
11401-
// BZIP2 1: fast, 9: default, 9: max
11402-
// LZSS no level setting
11388+
// ZSTD: 1: fast, 1: default, 19: max
1140311389

1140411390
// For all methods, a level of zero results in the default level setting.
1140511391
// These settings can be added, so to use LZ4HC at level 5, use method =
1140611392
// GxB_COMPRESSION_LZ4HC + 5.
1140711393

1140811394
// If the level setting is out of range, the default is used for that method.
1140911395
// If the method is negative, no compression is performed. If the method is
11410-
// positive but unrecognized, the default is used (GxB_COMPRESSION_LZ4, with no
11411-
// level setting, and the non-Intel version).
11412-
11413-
// If a method is not implemented, LZ4 is used instead, and the level setting
11414-
// is ignored.
11396+
// positive but unrecognized, the default is used (GxB_COMPRESSION_ZSTD,
11397+
// level 1).
1141511398

1141611399
GB_PUBLIC
1141711400
GrB_Info GxB_Matrix_serialize // serialize a GrB_Matrix to a blob
@@ -11590,6 +11573,7 @@ GrB_Info GxB_Matrix_sort
1159011573
// The format of the input matrix (by row or by column) is unchanged; this
1159111574
// format need not match the by_col input parameter.
1159211575

11576+
GB_PUBLIC
1159311577
GrB_Info GxB_Matrix_reshape // reshape a GrB_Matrix in place
1159411578
(
1159511579
// input/output:
@@ -11609,6 +11593,7 @@ GrB_Info GxB_Matrix_reshape // reshape a GrB_Matrix in place
1160911593
// determines the format of the output matrix C, which need not match the
1161011594
// by_col input parameter.
1161111595

11596+
GB_PUBLIC
1161211597
GrB_Info GxB_Matrix_reshapeDup // reshape a GrB_Matrix into another GrB_Matrix
1161311598
(
1161411599
// output:

Doc/ChangeLog

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,10 @@
1-
Version 7.2.0, Aug 6, 2022
1+
Version 7.2.0, Aug 8, 2022
22

33
* added ZSTD as a compression option for serialize/deserialize:
44
Version 1.5.3 by Yann Collet, https://github.com/facebook/zstd.git
55
Copyright (c) 2016-present, Facebook, Inc. All rights reserved.
66
Included in SuiteSparse:GraphBLAS via its BSD-3-clause license.
7+
The default method is now ZSTD, level 1.
78
* added GxB_Matrix_reshape and GxB_Matrix_reshapeDup
89
* MATLAB interface: faster C(:)=A, C=A(:), and reshape.
910
Better error messages.

Doc/GraphBLAS_UserGuide.pdf

107 Bytes
Binary file not shown.

Doc/GraphBLAS_UserGuide.tex

Lines changed: 17 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -5452,9 +5452,10 @@ \subsection{Serialize/deserialize methods}
54525452
allocated by the user application, and it must be large enough to hold the
54535453
matrix or vector.
54545454

5455-
By default, LZ4 compression is used for serialization, but other options can be
5456-
selected via the descriptor: \verb'GxB_set (desc, GxB_COMPRESSION, method)',
5457-
where \verb'method' is an integer selected from the following options:
5455+
By default, ZSTD (level 1) compression is used for serialization, but other
5456+
options can be selected via the descriptor:
5457+
\verb'GxB_set (desc, GxB_COMPRESSION, method)', where \verb'method' is an
5458+
integer selected from the following options:
54585459

54595460
\vspace{0.2in}
54605461
{\footnotesize
@@ -5463,10 +5464,10 @@ \subsection{Serialize/deserialize methods}
54635464
method & description \\
54645465
\hline
54655466
\verb'GxB_COMPRESSION_NONE' & no compression \\
5466-
\verb'GxB_COMPRESSION_DEFAULT' & LZ4 \\
5467+
\verb'GxB_COMPRESSION_DEFAULT' & ZSTD, with default level 1 \\
54675468
\verb'GxB_COMPRESSION_LZ4' & LZ4 \\
54685469
\verb'GxB_COMPRESSION_LZ4HC' & LZ4HC, with default level 9 \\
5469-
\verb'GxB_COMPRESSION_ZSTD' & ZSTD, with default level 3 \\
5470+
\verb'GxB_COMPRESSION_ZSTD' & ZSTD, with default level 1 \\
54705471
\hline
54715472
\end{tabular} }
54725473
\vspace{0.2in}
@@ -5480,7 +5481,7 @@ \subsection{Serialize/deserialize methods}
54805481
\begin{verbatim}
54815482
GxB_set (desc, GxB_COMPRESSION, GxB_COMPRESSION_LZ4HC + 6) ; \end{verbatim}}
54825483

5483-
The ZSTD method can be specified as level 1 to 19, with 3 being the default.
5484+
The ZSTD method can be specified as level 1 to 19, with 1 being the default.
54845485
To compress with ZSTD at level 6, use:
54855486

54865487
{\footnotesize
@@ -5580,7 +5581,7 @@ \subsection{Serialize/deserialize methods}
55805581
% On output, it is reduced to the numbed of bytes actually used to serialize
55815582
% the vector. After calling \verb'GrB_Vector_serialize', the blob may be
55825583
% \verb'realloc''d to this revised size if desired (this is optional).
5583-
% LZ4 compression is used to construct a compact blob.
5584+
% ZSTD (level 1) compression is used to construct a compact blob.
55845585

55855586
%-------------------------------------------------------------------------------
55865587
\subsubsection{{\sf GxB\_Vector\_serialize:} serialize a vector}
@@ -5605,10 +5606,9 @@ \subsubsection{{\sf GxB\_Vector\_serialize:} serialize a vector}
56055606

56065607
\verb'GxB_Vector_serialize' serializes a vector into a single array of bytes
56075608
(the blob), which is \verb'malloc''ed and filled with the serialized vector.
5608-
By default, LZ4 compression is used, but other options can be selected
5609-
via the descriptor.
5610-
Serializing a vector is identical to serializing a matrix;
5611-
see Section \ref{matrix_serialize_GxB} for more information.
5609+
By default, ZSTD (level 1) compression is used, but other options can be
5610+
selected via the descriptor. Serializing a vector is identical to serializing
5611+
a matrix; see Section \ref{matrix_serialize_GxB} for more information.
56125612

56135613
\newpage
56145614
%-------------------------------------------------------------------------------
@@ -5728,7 +5728,7 @@ \subsubsection{{\sf GrB\_Matrix\_serialize:} serialize a matrix}
57285728
On output, it is reduced to the numbed of bytes actually used to serialize
57295729
the matrix. After calling \verb'GrB_Matrix_serialize', the blob may be
57305730
\verb'realloc''d to this revised size if desired (this is optional).
5731-
LZ4 compression is used to construct a compact blob.
5731+
ZSTD (level 1) compression is used to construct a compact blob.
57325732

57335733
%-------------------------------------------------------------------------------
57345734
\subsubsection{{\sf GxB\_Matrix\_serialize:} serialize a matrix}
@@ -5753,7 +5753,7 @@ \subsubsection{{\sf GxB\_Matrix\_serialize:} serialize a matrix}
57535753

57545754
\verb'GxB_Matrix_serialize' is identical to \verb'GrB_Matrix_serialize', except
57555755
that it does not require a pre-allocated blob. Instead, it allocates the blob
5756-
internally, and fills it with the serialized matrix. By default, LZ4
5756+
internally, and fills it with the serialized matrix. By default, ZSTD (level 1)
57575757
compression is used, but other options can be selected via the descriptor.
57585758

57595759
The blob is allocated with the \verb'malloc' function passed to
@@ -7676,8 +7676,8 @@ \subsection{GraphBLAS descriptors: {\sf GrB\_Descriptor}} %=====================
76767676
value will inform the matrix multiplication to sort its result, instead.
76777677

76787678
\item \verb'GxB_COMPRESSION' selects the compression method for serialization.
7679-
The default is LZ4. See Section~\ref{serialize_deserialize} for other
7680-
options.
7679+
The default is ZSTD (level 1). See Section~\ref{serialize_deserialize} for
7680+
other options.
76817681

76827682
\item \verb'GxB_IMPORT' informs the \verb'GxB' pack methods
76837683
that they can trust their input data, or not. The default is to trust
@@ -15331,14 +15331,15 @@ \section{Release Notes}
1533115331

1533215332
\begin{itemize}
1533315333

15334-
\item Version 7.2.0 (Aug 6, 2022)
15334+
\item Version 7.2.0 (Aug 8, 2022)
1533515335

1533615336
\begin{packed_itemize}
1533715337
\item added ZSTD as a compression option for serialize/deserialize:
1533815338
Version 1.5.3 by Yann Collet,
1533915339
\url{https://github.com/facebook/zstd.git}.
1534015340
Copyright (c) 2016-present, Facebook, Inc. All rights reserved.
1534115341
Included in SuiteSparse:GraphBLAS via its BSD-3-clause license.
15342+
The default method is now ZSTD, level 1.
1534215343
\item \verb'GxB_Matrix_reshape*' added.
1534315344
\item MATLAB interface: \verb'reshape', \verb'C(:)=A', \verb'C=A(:)' are
1534415345
faster. Better error messages.

Doc/GraphBLAS_version.tex

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
% version of SuiteSparse:GraphBLAS
22
\date{VERSION
33
7.2.0,
4-
Aug 6, 2022}
4+
Aug 8, 2022}
55

GraphBLAS/@GrB/private/mexfunctions/gbserialize.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,16 +49,17 @@ void mexFunction
4949
{
5050
method = GxB_COMPRESSION_NONE ;
5151
}
52-
else if (MATCH (method_name, "default") || MATCH (method_name, "lz4"))
52+
else if (MATCH (method_name, "lz4"))
5353
{
5454
method = GxB_COMPRESSION_LZ4 ;
5555
}
5656
else if (MATCH (method_name, "lz4hc"))
5757
{
5858
method = GxB_COMPRESSION_LZ4HC ;
5959
}
60-
else if (MATCH (method_name, "zstd"))
60+
else if (MATCH (method_name, "default") || MATCH (method_name, "zstd"))
6161
{
62+
// the default is ZSTD, with level 1
6263
method = GxB_COMPRESSION_ZSTD ;
6364
}
6465
else if (MATCH (method_name, "debug"))

GraphBLAS/@GrB/serialize.m

Lines changed: 11 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -12,23 +12,23 @@
1212
% more compact blob at the cost of higher run time. Levels outside
1313
% the allowable range are changed to the default level.
1414
%
15-
% 'lz4' LZ4, with no level setting. This is the default if the
16-
% method is not specified. Very fast with good compression.
17-
% For large problems, lz4 can be faster than no compression,
18-
% and it cuts the size of the blob by about 3x on average.
15+
% 'zstd' ZSTD. The level can be 1 to 19 with 1 the default.
16+
% This is the default method if no method is specified.
1917
%
20-
% 'none' no compression.
18+
% 'lz4' LZ4, with no level setting. Fast with decent compression.
19+
% For large problems, lz4 can be faster than no compression,
20+
% and it cuts the size of the blob by about 3x on average.
2121
%
22-
% 'lz4hc' LZ4HC, much slower than LZ4 but results in a more compact blob.
23-
% The level can be 1 to 9 with 9 the default. LZ4HC level 1
24-
% provides excellent compression compared with LZ4, and higher
25-
% levels of LZ4HC only slightly improve compression quality.
22+
% 'none' no compression.
2623
%
27-
% 'zstd' ZSTD. The level can be 1 to 19 with 3 the default.
24+
% 'lz4hc' LZ4HC, much slower than LZ4 but results in a more compact blob.
25+
% The level can be 1 to 9 with 9 the default. LZ4HC level 1
26+
% provides excellent compression compared with LZ4, and higher
27+
% levels of LZ4HC only slightly improve compression quality.
2828
%
2929
% Example:
3030
% G = GrB (magic (5))
31-
% blob = GrB.serialize (G) ; % compressed via LZ4
31+
% blob = GrB.serialize (G) ; % compressed via ZSTD, level 1
3232
% f = fopen ('G.bin', 'wb') ;
3333
% fwrite (f, blob) ;
3434
% fclose (f)

GraphBLAS/CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ set ( CMAKE_MACOSX_RPATH TRUE )
3131
# version must match ../CMakeLists.txt:
3232

3333
# version of SuiteSparse:GraphBLAS
34-
set ( GraphBLAS_DATE "Aug 6, 2022" )
34+
set ( GraphBLAS_DATE "Aug 8, 2022" )
3535
set ( GraphBLAS_VERSION_MAJOR 7 )
3636
set ( GraphBLAS_VERSION_MINOR 2 )
3737
set ( GraphBLAS_VERSION_SUB 0 )

0 commit comments

Comments
 (0)