Skip to content

Commit

Permalink
Browse files Browse the repository at this point in the history
…arse into dev2
  • Loading branch information
DrTimothyAldenDavis committed Dec 14, 2023
2 parents cc56b1b + fbe9982 commit 39e6538
Show file tree
Hide file tree
Showing 16 changed files with 157 additions and 130 deletions.
2 changes: 1 addition & 1 deletion Example/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -107,7 +107,7 @@ find_package ( KLU 2.3.0 REQUIRED )
find_package ( KLU_CHOLMOD 2.3.0 REQUIRED )
find_package ( LDL 3.3.0 REQUIRED )
find_package ( LAGraph 1.1.0 )
find_package ( Mongoose 3.3.0 REQUIRED )
find_package ( SuiteSparse_Mongoose 3.3.0 REQUIRED )
find_package ( ParU 0.1.0 REQUIRED )
find_package ( RBio 4.3.0 REQUIRED )
find_package ( SPEX 2.3.0 REQUIRED ) # requires GMP and MPFR
Expand Down
13 changes: 13 additions & 0 deletions Example/Source/my_cxx.cc
Original file line number Diff line number Diff line change
Expand Up @@ -445,6 +445,19 @@ int my_function (void)
umfpack_dl_report_status (Control, result) ;
umfpack_dl_report_info (Control, Info) ;

//--------------------------------------------------------------------------
// Mongoose
//--------------------------------------------------------------------------

version [0] = Mongoose::major_version ( ) ;
version [1] = Mongoose::minor_version ( ) ;
version [2] = Mongoose::patch_version ( ) ;
OK (my_check_version ("Mongoose", Mongoose_VERSION_MAJOR,
Mongoose_VERSION_MINOR, Mongoose_VERSION_PATCH, Mongoose_DATE,
version)) ;
std::cout << "Mongoose::mongoose_version(): " <<
Mongoose::mongoose_version ( ) << std::endl;

//--------------------------------------------------------------------------
// free workspace
//--------------------------------------------------------------------------
Expand Down
26 changes: 22 additions & 4 deletions GraphBLAS/cmake_modules/SuiteSparsePolicy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,15 @@ endif ( )

# add the ./build folder to the runpath so other SuiteSparse packages can
# find this one without "make install"
set ( CMAKE_BUILD_RPATH ${CMAKE_BUILD_RPATH} ${CMAKE_BINARY_DIR} )
list ( FIND CMAKE_BUILD_RPATH ${CMAKE_BINARY_DIR} _idx )
if ( _idx LESS 0 )
# not yet included in CMAKE_INSTALL_RPATH
list ( APPEND CMAKE_BUILD_RPATH ${CMAKE_BINARY_DIR} )
endif ( )

set ( INSIDE_SUITESPARSE OFF )
if ( NOT SUITESPARSE_ROOT_CMAKELISTS )
# determine if this Package is inside the SuiteSparse folder
set ( INSIDE_SUITESPARSE false )
if ( LOCAL_INSTALL )
# if you do not want to install local copies of SuiteSparse
# packages in SuiteSparse/lib and SuiteSparse/, set
Expand Down Expand Up @@ -199,18 +203,32 @@ if ( LOCAL_INSTALL )
endif ( )
endif ( )
set ( SUITESPARSE_LIBDIR ${SUITESPARSE_LOCAL_PREFIX}/lib )
set ( SUITESPARSE_FULL_LIBDIR ${SUITESPARSE_LIBDIR} )
set ( SUITESPARSE_INCLUDEDIR ${SUITESPARSE_LOCAL_PREFIX}/include/${SUITESPARSE_INCLUDEDIR_POSTFIX} )
set ( SUITESPARSE_BINDIR ${SUITESPARSE_LOCAL_PREFIX}/bin )
else ( )
set ( SUITESPARSE_LIBDIR ${CMAKE_INSTALL_LIBDIR} )
set ( SUITESPARSE_FULL_LIBDIR ${CMAKE_INSTALL_FULL_LIBDIR} )
set ( SUITESPARSE_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}/${SUITESPARSE_INCLUDEDIR_POSTFIX} )
set ( SUITESPARSE_BINDIR ${CMAKE_INSTALL_BINDIR} )
endif ( )

if ( INSIDE_SUITESPARSE )
# append ../lib to the install and build runpaths
set ( CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_RPATH} ${SUITESPARSE_LIBDIR} )
set ( CMAKE_BUILD_RPATH ${CMAKE_BUILD_RPATH} ${SUITESPARSE_LIBDIR} )
list ( APPEND CMAKE_INSTALL_RPATH ${SUITESPARSE_FULL_LIBDIR} )
list ( APPEND CMAKE_BUILD_RPATH ${SUITESPARSE_LIBDIR} )
else ( )
# Set reasonable RPATH for installed binaries
# That should be fine as long as DESTDIR isn't set when installing.
list ( FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES ${SUITESPARSE_FULL_LIBDIR} _idx )
if ( _idx LESS 0 )
# installation is not to a system prefix
list ( FIND CMAKE_INSTALL_RPATH ${SUITESPARSE_FULL_LIBDIR} _idx )
if ( _idx LESS 0 )
# RPATH is not yet included in CMAKE_INSTALL_RPATH
list ( APPEND CMAKE_INSTALL_RPATH ${SUITESPARSE_FULL_LIBDIR} )
endif ( )
endif ( )
endif ( )

set ( SUITESPARSE_PKGFILEDIR ${SUITESPARSE_LIBDIR} CACHE STRING
Expand Down
2 changes: 1 addition & 1 deletion LAGraph/Acknowledgments.txt
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ THIS WORK IS FUNDED IN PART BY:
THIS WORK BUILDS UPON THE FOLLOWING PRIOR WORKS:
1. SuiteSparse:GraphBLAS,
(http://faculty.cse.tamu.edu/davis/GraphBLAS.html)
Copyright 2017-2022 Timothy A. Davis (Author), AldenMath.com.
Copyright 2017-2023 Timothy A. Davis (Author), AldenMath.com.
By Tim Davis, Texas A&M University. Note that while SuiteSparse:GraphBLAS
is itself under the Apache 2 license, any contributions derived from
SuiteSparse:GraphBLAS and incorporated by the Author into LAGraph are
Expand Down
26 changes: 22 additions & 4 deletions LAGraph/cmake_modules/SuiteSparsePolicy.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -153,11 +153,15 @@ endif ( )

# add the ./build folder to the runpath so other SuiteSparse packages can
# find this one without "make install"
set ( CMAKE_BUILD_RPATH ${CMAKE_BUILD_RPATH} ${CMAKE_BINARY_DIR} )
list ( FIND CMAKE_BUILD_RPATH ${CMAKE_BINARY_DIR} _idx )
if ( _idx LESS 0 )
# not yet included in CMAKE_INSTALL_RPATH
list ( APPEND CMAKE_BUILD_RPATH ${CMAKE_BINARY_DIR} )
endif ( )

set ( INSIDE_SUITESPARSE OFF )
if ( NOT SUITESPARSE_ROOT_CMAKELISTS )
# determine if this Package is inside the SuiteSparse folder
set ( INSIDE_SUITESPARSE false )
if ( LOCAL_INSTALL )
# if you do not want to install local copies of SuiteSparse
# packages in SuiteSparse/lib and SuiteSparse/, set
Expand Down Expand Up @@ -199,18 +203,32 @@ if ( LOCAL_INSTALL )
endif ( )
endif ( )
set ( SUITESPARSE_LIBDIR ${SUITESPARSE_LOCAL_PREFIX}/lib )
set ( SUITESPARSE_FULL_LIBDIR ${SUITESPARSE_LIBDIR} )
set ( SUITESPARSE_INCLUDEDIR ${SUITESPARSE_LOCAL_PREFIX}/include/${SUITESPARSE_INCLUDEDIR_POSTFIX} )
set ( SUITESPARSE_BINDIR ${SUITESPARSE_LOCAL_PREFIX}/bin )
else ( )
set ( SUITESPARSE_LIBDIR ${CMAKE_INSTALL_LIBDIR} )
set ( SUITESPARSE_FULL_LIBDIR ${CMAKE_INSTALL_FULL_LIBDIR} )
set ( SUITESPARSE_INCLUDEDIR ${CMAKE_INSTALL_INCLUDEDIR}/${SUITESPARSE_INCLUDEDIR_POSTFIX} )
set ( SUITESPARSE_BINDIR ${CMAKE_INSTALL_BINDIR} )
endif ( )

if ( INSIDE_SUITESPARSE )
# append ../lib to the install and build runpaths
set ( CMAKE_INSTALL_RPATH ${CMAKE_INSTALL_RPATH} ${SUITESPARSE_LIBDIR} )
set ( CMAKE_BUILD_RPATH ${CMAKE_BUILD_RPATH} ${SUITESPARSE_LIBDIR} )
list ( APPEND CMAKE_INSTALL_RPATH ${SUITESPARSE_FULL_LIBDIR} )
list ( APPEND CMAKE_BUILD_RPATH ${SUITESPARSE_LIBDIR} )
else ( )
# Set reasonable RPATH for installed binaries
# That should be fine as long as DESTDIR isn't set when installing.
list ( FIND CMAKE_PLATFORM_IMPLICIT_LINK_DIRECTORIES ${SUITESPARSE_FULL_LIBDIR} _idx )
if ( _idx LESS 0 )
# installation is not to a system prefix
list ( FIND CMAKE_INSTALL_RPATH ${SUITESPARSE_FULL_LIBDIR} _idx )
if ( _idx LESS 0 )
# RPATH is not yet included in CMAKE_INSTALL_RPATH
list ( APPEND CMAKE_INSTALL_RPATH ${SUITESPARSE_FULL_LIBDIR} )
endif ( )
endif ( )
endif ( )

set ( SUITESPARSE_PKGFILEDIR ${SUITESPARSE_LIBDIR} CACHE STRING
Expand Down
7 changes: 3 additions & 4 deletions LAGraph/config/LAGraph.pc.in
Original file line number Diff line number Diff line change
@@ -1,5 +1,4 @@
# LAGraph, Copyright (c) 2019-2023, Timothy A. Davis.
# All Rights Reserved.
# LAGraph, Copyright (c) 2019-2023, LAGraph Contributors. All Rights Reserved.
# SPDX-License-Identifier: BSD-2-Clause

prefix=@prefix@
Expand All @@ -8,8 +7,8 @@ libdir=@libdir@
includedir=@includedir@

Name: LAGraph
URL: https://github.com/DrTimothyAldenDavis/SuiteSparse
Description: Library plus test harness for collecting algorithms that use GraphBLAS in SuiteSparse
URL: https://github.com/GraphBLAS/LAGraph
Description: Library plus test harness for collecting algorithms that use GraphBLAS
Version: @LAGraph_VERSION_MAJOR@.@LAGraph_VERSION_MINOR@.@LAGraph_VERSION_SUB@
Requires.private: GraphBLAS
Libs: -L${libdir} -l@SUITESPARSE_LIB_BASE_NAME@
Expand Down
3 changes: 2 additions & 1 deletion LAGraph/config/LAGraphConfig.cmake.in
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,8 @@

# The following copyright and license applies to just this file only, not to
# the library itself:
# LAGraphConfig.cmake, Copyright (c) 2023, Timothy A. Davis. All Rights Reserved.
# LAGraphConfig.cmake, Copyright (c) 2019-2023, LAGraph Contributors. All
# Rights Reserved.
# SPDX-License-Identifier: BSD-3-clause

#-------------------------------------------------------------------------------
Expand Down
25 changes: 0 additions & 25 deletions LAGraph/src/algorithm/LG_CC_FastSV6.c
Original file line number Diff line number Diff line change
Expand Up @@ -556,7 +556,6 @@ int LG_CC_FastSV6 // SuiteSparse:GraphBLAS method, with GxB extensions
bool T_jumbled, T_iso ;
GRB_TRY (GxB_Matrix_unpack_CSR (T, &Tp, &Tj, &Tx, &Tp_size, &Tj_size,
&Tx_size, &T_iso, &T_jumbled, NULL)) ;
// printf ("did unpack T\n") ; fflush (stdout) ; fflush (stderr) ;
#pragma omp parallel for num_threads(nthreads) schedule(static)
for (tid = 0 ; tid < nthreads ; tid++)
{
Expand Down Expand Up @@ -601,33 +600,15 @@ int LG_CC_FastSV6 // SuiteSparse:GraphBLAS method, with GxB extensions
count [tid] = p - Tp [range [tid]] ;
}

// printf ("did prune T\n") ; fflush (stdout) ; fflush (stderr) ;

// Compact empty space out of Tj not filled in from the above phase.
nvals = 0 ;
for (tid = 0 ; tid < nthreads ; tid++)
{
// `memcpy` is not safe if src/dest are overlapping.
// Use `memmove` (or if available `memmove_s`) instead.

// #if defined (__STDC_LIB_EXT1__)
// memmove_s (Tj + nvals, Tj_size - sizeof (GrB_Index) * nvals,
// Tj + Tp [range [tid]], sizeof (GrB_Index) * count [tid]) ;
// #else

// memmove is safe: src/dest can overlap, but the copy will not go
// outside of the array, and Tj is never NULL at this point
// (GRB_TRY on the GxB_Matrix_unpack_CSR above would catch that
// condition). So memmove_s isn't necessary.
memmove (Tj + nvals,
Tj + Tp [range [tid]], sizeof (GrB_Index) * count [tid]) ;

// #endif

nvals += count [tid] ;
count [tid] = nvals - count [tid] ;
}
// printf ("did compact T\n") ; fflush (stdout) ; fflush (stderr) ;

// Compact empty space out of Tp
#pragma omp parallel for num_threads(nthreads) schedule(static)
Expand All @@ -640,23 +621,17 @@ int LG_CC_FastSV6 // SuiteSparse:GraphBLAS method, with GxB extensions
}
}

// printf ("did 2nd compact T\n") ; fflush (stdout) ; fflush (stderr) ;

// finalize T
Tp [n] = nvals ;

// pack T for the final phase
GRB_TRY (GxB_Matrix_pack_CSR (T, &Tp, &Tj, &Tx, Tp_size, Tj_size,
Tx_size, T_iso, /* T is now jumbled */ true, NULL)) ;

// printf ("did pack T\n") ; fflush (stdout) ; fflush (stderr) ;

// pack A (unchanged since last unpack); this is the original G->A.
GRB_TRY (GxB_Matrix_pack_CSR (A, &Ap, &Aj, &Ax, Ap_size, Aj_size,
Ax_size, A_iso, A_jumbled, NULL)) ;

// printf ("did pack A\n") ; fflush (stdout) ; fflush (stderr) ;

// ]. The unpack/pack of A into Ap, Aj, Ax will not be needed, and G->A
// will become truly a read-only matrix.

Expand Down
5 changes: 4 additions & 1 deletion LAGraph/src/test/test_Xinit.c
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,10 @@

#include "LAGraph_test.h"
#include "LAGraphX.h"
#include "LG_init.h"

// functions defined in LAGr_Init.c:
LAGRAPH_PUBLIC void LG_set_LAGr_Init_has_been_called (bool setting) ;
LAGRAPH_PUBLIC bool LG_get_LAGr_Init_has_been_called (void) ;

//------------------------------------------------------------------------------
// global variables
Expand Down
8 changes: 5 additions & 3 deletions LAGraph/src/utility/LAGr_Init.c
Original file line number Diff line number Diff line change
Expand Up @@ -31,10 +31,12 @@

static bool LG_LAGr_Init_has_been_called = false ;

// LG_LAGr_Init_has_been_called is only modified or accessed by these two
// routines (even in this file):
// LG_LAGr_Init_has_been_called is only modified or accessed by the following
// two routines (even in this file). The two functions are made accessible via
// LAGRAPH_PUBLIC, only for testing purposes by src/test/test_Xinit.c.

#include "LG_init.h"
LAGRAPH_PUBLIC void LG_set_LAGr_Init_has_been_called (bool setting) ;
LAGRAPH_PUBLIC bool LG_get_LAGr_Init_has_been_called (void) ;

LAGRAPH_PUBLIC
void LG_set_LAGr_Init_has_been_called (bool setting)
Expand Down
32 changes: 0 additions & 32 deletions LAGraph/src/utility/LG_init.h

This file was deleted.

Loading

0 comments on commit 39e6538

Please sign in to comment.