Skip to content

Commit e5e78b9

Browse files
Merge pull request #334 from GraphBLAS/v1.2
V1.2 documentation plus a few bug fixes
2 parents 89c965c + 69229fb commit e5e78b9

File tree

12 files changed

+42
-33
lines changed

12 files changed

+42
-33
lines changed

.github/workflows/build-arch-emu.yaml

Lines changed: 4 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,8 @@
11
name: arch-emu
22

3-
# this is done on workflow_dispatch only since it takes a very long time
3+
# this is done on workflow_dispatch only since it takes a very long time.
4+
# It also uses the latest GraphBLAS dev2 branch, so be sure that branch
5+
# is operational before running this test.
46
on:
57
workflow_dispatch:
68

@@ -18,8 +20,7 @@ jobs:
1820
strategy:
1921
matrix:
2022
config:
21-
# FIXME: switch to 10.1.0 when it is released:
22-
- {grb_version: 10.0.5}
23+
- {grb_version: dev2}
2324
# For available CPU architectures, see:
2425
# https://github.com/marketplace/actions/setup-alpine-linux-environment
2526
arch: [riscv64]
@@ -71,8 +72,6 @@ jobs:
7172
gcc -dumpmachine
7273
git clone https://github.com/DrTimothyAldenDavis/GraphBLAS.git
7374
cd GraphBLAS
74-
# FIXME: switch to 10.1.0 when it is released:
75-
# git checkout tags/v${{ matrix.config.grb_version }}
7675
git checkout dev2
7776
make compact
7877
sudo make install

.github/workflows/build.yml

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,9 +18,8 @@ jobs:
1818
config:
1919
# if there are multiple items in this list, only use should
2020
# deployit=true for just one of them.
21-
# FIXME: use GraphBLAS v10.1.0 once it's released
2221
- {grb_version: 9.0.0, deployit: false}
23-
- {grb_version: 10.0.5, deployit: true}
22+
- {grb_version: 10.1.0, deployit: true}
2423

2524
steps:
2625

@@ -69,9 +68,8 @@ jobs:
6968
strategy:
7069
matrix:
7170
config:
72-
# FIXME: use GraphBLAS v10.1.0 once it's released
7371
- {grb_version: 9.0.0}
74-
- {grb_version: 10.0.5}
72+
- {grb_version: 10.1.0}
7573

7674
steps:
7775

Config/LAGraph.h.in

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@
248248
*
249249
* Error handling is simplified by the @sphinxref{LAGRAPH_TRY} / LAGRAPH_CATCH
250250
* mechanism described below. For example, assuming the user application
251-
* #defines a single LAGRAPH_CATCH mechanism for all error handling, the
251+
* defines a single LAGRAPH_CATCH mechanism for all error handling, the
252252
* above example would become:
253253
*
254254
* GrB_Vector level, parent ;
@@ -286,7 +286,7 @@
286286
* The LAGRAPH_CATCH macro takes a single argument, which is the return value
287287
* from an LAGraph method.
288288
*
289-
* A typical example of a user function that calls LAGraph might #define
289+
* A typical example of a user function that calls LAGraph might define
290290
* LAGRAPH_CATCH as follows. Suppose workvector is a GrB_vector used for
291291
* computations internal to the mybfs function, and W is a (double *) space
292292
* created by malloc.
@@ -844,7 +844,7 @@ LAGRAPH_PUBLIC extern GrB_Semiring
844844

845845
/** LAGraph_Version: determines the version of LAGraph. The version number and
846846
* date can also be obtained via compile-time constants from LAGraph.h.
847-
* However, it is possible to compile a user application that #includes one
847+
* However, it is possible to compile a user application that includes one
848848
* version of LAGraph.h and then links with another version of the LAGraph
849849
* library later on, so the version number and date may differ from the
850850
* compile-time constants.
@@ -2056,7 +2056,7 @@ int LAGraph_Vector_IsEqualOp
20562056
* will affect the pseudo-random numbers generated and results are thus not
20572057
* guaranteed in this case.
20582058
*
2059-
* @param[out,out] State vector to initialize with pseudo-random numbers.
2059+
* @param[in,out] State vector to initialize with pseudo-random numbers.
20602060
* @param[in] seed scalar seed value.
20612061
* @param[in,out] msg any error messages.
20622062
*
@@ -2085,7 +2085,7 @@ int LAGraph_Random_Seed // construct a random State vector
20852085
* https://doi.org/10.18637/jss.v008.i14 and
20862086
* https://en.wikipedia.org/wiki/Xorshift .
20872087
*
2088-
* @param[out,out] State vector with random numbers to be advanced.
2088+
* @param[in,out] State vector with random numbers to be advanced.
20892089
* @param[in,out] msg any error messages.
20902090
*
20912091
* @retval GrB_SUCCESS if successful.

README.md

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
[![Build Status](https://github.com/GraphBLAS/LAGraph/workflows/LAGraph%20CI/badge.svg)](https://github.com/GraphBLAS/LAGraph/actions)
1+
[![Build Status](https://github.com/GraphBLAS/LAGraph/workflows/LAGraph%20CI%20with%20Builtin%20GraphBLAS/badge.svg)](https://github.com/GraphBLAS/LAGraph/actions)
22
[![Documentation Status](https://readthedocs.org/projects/lagraph/badge/?version=latest)](https://lagraph.readthedocs.io/en/latest/?badge=latest)
33

44
# LAGraph
@@ -10,7 +10,7 @@ See <https://github.com/GraphBLAS/LAGraph> for the source code for LAGraph,
1010
Documenation is at <https://lagraph.readthedocs.org>.
1111
Test coverage results are at <https://graphblas.org/LAGraph>.
1212

13-
Currently, SuiteSparse:GraphBLAS v7.0.0 or later is required. However, use the
13+
Currently, SuiteSparse:GraphBLAS v9.0.0 or later is required. However, use the
1414
latest stable release of SuiteSparse:GraphBLAS for best results.
1515
See <https://github.com/DrTimothyAldenDavis/GraphBLAS>
1616

experimental/algorithm/LAGr_SwapEdges.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -765,15 +765,20 @@ int LAGr_SwapEdges
765765
GRB_TRY (GxB_unload_Vector_into_Container(M, con, NULL)) ;
766766
GRB_TRY (GrB_free(&(con->b))) ;
767767
con->b = dup_swaps_v;
768+
// n_keep = sum (dup_swaps_v), to count the # of 1's that now appear in
769+
// dup_swaps_v, which will become nvals(M) after loading M from the
770+
// container con.
771+
GRB_TRY (GrB_reduce (&n_keep, NULL, GrB_PLUS_MONOID_UINT64,
772+
dup_swaps_v, NULL)) ;
768773
con->nvals = n_keep;
769774
con->format = GxB_BITMAP;
770775
dup_swaps_v = NULL;
771776
GRB_TRY (GxB_load_Vector_from_Container(M, con, NULL)) ;
777+
// GRB_TRY (GxB_print (M, 1)) ; // for debugging; must be OK here
772778
GRB_TRY (GrB_free(&con)) ;
773779
GRB_TRY (LAGraph_FastAssign_Semiring(
774780
E_vec, NULL, second_edge, edge_perm, M, ramp_v,
775781
second_second_edge, NULL, msg)) ;
776-
777782

778783
n_keep /= 2;
779784

@@ -810,6 +815,7 @@ int LAGr_SwapEdges
810815
LAGRAPH_TRY (LAGraph_New (
811816
G_new, &A_new, LAGraph_ADJACENCY_UNDIRECTED, msg)) ;
812817
LG_FREE_WORK ;
818+
(*pSwaps) = num_swaps ;
813819
return (num_swaps >= totSwaps)? GrB_SUCCESS : LAGRAPH_INSUFFICIENT_SWAPS ;
814820
#else
815821
// printf("LAGr_SwapEdges Needs GB v10\n") ;

experimental/algorithm/LAGraph_RichClubCoefficient.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -298,7 +298,7 @@ int LAGraph_RichClubCoefficient
298298

299299
LG_ASSERT (max_deg == vpd_n && max_deg == epd_n, GrB_INVALID_VALUE) ;
300300
//run a cummulative sum (backwards) on vpd_arr
301-
for(GrB_Index i = max_deg - 1; i > 0; --i)
301+
for(int64_t i = max_deg - 1; i > 0; --i)
302302
{
303303
vpd_arr[i-1] += vpd_arr[i] ;
304304
epd_arr[i-1] += epd_arr[i] ;
@@ -358,7 +358,7 @@ int LAGraph_RichClubCoefficient
358358
vpd_index, vpd_arr, &max_deg, verts_per_deg
359359
)) ;
360360
//run a cummulative sum (backwards) on vpd_arr
361-
for(GrB_Index i = max_deg - 1; i > 0; --i)
361+
for(int64_t i = max_deg - 1; i > 0; --i)
362362
{
363363
vpd_arr[i-1] += vpd_arr[i] ;
364364
epd_arr[i-1] += epd_arr[i] ;

experimental/test/test_SwapEdges.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ void test_SwapEdges (void)
123123
//------------------------------------------------------------------
124124
// check results
125125
//------------------------------------------------------------------
126+
// Check sufficient swaps were performed.
127+
TEST_CHECK (pQ >= 100.0) ;
126128
//Make sure we got a symetric back out:
127129
OK (LAGraph_CheckGraph (G_new, msg)) ;
128130

@@ -305,6 +307,8 @@ void test_SwapEdges_brutal (void)
305307
//------------------------------------------------------------------
306308
// check results
307309
//------------------------------------------------------------------
310+
// Check sufficient swaps were performed.
311+
TEST_CHECK (pQ >= 1.0) ;
308312
//Make sure we got a symetric back out:
309313
LG_BRUTAL_BURBLE (LAGraph_CheckGraph (G_new, msg)) ;
310314

experimental/utility/LAGraph_FastAssign.c

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -161,8 +161,7 @@ int LAGraph_FastAssign_Semiring
161161
void *ramp_a = NULL, *i_a =NULL;
162162
int ramp_h = GrB_DEFAULT, trsp = GrB_DEFAULT, i_h = GrB_DEFAULT;
163163
uint64_t ramp_n = 0, ramp_size = 0, i_n = 0, i_size= 0;
164-
GrB_Type x_type = NULL, i_type = NULL, ramp_type = NULL;
165-
bool iso = false;
164+
GrB_Type i_type = NULL, ramp_type = NULL;
166165
//----------------------------------------------------------------------
167166
// Check inputs
168167
//----------------------------------------------------------------------
@@ -191,10 +190,6 @@ int LAGraph_FastAssign_Semiring
191190
GRB_TRY (GrB_Vector_size(&nrows, c)) ;
192191
}
193192

194-
GRB_TRY (GrB_Vector_get_INT32(X_vec, (int32_t *) &iso, GxB_ISO)) ;
195-
196-
GRB_TRY (GxB_Vector_type(&x_type, X_vec));
197-
198193
//----------------------------------------------------------------------
199194
// Load up containers
200195
//----------------------------------------------------------------------

include/LAGraph.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -248,7 +248,7 @@
248248
*
249249
* Error handling is simplified by the @sphinxref{LAGRAPH_TRY} / LAGRAPH_CATCH
250250
* mechanism described below. For example, assuming the user application
251-
* #defines a single LAGRAPH_CATCH mechanism for all error handling, the
251+
* defines a single LAGRAPH_CATCH mechanism for all error handling, the
252252
* above example would become:
253253
*
254254
* GrB_Vector level, parent ;
@@ -286,7 +286,7 @@
286286
* The LAGRAPH_CATCH macro takes a single argument, which is the return value
287287
* from an LAGraph method.
288288
*
289-
* A typical example of a user function that calls LAGraph might #define
289+
* A typical example of a user function that calls LAGraph might define
290290
* LAGRAPH_CATCH as follows. Suppose workvector is a GrB_vector used for
291291
* computations internal to the mybfs function, and W is a (double *) space
292292
* created by malloc.
@@ -844,7 +844,7 @@ LAGRAPH_PUBLIC extern GrB_Semiring
844844

845845
/** LAGraph_Version: determines the version of LAGraph. The version number and
846846
* date can also be obtained via compile-time constants from LAGraph.h.
847-
* However, it is possible to compile a user application that #includes one
847+
* However, it is possible to compile a user application that includes one
848848
* version of LAGraph.h and then links with another version of the LAGraph
849849
* library later on, so the version number and date may differ from the
850850
* compile-time constants.
@@ -2056,7 +2056,7 @@ int LAGraph_Vector_IsEqualOp
20562056
* will affect the pseudo-random numbers generated and results are thus not
20572057
* guaranteed in this case.
20582058
*
2059-
* @param[out,out] State vector to initialize with pseudo-random numbers.
2059+
* @param[in,out] State vector to initialize with pseudo-random numbers.
20602060
* @param[in] seed scalar seed value.
20612061
* @param[in,out] msg any error messages.
20622062
*
@@ -2085,7 +2085,7 @@ int LAGraph_Random_Seed // construct a random State vector
20852085
* https://doi.org/10.18637/jss.v008.i14 and
20862086
* https://en.wikipedia.org/wiki/Xorshift .
20872087
*
2088-
* @param[out,out] State vector with random numbers to be advanced.
2088+
* @param[in,out] State vector with random numbers to be advanced.
20892089
* @param[in,out] msg any error messages.
20902090
*
20912091
* @retval GrB_SUCCESS if successful.

rtdocs/acknowledgements.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,6 @@ This work is funded in part by:
99
development center. [DM22-0790]
1010
2. The United States Department of Defense under Contract No.
1111
FA8650-18-2-7835 and HR0011-18-3-0007
12-
3. NVIDIA, Intel, MIT Lincoln Laboratory, MathWorks, IBM, and Julia Computing.
12+
3. NVIDIA, Intel, MIT Lincoln Laboratory, MathWorks, IBM, Julia Computing, Redis, and FalkorDB.
1313
4. The National Science Foundation (1514406, OAC-1740333, CCF-1629657).
1414
5. The United States Department of Energy, Office of Science, ASCR Contract No. DE-AC02-05CH11231.

0 commit comments

Comments
 (0)