Skip to content

Commit 3037eb9

Browse files
merge
2 parents b5c1494 + c14d56e commit 3037eb9

34 files changed

+659
-1040
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
# SuiteSparse/CMakeLists.txt: root CMake build rules
33
#-------------------------------------------------------------------------------
44

5-
# Copyright (c) 2023-2024, Timothy A. Davis, All Rights Reserved.
5+
# Copyright (c) 2023-2025, Timothy A. Davis, All Rights Reserved.
66
# Just this particular file is under the Apache-2.0 license; each package has
77
# its own license.
88
# SPDX-License-Identifier: Apache-2.0

ChangeLog

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
June 2, 2025: version 7.11.0
1+
July 25, 2025: version 7.11.0
22

33
* LAGraph v1.2: many new experimental algorithms, LAGraph_Random in src/
44
* GraphBLAS v10.1.1: risc-V vectorization, GRAPHBLAS_VANILLA (optional;

GraphBLAS/CUDA/GB_cuda_init.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -63,8 +63,8 @@ GrB_Info GB_cuda_init (void)
6363
}
6464

6565
// FIXME: default device set to 1 to avoid hardware failure ...
66-
GB_cuda_set_device (0) ; // make GPU 1 the default device
67-
GB_Context_gpu_id_set (NULL, 0) ; // set GxB_CONTEXT_WORLD->gpu_id to 1
66+
GB_cuda_set_device (1) ; // make GPU 1 the default device
67+
GB_Context_gpu_id_set (NULL, 1) ; // set GxB_CONTEXT_WORLD->gpu_id to 1
6868

6969
// also check for jit cache, pre-load library of common kernels ...
7070
return (GrB_SUCCESS) ;

GraphBLAS/Doc/ChangeLog

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,12 @@
1-
June 2, 2025: version 10.1.1
1+
July 25, 2025: version 10.1.1
22

33
* gcc can now be used the Power or s390: workaround added;
44
see Source/mxm/factory/GB_AxB_saxpy3_symbolic_fine_template.c.
55
This resolves the issue found in v10.1.0.
6+
* OpenMP usage: replace omp critical with lock/unlock.
7+
* MATLAB: added method for getting/setting the JIT cache path.
8+
* JIT file lock/unlock: removed; if multiple user processes use
9+
GraphBLAS at the same time, each must set their own unique JIT cache.
610

711
June 1, 2025: version 10.1.0
812

17 Bytes
Binary file not shown.
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
10.1.1,
4-
June 3, 2025}
4+
July 25, 2025}
55

GraphBLAS/Doc/UserGuide/GrB_jit.tex

Lines changed: 8 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ \section{The SuiteSparse:GraphBLAS JIT} %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
1919
\subsection{Using the JIT}
2020

2121
Using the JIT in a user application is simple: by default, there is nothing to
22-
do. The current release, LAGraph v1.1.4, can use the JIT (and PreJIT) kernels
23-
without changing a single line of code.
22+
do. LAGraph can use the JIT (and PreJIT) kernels without changing a single
23+
line of code, for example.
2424

2525
Currently, the JIT compiles kernels for the CPU only, but a CUDA JIT is in
2626
progress to exploit NVIDIA GPUs, in collaboration with Joe Eaton and
@@ -38,10 +38,9 @@ \subsection{Using the JIT}
3838
cannot be determined and the \verb'GRAPHBLAS_CACHE_PATH' environment variable
3939
is not set, then JIT compilation is disabled and only PreJIT kernels can be
4040
used. The optional environment variable, \verb'GRAPHBLAS_CACHE_PATH', is also
41-
read by \verb'GrB_init' when the user application runs. The filesystem holding
42-
the cache folder must also support file locking. See Section~\ref{cache_path}
43-
for a description of the valid characters that can appear in the cache path
44-
and for more suggestions about file locking.
41+
read by \verb'GrB_init' when the user application runs. See
42+
Section~\ref{cache_path} for a description of the valid characters that can
43+
appear in the cache path.
4544

4645
The user application can modify the location of the cache folder after calling
4746
\verb'GrB_init'. It can also modify the C compiler and its flags, and can
@@ -331,27 +330,9 @@ \subsubsection{\sf GxB\_JIT\_CACHE\_PATH}
331330
character (\verb':') to allow for the use of Windows drive letters. Any
332331
character outside of these rules is converted into an underscore (\verb'_').
333332

334-
On distributed file systems that do not support file locking, sometimes the
335-
\verb'/tmp' directory is located on a file system that is not distributed, and
336-
is thus suitable to use for the GraphBLAS JIT cache. In this case, try
337-
creating a symbolic link in your home file folder (for Linux or Mac):
338-
339-
{\small
340-
\begin{verbatim}
341-
cd
342-
ln -s /tmp/me/.SuiteSparse \end{verbatim} }
343-
344-
where \verb'me' is your user name. Next, in your startup script
345-
(\verb'.bashrc' for example), add these commands:
346-
347-
{\small
348-
\begin{verbatim}
349-
mkdir /tmp/me
350-
mkdir /tmp/me/.SuiteSparse \end{verbatim} }
351-
352-
Then whenever you log into a system that has your home file folder on a
353-
distributed file system, the default \verb'~/.SuiteSparse' cache folder will be
354-
a symbolic link to a folder on a file system that does support file locking.
333+
If your run multiple user applications that each use the same version of
334+
GraphBLAS, then each of your applications must set their own unique JIT cache
335+
path. Only one user application at a time may use the default JIT cache path.
355336

356337
%-------------------------------------------------------------------------------
357338
\subsection{Compilation options: {\sf GRAPHBLAS\_USE\_JIT} and {\sf GRAPHBLAS\_COMPACT}}

GraphBLAS/Doc/UserGuide/GrB_release.tex

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,12 +5,16 @@ \section{Release Notes}
55

66
\begin{itemize}
77

8-
\item June 2, 2025: version 10.1.1
8+
\item June 7, 2025: version 10.1.1
99

1010
\begin{itemize}
1111
\item gcc can now be used the Power or s390: workaround added;
1212
see \verb'Source/mxm/factory/GB_AxB_saxpy3_symbolic_fine_template.c.'
1313
This resolves the issue found in v10.1.0.
14+
\item OpenMP usage: replace \verb'omp critical' with lock/unlock.
15+
\item MATLAB: added method for getting/setting the JIT cache path.
16+
\item JIT file lock/unlock: removed; if multiple user processes use
17+
GraphBLAS at the same time, each must set their own unique JIT cache.
1418
\end{itemize}
1519

1620
\item June 1, 2025: version 10.1.0

GraphBLAS/GraphBLAS/@GrB/jit.m

Lines changed: 40 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,9 @@
1-
function [status] = jit (status)
1+
function [status,path] = jit (status,path)
22
%GRB.JIT controls the GraphBLAS JIT
33
%
44
% status = GrB.jit ; % get the current status of the JIT
55
% status = GrB.jit (status) ; % control the JIT and get its status
6+
% [status,path] = GrB.jit (status,path) ; % get/set JIT cache path
67
%
78
% The GraphBLAS JIT allows GraphBLAS to compile new kernels at run-time
89
% that are specifically tuned for the particular operators, types, and
@@ -20,21 +21,56 @@
2021
% 'flush' clear all loaded JIT kernels, then turn the JIT on;
2122
% (the same as GrB.jit ('off') ; GrB.jit ('on')).
2223
%
23-
% Refer to the GraphBLAS User Guide for details (GxB_JIT_C_CONTROL).
24+
% The 2nd input/output parameter is a string that defines the JIT cache
25+
% path. If you run multiple instances of MATLAB at the same time, each
26+
% must use a different cache folder. The default cache on Linux/Mac is
27+
% ~/.SuiteSparse/GrB10.1.1 (for GraphBLAS v10.1.1 for example). On
28+
% Windows, it is located inside your AppData\Local folder. If you change
29+
% to another location, adding the GraphBLAS version is recommended; see
30+
% the last example below.
31+
%
32+
% Refer to the GraphBLAS User Guide for details (GxB_JIT_C_CONTROL
33+
% and GxB_JIT_CACHE_PATH).
2434
%
2535
% Example:
2636
%
2737
% [status] = GrB.jit
2838
% [status] = GrB.jit ('on')
39+
% [status,path] = GrB.jit
40+
% [status,path] = GrB.jit ('on', [userpath filesep 'my_other_cache')
41+
%
42+
% % setting the JIT cache path with the GraphBLAS version included:
43+
% v = GrB.ver
44+
% [status,path] = GrB.jit ('on', [userpath filesep 'myGrB' v.Version])
2945
%
3046
% See also GrB.threads, GrB.clear.
3147

3248
% SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2025, All Rights Reserved.
3349
% SPDX-License-Identifier: Apache-2.0
3450

3551
if (nargin == 0)
36-
[status] = gbjit ;
52+
53+
if (nargout <= 1)
54+
[status] = gbjit ;
55+
else
56+
[status, path] = gbjit ;
57+
end
58+
3759
elseif (nargin == 1)
38-
[status] = gbjit (status) ;
60+
61+
if (nargout <= 1)
62+
[status] = gbjit (status) ;
63+
else
64+
[status, path] = gbjit (status) ;
65+
end
66+
67+
else
68+
69+
if (nargout <= 1)
70+
[status] = gbjit (status, path) ;
71+
else
72+
[status, path] = gbjit (status, path) ;
73+
end
74+
3975
end
4076

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

Lines changed: 36 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,11 @@
1010
// Usage:
1111

1212
// [status] = gbjit
13-
// [status] = gbjit (status)
13+
// [status, path] = gbjit (status, path)
1414

1515
#include "gb_interface.h"
1616

17-
#define USAGE "usage: [status] = GrB.jit (status) ;"
17+
#define USAGE "usage: [status, path] = GrB.jit (status, path) ;"
1818

1919
void mexFunction
2020
(
@@ -29,7 +29,7 @@ void mexFunction
2929
// check inputs
3030
//--------------------------------------------------------------------------
3131

32-
gb_usage (nargin <= 1 && nargout <= 1, USAGE) ;
32+
gb_usage (nargin <= 2 && nargout <= 2, USAGE) ;
3333

3434
//--------------------------------------------------------------------------
3535
// set the JIT control, if requested
@@ -98,6 +98,39 @@ void mexFunction
9898
}
9999
}
100100

101+
//--------------------------------------------------------------------------
102+
// set the JIT cache path, if requested
103+
//--------------------------------------------------------------------------
104+
105+
if (nargin > 1)
106+
{
107+
if (!mxIsChar (pargin[1]))
108+
{
109+
ERROR ("path must be a string") ;
110+
}
111+
size_t pathlen = mxGetNumberOfElements (pargin [1]) + 2 ;
112+
char *path = mxMalloc (pathlen + 2) ;
113+
path [0] = '\0' ;
114+
mxGetString (pargin [1], path, pathlen) ;
115+
OK (GrB_Global_set_String (GrB_GLOBAL, path, GxB_JIT_CACHE_PATH)) ;
116+
mxFree (path) ;
117+
}
118+
119+
//--------------------------------------------------------------------------
120+
// get the JIT cache path, if requested
121+
//--------------------------------------------------------------------------
122+
123+
if (nargout > 1)
124+
{
125+
size_t pathlen = 0 ;
126+
OK (GrB_Global_get_SIZE (GrB_GLOBAL, &pathlen, GxB_JIT_CACHE_PATH)) ;
127+
char *path = mxMalloc (pathlen + 2) ;
128+
path [0] = '\0' ;
129+
OK (GrB_Global_get_String (GrB_GLOBAL, path, GxB_JIT_CACHE_PATH)) ;
130+
pargout [1] = mxCreateString (path) ;
131+
mxFree (path) ;
132+
}
133+
101134
//--------------------------------------------------------------------------
102135
// return result
103136
//--------------------------------------------------------------------------

0 commit comments

Comments
 (0)