Skip to content

Commit

Permalink
Merge pull request #3 from DrTimothyAldenDavis/master
Browse files Browse the repository at this point in the history
Master to v3.2.2 in stable branch
  • Loading branch information
DrTimothyAldenDavis authored Apr 3, 2020
2 parents 13f961b + 0dcdbc3 commit 5e569f2
Show file tree
Hide file tree
Showing 1,623 changed files with 26,117 additions and 6,320 deletions.
40 changes: 13 additions & 27 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -54,13 +54,14 @@ message ( STATUS "CMake version: " ${CMAKE_VERSION} )
if ( CMAKE_VERSION VERSION_GREATER "3.0" )
cmake_policy ( SET CMP0042 NEW )
cmake_policy ( SET CMP0048 NEW )
cmake_policy ( SET CMP0054 NEW )
endif ( )

# version of SuiteSparse:GraphBLAS
set ( GraphBLAS_DATE "Mar 10, 2020" )
set ( GraphBLAS_DATE "Apr 2, 2020" )
set ( GraphBLAS_VERSION_MAJOR 3 )
set ( GraphBLAS_VERSION_MINOR 2 )
set ( GraphBLAS_VERSION_SUB 1 )
set ( GraphBLAS_VERSION_SUB 2 )

# GraphBLAS C API Specification version, at graphblas.org
set ( GraphBLAS_API_DATE "May 18, 2018" )
Expand Down Expand Up @@ -94,7 +95,7 @@ endif ( )
# or use cmake with -DBUILD_GRB_STATIC_LIBRARY=1

if ( BUILD_GRB_STATIC_LIBRARY )
message ( STATUS "Building both static and dynamic GraphBLAS libraries" )
message ( STATUS "Building all GraphBLAS libraries (static and dynamic)" )
else ( )
message ( STATUS "Building dynamic GraphBLAS library only" )
endif ( )
Expand All @@ -111,28 +112,12 @@ if ( GBCOMPACT )
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -DGBCOMPACT=1 " )
endif ( )

#-------------------------------------------------------------------------------
# configure GraphBLAS
#-------------------------------------------------------------------------------

find_program ( M4EXISTS m4 )
if ( NOT M4EXISTS )
message ( FATAL_ERROR "m4 not found, but is required. Install via your system package manager, or download at http://www.gnu.org/software/m4/m4.html or http://gnuwin32.sourceforge.net for Windows" )
endif ( )

set ( DEC0 "Config/GraphBLAS.h.in" )
execute_process (
WORKING_DIRECTORY ${PROJECT_SOURCE_DIR}
COMMAND m4 -P ${DEC0}
OUTPUT_FILE "Config/GraphBLAS.h.tmp"
)

#-------------------------------------------------------------------------------
# Configure Include/GraphBLAS.h and documentation with version number
#-------------------------------------------------------------------------------

configure_file (
"Config/GraphBLAS.h.tmp"
"Config/GraphBLAS.h.in"
"${PROJECT_SOURCE_DIR}/Include/GraphBLAS.h"
)
configure_file (
Expand Down Expand Up @@ -248,7 +233,7 @@ elseif ( "${CMAKE_C_COMPILER_ID}" STREQUAL "Intel" )
# The -g option is useful for the Intel VTune tool, but it should be
# removed in production. Comment this line out if not in use:
# set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -g" )
set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -qopt-malloc-options=3" )
# set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -qopt-malloc-options=3" )
# check all warnings and remarks (uncomment for development only):
# set ( CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -w3 -Wremarks -Werror " )
if ( CMAKE_C_COMPILER_VERSION VERSION_LESS 19.0 )
Expand All @@ -261,7 +246,7 @@ elseif ( "${CMAKE_C_COMPILER_ID}" STREQUAL "Clang" )
endif ( )
elseif ( "${CMAKE_C_COMPILER_ID}" STREQUAL "MSVC" )
# options for MicroSoft Visual Studio
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} -wd\"4244\" -wd\"4146\" -wd\"4018\" -wd\"4996\" -wd\"4047\" -wd\"4554\"")
set (CMAKE_C_FLAGS "${CMAKE_C_FLAGS} /O2 -wd\"4244\" -wd\"4146\" -wd\"4018\" -wd\"4996\" -wd\"4047\" -wd\"4554\"")
elseif ( "${CMAKE_C_COMPILER_ID}" STREQUAL "PGI" )
# options for PGI pgcc compiler. The compiler has a bug, and the
# -DPGI_COMPILER_BUG causes GraphBLAS to use a workaround.
Expand Down Expand Up @@ -443,14 +428,18 @@ message ( STATUS "CMAKE C flags: " ${CMAKE_C_FLAGS} )

file ( GLOB DEMO_SOURCES "Demo/Source/*.c" )
add_library ( graphblasdemo SHARED ${DEMO_SOURCES} )

SET_TARGET_PROPERTIES ( graphblasdemo PROPERTIES
VERSION ${GraphBLAS_VERSION_MAJOR}.${GraphBLAS_VERSION_MINOR}.${GraphBLAS_VERSION_SUB}
SOVERSION ${GraphBLAS_VERSION_MAJOR}
C_STANDARD_REQUIRED 11 )
set_property ( TARGET graphblasdemo PROPERTY C_STANDARD 11 )
target_link_libraries ( graphblasdemo ${M_LIB} graphblas )

if ( BUILD_GRB_STATIC_LIBRARY )
add_library ( graphblasdemo_static STATIC ${DEMO_SOURCES} )
SET_TARGET_PROPERTIES ( graphblasdemo_static PROPERTIES
VERSION ${GraphBLAS_VERSION_MAJOR}.${GraphBLAS_VERSION_MINOR}.${GraphBLAS_VERSION_SUB}
C_STANDARD_REQUIRED 11 )
set_property ( TARGET graphblasdemo_static PROPERTY C_STANDARD 11 )
target_link_libraries ( graphblasdemo_static graphblas_static )
Expand Down Expand Up @@ -482,7 +471,7 @@ target_link_libraries ( openmp_demo graphblas graphblasdemo )
target_link_libraries ( mis_demo graphblas graphblasdemo )
target_link_libraries ( complex_demo graphblas graphblasdemo )
target_link_libraries ( kron_demo graphblas graphblasdemo )
target_link_libraries ( simple_demo graphblasdemo )
target_link_libraries ( simple_demo graphblasdemo )
target_link_libraries ( wildtype_demo graphblas )
target_link_libraries ( reduce_demo graphblas )
target_link_libraries ( import_demo graphblas graphblasdemo )
Expand All @@ -491,8 +480,6 @@ target_link_libraries ( import_demo graphblas graphblasdemo )
# graphblas installation location
#-------------------------------------------------------------------------------

# note that the demo libraries are not installed

if ( BUILD_GRB_STATIC_LIBRARY )

# install both the dynamic and static libraries
Expand All @@ -503,12 +490,11 @@ if ( BUILD_GRB_STATIC_LIBRARY )

else ( )

# only install the dynamic library
# only install the dynamic graphblas library
install ( TARGETS graphblas
LIBRARY DESTINATION ${CMAKE_INSTALL_LIBDIR}
PUBLIC_HEADER DESTINATION ${CMAKE_INSTALL_INCLUDEDIR}
ARCHIVE DESTINATION ${CMAKE_INSTALL_LIBDIR} )

endif ( )


4 changes: 2 additions & 2 deletions Config/GraphBLAS.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -6518,7 +6518,7 @@ GrB_Info GxB_kron // C<Mask> = accum (C, kron(A,B))
// is NULL, it is treated as the empty string.
//
// GxB_print (object, GxB_Print_Level pr) is the same as GxB_fprint, except
// that it prints the contents of the object to stdout instead of a file f.
// that it prints the contents with printf instead of fprintf to a file f.
//
// The exact content and format of what is printed is implementation-dependent,
// and will change from version to version of SuiteSparse:GraphBLAS. Do not
Expand Down Expand Up @@ -6655,7 +6655,7 @@ GrB_Info GxB_Scalar_fprint // print and check a GxB_Scalar
#endif

#if GxB_STDC_VERSION >= 201112L
#define GxB_print(object,pr) GxB_fprint(object,pr,stdout)
#define GxB_print(object,pr) GxB_fprint(object,pr,NULL)
#endif

//==============================================================================
Expand Down
8 changes: 0 additions & 8 deletions Config/README.md.in
Original file line number Diff line number Diff line change
Expand Up @@ -102,11 +102,3 @@ file. All functions, objects, and macros with the prefix GxB are extensions to
the spec. Functions, objects, and macros with prefix GB must not be accessed
by user code. They are for internal use in GraphBLAS only.


--------------------------------------------------------------------------------
## For Windows users:

This version is not compatible with Microsoft Visual Studio. Use another
compiler, or use SuiteSparse:GraphBLAS v3.1.2 instead. See the User Guide
for more details.

43 changes: 35 additions & 8 deletions Demo/Include/demos.h → Demo/Include/graphblas_demos.h
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
//------------------------------------------------------------------------------
// GraphBLAS/Demo/Include/demos.h: include file for all demo programs
// GraphBLAS/Demo/Include/graphblas_demos.h: include file for all demo programs
//------------------------------------------------------------------------------

// SuiteSparse:GraphBLAS, Timothy A. Davis, (c) 2017-2020, All Rights Reserved.
Expand Down Expand Up @@ -34,6 +34,14 @@
#pragma GCC diagnostic error "-Wswitch-default"
#endif

#ifndef GB_MICROSOFT
#if ( _MSC_VER && !__INTEL_COMPILER )
#define GB_MICROSOFT 1
#else
#define GB_MICROSOFT 0
#endif
#endif

#include "GraphBLAS.h"
#include "simple_rand.h"
#include "simple_timer.h"
Expand All @@ -54,34 +62,39 @@
#define MIN(a,b) (((a) < (b)) ? (a) : (b))
#define MAX(a,b) (((a) > (b)) ? (a) : (b))

GB_PUBLIC
GrB_Info bfs5m // BFS of a graph (using vector assign & reduce)
(
GrB_Vector *v_output, // v [i] is the BFS level of node i in the graph
GrB_Matrix A, // input graph, treated as if boolean in semiring
const GrB_Matrix A, // input graph, treated as if boolean in semiring
GrB_Index s // starting node of the BFS
) ;

GB_PUBLIC
GrB_Info bfs5m_check // BFS of a graph (using vector assign & reduce)
(
GrB_Vector *v_output, // v [i] is the BFS level of node i in the graph
GrB_Matrix A, // input graph, treated as if boolean in semiring
const GrB_Matrix A, // input graph, treated as if boolean in semiring
GrB_Index s // starting node of the BFS
) ;

GB_PUBLIC
GrB_Info bfs6 // BFS of a graph (using apply)
(
GrB_Vector *v_output, // v [i] is the BFS level of node i in the graph
const GrB_Matrix A, // input graph, treated as if boolean in semiring
GrB_Index s // starting node of the BFS
) ;

GB_PUBLIC
GrB_Info bfs6_check // BFS of a graph (using apply)
(
GrB_Vector *v_output, // v [i] is the BFS level of node i in the graph
const GrB_Matrix A, // input graph, treated as if boolean in semiring
GrB_Index s // starting node of the BFS
) ;

GB_PUBLIC
GrB_Info read_matrix // read a double-precision matrix
(
GrB_Matrix *A, // handle of matrix to create
Expand All @@ -93,27 +106,29 @@ GrB_Info read_matrix // read a double-precision matrix
bool printstuff // if true, print status to stdout
) ;

GB_PUBLIC
GrB_Info mis // compute a maximal independent set
(
GrB_Vector *iset_output, // iset(i) = true if i is in the set
const GrB_Matrix A, // symmetric Boolean matrix
int64_t seed // random number seed
) ;

GB_PUBLIC
GrB_Info mis_check // compute a maximal independent set
(
GrB_Vector *iset_output, // iset(i) = true if i is in the set
const GrB_Matrix A, // symmetric Boolean matrix
int64_t seed // random number seed
) ;

void mis_score (double *result, uint32_t *degree) ;
void mis_score2 (double *result, uint32_t *degree, double *xrand) ;

extern int32_t level ;
GB_PUBLIC
void mis_score (void *result, const void *degree) ;

void bfs_level (int32_t *result, bool *element) ;
GB_PUBLIC
void mis_score2 (void *result, const void *degree, const void *xrand) ;

GB_PUBLIC
GrB_Info random_matrix // create a random double-precision matrix
(
GrB_Matrix *A_output, // handle of matrix to create
Expand All @@ -126,6 +141,7 @@ GrB_Info random_matrix // create a random double-precision matrix
bool A_complex // if true, create a Complex matrix
) ;

GB_PUBLIC
GrB_Info get_matrix // get a matrix from stdin, or create random one
(
GrB_Matrix *A_output, // matrix to create
Expand All @@ -135,6 +151,7 @@ GrB_Info get_matrix // get a matrix from stdin, or create random one
bool boolean // if true, file is read as GrB_BOOL, else GrB_FP64
) ;

GB_PUBLIC
GrB_Info wathen // construct a random Wathen matrix
(
GrB_Matrix *A_output, // output matrix
Expand All @@ -145,12 +162,14 @@ GrB_Info wathen // construct a random Wathen matrix
double *rho_given // nx-by-ny dense matrix, if NULL use random rho
) ;

GB_PUBLIC
GrB_Info triu // C = triu (A,1)
(
GrB_Matrix *C_output, // output matrix
const GrB_Matrix A // input matrix, boolean or double
) ;

GB_PUBLIC
GrB_Info tricount // count # of triangles
(
int64_t *ntri, // # of triangles in the graph
Expand All @@ -162,6 +181,7 @@ GrB_Info tricount // count # of triangles
double t [2] // t [0]: multiply time, t [1]: reduce time
) ;

GB_PUBLIC
GrB_Info isequal_type // return GrB_SUCCESS if successful
(
bool *result, // true if A == B, false if A != B or error
Expand All @@ -170,6 +190,7 @@ GrB_Info isequal_type // return GrB_SUCCESS if successful
GrB_BinaryOp op // should be GrB_EQ_<type>, for the type of A and B
) ;

GB_PUBLIC
GrB_Info isequal // return GrB_SUCCESS if successful
(
bool *result, // true if A == B, false if A != B or error
Expand Down Expand Up @@ -200,6 +221,7 @@ typedef struct
iPageRank ;

// using a standard semiring and FP64 arithmetic
GB_PUBLIC
GrB_Info dpagerank // GrB_SUCCESS or error condition
(
PageRank **Phandle, // output: pointer to array of PageRank structs
Expand All @@ -208,6 +230,7 @@ GrB_Info dpagerank // GrB_SUCCESS or error condition

// like dpagerank but with user-defined type, operators, and semiring;
// also a stopping critirion
GB_PUBLIC
GrB_Info dpagerank2 // GrB_SUCCESS or error condition
(
PageRank **Phandle, // output: pointer to array of PageRank structs
Expand All @@ -218,18 +241,21 @@ GrB_Info dpagerank2 // GrB_SUCCESS or error condition
GrB_Desc_Value method // method to use for GrB_vxm (for testing only)
) ;

GB_PUBLIC
GrB_Info drowscale // GrB_SUCCESS or error condition
(
GrB_Matrix *Chandle, // output matrix C = rowscale (A)
GrB_Matrix A // input matrix, not modified
) ;

GB_PUBLIC
GrB_Info ipagerank // GrB_SUCCESS or error condition
(
iPageRank **Phandle, // output: pointer to array of iPageRank structs
GrB_Matrix A // input graph, not modified
) ;

GB_PUBLIC
GrB_Info irowscale // GrB_SUCCESS or error condition
(
GrB_Matrix *Chandle, // output matrix C = rowscale (A)
Expand All @@ -243,6 +269,7 @@ GrB_Info irowscale // GrB_SUCCESS or error condition
// import/export test
//------------------------------------------------------------------------------

GB_PUBLIC
GrB_Info import_test (GrB_Matrix *C_handle, int format, bool dump) ;

//------------------------------------------------------------------------------
Expand Down
Loading

0 comments on commit 5e569f2

Please sign in to comment.