Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
15 changes: 8 additions & 7 deletions .github/workflows/build.yml
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,13 @@ jobs:
config:
# if there are multiple items in this list, only use should
# deployit=true for just one of them.
- {grb_version: 9.0.0, deployit: false}
- {grb_version: 10.1.0, deployit: true}
#- {grb_version: 9.0.0, deployit: false}
- {grb_version: 10.3.0, deployit: true}

steps:

- name: Checkout
uses: actions/checkout@v2.0.0
uses: actions/checkout@v7

- name: Install tools for build
run: |
Expand Down Expand Up @@ -68,19 +68,20 @@ jobs:
strategy:
matrix:
config:
- {grb_version: 9.0.0}
- {grb_version: 10.1.0}
# - {grb_version: 9.0.0}
- {grb_version: 10.3.0}

steps:

- name: Checkout
uses: actions/checkout@v2.0.0
uses: actions/checkout@v7

- name: Install dependencies
run: |
brew uninstall cmake
brew tap-new libomp/cask
brew extract --version=14.0.6 libomp libomp/cask
brew trust libomp/cask
brew install libomp@14.0.6

- name: Build GraphBLAS
Expand All @@ -99,5 +100,5 @@ jobs:
cd build
cmake ..
JOBS=2 make
ctest .
ctest . --rerun-failed --output-on-failure

39 changes: 34 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -36,13 +36,13 @@
# get the version
#-------------------------------------------------------------------------------

cmake_minimum_required ( VERSION 3.20 ) # LAGraph can be built stand-alone
cmake_minimum_required ( VERSION 3.23 )

# version of LAGraph
set ( LAGraph_DATE "Sept 8, 2025" )
set ( LAGraph_DATE "July 21, 2026" )
set ( LAGraph_VERSION_MAJOR 1 CACHE STRING "" FORCE )
set ( LAGraph_VERSION_MINOR 2 CACHE STRING "" FORCE )
set ( LAGraph_VERSION_SUB 1 CACHE STRING "" FORCE )
set ( LAGraph_VERSION_SUB 2 CACHE STRING "" FORCE )

message ( STATUS "Building LAGraph version: v"
${LAGraph_VERSION_MAJOR}.
Expand Down Expand Up @@ -70,6 +70,17 @@ include ( SuiteSparsePolicy )

enable_language ( C )

# check if stdalign.h exists
include ( CheckIncludeFile )
check_include_file ( stdalign.h HAVE_STDALIGN_H )
if ( HAVE_STDALIGN_H )
set ( LAGraph_HAS_STDALIGN_H 1 )
message ( STATUS "stdalign.h is available" )
else ( )
message ( STATUS "stdalign.h is not available" )
set ( LAGraph_HAS_STDALIGN_H 0 )
endif ( )

# configure LAGraph.h with the LAGraph date and version
configure_file (
"Config/LAGraph.h.in"
Expand Down Expand Up @@ -152,8 +163,7 @@ else ( )
# message ( STATUS "GRAPHBLAS_ROOT: ${GRAPHBLAS_ROOT} $ENV{GRAPHBLAS_ROOT}" )

# No package version is explicitly stated here; an arbitrary GraphBLAS
# library can have any version number. For SuiteSparse:GraphBLAS, LAGraph
# requires v7.1.0 or later, which is checked in LAGraph.h.
# library can have any version number.
message ( STATUS "Looking for GraphBLAS with FindGraphBLAS.cmake" )
find_package ( GraphBLAS MODULE REQUIRED )

Expand Down Expand Up @@ -375,6 +385,25 @@ else ( )
endif ( )
endif ( )

if ( GRAPHBLAS_VERSION )
if ( ${GRAPHBLAS_VERSION} MATCHES "([0-9]+).[0-9]+.[0-9]+" )
set ( GraphBLAS_VER_MAJOR ${CMAKE_MATCH_1} )
endif ( )
if ( ${GRAPHBLAS_VERSION} MATCHES "[0-9]+.([0-9]+).[0-9]+" )
set ( GraphBLAS_VER_MINOR ${CMAKE_MATCH_1} )
endif ( )
if ( ${GRAPHBLAS_VERSION} MATCHES "[0-9]+.[0-9]+.([0-9]+)" )
set ( GraphBLAS_VER_PATCH ${CMAKE_MATCH_1} )
endif ( )
if ( LAGRAPH_DUMP )
message ( STATUS "major: ${GraphBLAS_VER_MAJOR}" )
message ( STATUS "minor: ${GraphBLAS_VER_MINOR}" )
message ( STATUS "patch: ${GraphBLAS_VER_PATCH}" )
endif ( )
endif ( )

message (STATUS "Config with GraphBLAS version ${GraphBLAS_VER_MAJOR}.${GraphBLAS_VER_MINOR}.${GraphBLAS_VER_PATCH}" )

# generate config file to be used in common build tree
set ( SUITESPARSE_IN_BUILD_TREE ON )
configure_package_config_file (
Expand Down
13 changes: 7 additions & 6 deletions Config/LAGraph.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -41,6 +41,7 @@
#define LAGRAPH_VERSION_MAJOR @LAGraph_VERSION_MAJOR@
#define LAGRAPH_VERSION_MINOR @LAGraph_VERSION_MINOR@
#define LAGRAPH_VERSION_UPDATE @LAGraph_VERSION_SUB@
#define LAGRAPH_HAS_STDALIGN_H @LAGraph_HAS_STDALIGN_H@

//==============================================================================
// include files and helper macros
Expand Down Expand Up @@ -104,8 +105,8 @@

#if ( !LAGRAPH_VANILLA ) && defined ( GxB_SUITESPARSE_GRAPHBLAS )
// use SuiteSparse, and its GxB* extensions
#if GxB_IMPLEMENTATION < GxB_VERSION (9,0,0)
#error "If using SuiteSparse::GraphBLAS, version 9.0.0 or later is required"
#if GxB_IMPLEMENTATION < GxB_VERSION (10,0,0)
#error "SuiteSparse::GraphBLAS v10.0.0 or later is required"
#endif
#define LAGRAPH_SUITESPARSE 1
#else
Expand Down Expand Up @@ -2410,11 +2411,11 @@ int LAGr_SingleSourceShortestPath
) ;

//------------------------------------------------------------------------------
// LAGr_Betweenness: betweeness centrality metric
// LAGr_Betweenness: betweenness centrality metric
//------------------------------------------------------------------------------

/** LAGr_Betweenness: betweeness centrality metric. This methods computes an
* approximation of the betweeness-centrality metric of all nodes in the graph.
/** LAGr_Betweenness: betweenness centrality metric. This methods computes an
* approximation of the betweenness-centrality metric of all nodes in the graph.
* Only a few given source nodes are used for the approximation. This is an
* Advanced algorithm (G->AT is required).
*
Expand Down Expand Up @@ -2442,7 +2443,7 @@ LAGRAPH_PUBLIC
int LAGr_Betweenness
(
// output:
GrB_Vector *centrality, // centrality(i): betweeness centrality of i
GrB_Vector *centrality, // centrality(i): betweenness centrality of i
// input:
const LAGraph_Graph G, // input graph
const GrB_Index *sources, // source vertices to compute shortest paths
Expand Down
4 changes: 2 additions & 2 deletions Config/LAGraphConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -41,9 +41,9 @@ include ( CMakeFindDependencyMacro )
set ( _dependencies_found ON )

if ( NOT TARGET GraphBLAS::GraphBLAS )
# Look GraphBLAS
# Look for GraphBLAS
list ( PREPEND CMAKE_MODULE_PATH ${CMAKE_CURRENT_LIST_DIR} )
find_dependency ( GraphBLAS @GraphBLAS_VERSION_MAJOR@.@GraphBLAS_VERSION_MINOR@ )
find_dependency ( GraphBLAS @GraphBLAS_VER_MAJOR@.@GraphBLAS_VER_MINOR@ )
endif ( )

if ( NOT GraphBLAS_FOUND )
Expand Down
20 changes: 10 additions & 10 deletions cmake_modules/FindGraphBLAS.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -271,18 +271,18 @@ string (

if ( GRAPHBLAS_VERSION )
if ( ${GRAPHBLAS_VERSION} MATCHES "([0-9]+).[0-9]+.[0-9]+" )
set ( GraphBLAS_VERSION_MAJOR ${CMAKE_MATCH_1} )
set ( GraphBLAS_VER_MAJOR ${CMAKE_MATCH_1} )
endif ( )
if ( ${GRAPHBLAS_VERSION} MATCHES "[0-9]+.([0-9]+).[0-9]+" )
set ( GraphBLAS_VERSION_MINOR ${CMAKE_MATCH_1} )
set ( GraphBLAS_VER_MINOR ${CMAKE_MATCH_1} )
endif ( )
if ( ${GRAPHBLAS_VERSION} MATCHES "[0-9]+.[0-9]+.([0-9]+)" )
set ( GraphBLAS_VERSION_PATCH ${CMAKE_MATCH_1} )
set ( GraphBLAS_VER_PATCH ${CMAKE_MATCH_1} )
endif ( )
if ( LAGRAPH_DUMP )
message ( STATUS "major: ${GraphBLAS_VERSION_MAJOR}" )
message ( STATUS "minor: ${GraphBLAS_VERSION_MINOR}" )
message ( STATUS "patch: ${GraphBLAS_VERSION_PATCH}" )
message ( STATUS "major: ${GraphBLAS_VER_MAJOR}" )
message ( STATUS "minor: ${GraphBLAS_VER_MINOR}" )
message ( STATUS "patch: ${GraphBLAS_VER_PATCH}" )
endif ( )
endif ( )

Expand All @@ -300,10 +300,10 @@ if ( EXISTS "${GRAPHBLAS_INCLUDE_DIR}" AND NOT GRAPHBLAS_VERSION )
message ( STATUS "minor: ${GRAPHBLAS_MINOR_STR}" )
message ( STATUS "patch: ${GRAPHBLAS_PATCH_STR}" )
endif ( )
string ( REGEX MATCH "[0-9]+" GraphBLAS_VERSION_MAJOR ${GRAPHBLAS_MAJOR_STR} )
string ( REGEX MATCH "[0-9]+" GraphBLAS_VERSION_MINOR ${GRAPHBLAS_MINOR_STR} )
string ( REGEX MATCH "[0-9]+" GraphBLAS_VERSION_PATCH ${GRAPHBLAS_PATCH_STR} )
set (GRAPHBLAS_VERSION "${GraphBLAS_VERSION_MAJOR}.${GraphBLAS_VERSION_MINOR}.${GraphBLAS_VERSION_PATCH}")
string ( REGEX MATCH "[0-9]+" GraphBLAS_VER_MAJOR ${GRAPHBLAS_MAJOR_STR} )
string ( REGEX MATCH "[0-9]+" GraphBLAS_VER_MINOR ${GRAPHBLAS_MINOR_STR} )
string ( REGEX MATCH "[0-9]+" GraphBLAS_VER_PATCH ${GRAPHBLAS_PATCH_STR} )
set (GRAPHBLAS_VERSION "${GraphBLAS_VER_MAJOR}.${GraphBLAS_VER_MINOR}.${GraphBLAS_VER_PATCH}")
endif ( )

set ( GRAPHBLAS_LIBRARIES ${GRAPHBLAS_LIBRARY} )
Expand Down
27 changes: 11 additions & 16 deletions cmake_modules/SuiteSparsePolicy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -35,10 +35,10 @@
# GraphBLAS is false.
#
# SUITESPARSE_CUDA_ARCHITECTURES: a string, such as "all" or
# "35;50;75;80" that lists the CUDA architectures to use
# "75;80" that lists the CUDA architectures to use
# when compiling CUDA kernels with nvcc. The "all"
# option requires cmake 3.23 or later.
# Default: "52;75;80".
# Default: "all".
#
# BLA_VENDOR and BLA_SIZEOF_INTEGER: By default, SuiteSparse searches for
# the BLAS library in a specific order. If you wish to
Expand Down Expand Up @@ -310,24 +310,19 @@ if ( SUITESPARSE_USE_FORTRAN )
set ( SUITESPARSE_HAS_FORTRAN ON )
if ( NOT "${CMAKE_Fortran_COMPILER_ID}" STREQUAL "${CMAKE_C_COMPILER_ID}" OR
NOT "${CMAKE_Fortran_COMPILER_ID}" STREQUAL "${CMAKE_CXX_COMPILER_ID}" )
message ( STATUS " " )
message ( STATUS "Incompatible Fortran/C/C++ compilers detected:" )
message ( STATUS " Fortran: ${CMAKE_Fortran_COMPILER}" )
message ( STATUS " Fortran id: ${CMAKE_Fortran_COMPILER_ID}" )
message ( STATUS " C ${CMAKE_C_COMPILER}" )
message ( STATUS " C id: ${CMAKE_C_COMPILER_ID}" )
message ( STATUS " C++ ${CMAKE_CXX_COMPILER}" )
message ( STATUS " C++ id: ${CMAKE_CXX_COMPILER_ID}" )
if ( "${CMAKE_C_COMPILER_ID}" STREQUAL "IntelLLVM" )
message ( STATUS " " )
message ( STATUS "Incompatible Fortran/C/C++ compilers detected:" )
message ( STATUS " Fortran: ${CMAKE_Fortran_COMPILER}" )
message ( STATUS " Fortran id: ${CMAKE_Fortran_COMPILER_ID}" )
message ( STATUS " C ${CMAKE_C_COMPILER}" )
message ( STATUS " C id: ${CMAKE_C_COMPILER_ID}" )
message ( STATUS " C++ ${CMAKE_CXX_COMPILER}" )
message ( STATUS " C++ id: ${CMAKE_CXX_COMPILER_ID}" )
# icx/icpx cannot be used with gfortran: this is a fatal error
message ( FATAL_ERROR "ERROR: Using Fortran with SuiteSparse requires that "
" it has the same compiler ID as the C/C++ compilers."
" Use a compatible Fortran compiler, or set SUITESPARSE_USE_FORTRAN to OFF." )
else ( )
# other cases: just issue a warning and hope it works.
message ( WARNING "Warning: Using Fortran with SuiteSparse requires that "
" it has the same compiler ID as the C/C++ compilers."
" Use a compatible Fortran compiler, or set SUITESPARSE_USE_FORTRAN to OFF." )
endif ( )
endif ( )
message ( STATUS "Fortran: enabled" )
Expand Down Expand Up @@ -401,7 +396,7 @@ endif ( )

if ( SUITESPARSE_HAS_CUDA )
message ( STATUS "CUDA: enabled" )
set ( SUITESPARSE_CUDA_ARCHITECTURES "52;75;80" CACHE STRING "CUDA architectures" )
set ( SUITESPARSE_CUDA_ARCHITECTURES "all" CACHE STRING "CUDA architectures" )
set ( CMAKE_CUDA_ARCHITECTURES ${SUITESPARSE_CUDA_ARCHITECTURES} )
else ( )
message ( STATUS "CUDA: not enabled" )
Expand Down
11 changes: 9 additions & 2 deletions experimental/algorithm/LAGraph_cdlp.c
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,13 @@

#include <LAGraph.h>
#include <LAGraphX.h>
#include <stdalign.h>
#if LAGRAPH_HAS_STDALIGN_H
#include <stdalign.h>
#define ALIGNAS_64 alignas(64)
#else
// the alignas keyword/macro is not available
#define ALIGNAS_64
#endif
#include "LG_internal.h"

// A Go-style slice / Lisp-style property list
Expand Down Expand Up @@ -141,7 +147,7 @@ void counts_reducer(GrB_Index* e1, GrB_Index* c1, GrB_Index e2, GrB_Index c2) {
#define bucket_shift (64llu - bucket_bits)

typedef struct {
alignas(64) plist buckets[nof_buckets];
ALIGNAS_64 plist buckets[nof_buckets];
} ptable;

void ptable_free(ptable* table) {
Expand Down Expand Up @@ -187,6 +193,7 @@ void ptable_reduce(ptable* table, GrB_Index* entry, GrB_Index* count, plist_redu
}

//****************************************************************************

int LAGraph_cdlp
(
GrB_Vector *CDLP_handle, // output vector
Expand Down
17 changes: 9 additions & 8 deletions include/LAGraph.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,10 +37,11 @@
// See also the LAGraph_Version utility method, which returns these values.
// These definitions are derived from LAGraph/CMakeLists.txt.

#define LAGRAPH_DATE "Sept 8, 2025"
#define LAGRAPH_DATE "July 21, 2026"
#define LAGRAPH_VERSION_MAJOR 1
#define LAGRAPH_VERSION_MINOR 2
#define LAGRAPH_VERSION_UPDATE 1
#define LAGRAPH_VERSION_UPDATE 2
#define LAGRAPH_HAS_STDALIGN_H 1

//==============================================================================
// include files and helper macros
Expand Down Expand Up @@ -104,8 +105,8 @@

#if ( !LAGRAPH_VANILLA ) && defined ( GxB_SUITESPARSE_GRAPHBLAS )
// use SuiteSparse, and its GxB* extensions
#if GxB_IMPLEMENTATION < GxB_VERSION (9,0,0)
#error "If using SuiteSparse::GraphBLAS, version 9.0.0 or later is required"
#if GxB_IMPLEMENTATION < GxB_VERSION (10,0,0)
#error "SuiteSparse::GraphBLAS v10.0.0 or later is required"
#endif
#define LAGRAPH_SUITESPARSE 1
#else
Expand Down Expand Up @@ -2410,11 +2411,11 @@ int LAGr_SingleSourceShortestPath
) ;

//------------------------------------------------------------------------------
// LAGr_Betweenness: betweeness centrality metric
// LAGr_Betweenness: betweenness centrality metric
//------------------------------------------------------------------------------

/** LAGr_Betweenness: betweeness centrality metric. This methods computes an
* approximation of the betweeness-centrality metric of all nodes in the graph.
/** LAGr_Betweenness: betweenness centrality metric. This methods computes an
* approximation of the betweenness-centrality metric of all nodes in the graph.
* Only a few given source nodes are used for the approximation. This is an
* Advanced algorithm (G->AT is required).
*
Expand Down Expand Up @@ -2442,7 +2443,7 @@ LAGRAPH_PUBLIC
int LAGr_Betweenness
(
// output:
GrB_Vector *centrality, // centrality(i): betweeness centrality of i
GrB_Vector *centrality, // centrality(i): betweenness centrality of i
// input:
const LAGraph_Graph G, // input graph
const GrB_Index *sources, // source vertices to compute shortest paths
Expand Down
Loading