Skip to content

Add docstring for SuiteSparse:GraphBLAS 8 configs #504

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Sep 22, 2023
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
43 changes: 40 additions & 3 deletions graphblas/ss/_core.py
Original file line number Diff line number Diff line change
Expand Up @@ -122,7 +122,9 @@ class GlobalConfig(BaseConfig):
Threshold that determines when to switch to bitmap format
nthreads : int
Maximum number of OpenMP threads to use
memory_pool : List[int]
chunk : double
Control the number of threads used for small problems.
For example, ``nthreads = floor(work / chunk)``.
burble : bool
Enable diagnostic printing from SuiteSparse:GraphBLAS
print_1based : bool
Expand All @@ -134,8 +136,43 @@ class GlobalConfig(BaseConfig):
**GPU support is a work in progress--not recommended to use**
gpu_id : int
Which GPU to use; default is -1, which means do not run on the GPU.
Only available for SuiteSparse:GraphBLAS 8
Only available for SuiteSparse:GraphBLAS >=8
**GPU support is a work in progress--not recommended to use**
jit_c_control : {"off", "pause", "run", "load", "on}
Control the CPU JIT:
"off" : do not use the JIT and free all JIT kernels if loaded
"pause" : do not run JIT kernels, but keep any loaded
"run" : run JIT kernels if already loaded, but don't load or compile
"load" : able to load and run JIT kernels; may not compile
"on" : full JIT: able to compile, load, and run
Only available for SuiteSparse:GraphBLAS >=8
jit_use_cmake : bool
Whether to use cmake to compile the JIT kernels.
Only available for SuiteSparse:GraphBLAS >=8
jit_c_compiler_name : str
C compiler for JIT kernels.
Only available for SuiteSparse:GraphBLAS >=8
jit_c_compiler_flags : str
Flags for the C compiler.
Only available for SuiteSparse:GraphBLAS >=8
jit_c_linker_flags : str
Link flags for the C compiler
Only available for SuiteSparse:GraphBLAS >=8
jit_c_libraries : str
Libraries to link against.
Only available for SuiteSparse:GraphBLAS >=8
jit_c_cmake_libs : str
Libraries to link against when cmake is used.
Only available for SuiteSparse:GraphBLAS >=8
jit_c_preface : str
C code as preface to JIT kernels.
Only available for SuiteSparse:GraphBLAS >=8
jit_error_log : str
Error log file.
Only available for SuiteSparse:GraphBLAS >=8
jit_cache_path : str
The folder with the compiled kernels.
Only available for SuiteSparse:GraphBLAS >=8

Setting values to None restores the default value for most configurations.
"""
Expand All @@ -154,7 +191,7 @@ class GlobalConfig(BaseConfig):
"nthreads": (lib.GxB_GLOBAL_NTHREADS, "int"),
"chunk": (lib.GxB_GLOBAL_CHUNK, "double"),
# Memory pool control
"memory_pool": (lib.GxB_MEMORY_POOL, "int64_t[64]"),
# "memory_pool": (lib.GxB_MEMORY_POOL, "int64_t[64]"), # No longer used
# Diagnostics (skipping "printf" and "flush" for now)
"burble": (lib.GxB_BURBLE, "bool"),
"print_1based": (lib.GxB_PRINT_1BASED, "bool"),
Expand Down
4 changes: 2 additions & 2 deletions graphblas/tests/test_ss_utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -232,8 +232,8 @@ def test_global_config():
else:
with pytest.raises(ValueError, match="Unable to set default value for"):
config[k] = None
with pytest.raises(ValueError, match="Wrong number"):
config["memory_pool"] = [1, 2]
# with pytest.raises(ValueError, match="Wrong number"):
# config["memory_pool"] = [1, 2] # No longer used
assert "format" in repr(config)


Expand Down