Skip to content

Commit 000a873

Browse files
author
Will Kimmerer
committed
some fixes for monoids and bench
1 parent 3095f39 commit 000a873

File tree

4 files changed

+316
-1
lines changed

4 files changed

+316
-1
lines changed

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,6 @@ deps/deps.jl
44
docs/build/
55
docs/site/
66
.vscode
7-
Manifest.toml
87
LocalPreferences.toml
98
benchmarks/results.txt
9+
/Manifest.toml

benchmarks/benchmarks2.jl

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -81,6 +81,10 @@ function singlebench(pathornum)
8181
end
8282
name = basename(path)
8383
A = SuiteSparseGraphBLAS.mmread(path)
84+
if eltype(A) == Bool
85+
A = Int64.(A)
86+
end
87+
GC.gc()
8488
printstyled(stdout, "\n#################################################################################\n"; bold=true, color=:green)
8589
printstyled(stdout, "Benchmarking $name:\n"; bold=true, color=:green)
8690
printstyled(stdout, "#################################################################################\n"; bold=true, color=:green)

docs/Manifest.toml

Lines changed: 309 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,309 @@
1+
# This file is machine-generated - editing it directly is not advised
2+
3+
[[ANSIColoredPrinters]]
4+
git-tree-sha1 = "574baf8110975760d391c710b6341da1afa48d8c"
5+
uuid = "a4c015fc-c6ff-483c-b24f-f7ea428134e9"
6+
version = "0.0.1"
7+
8+
[[ArgTools]]
9+
uuid = "0dad84c5-d112-42e6-8d28-ef12dabb789f"
10+
11+
[[Artifacts]]
12+
uuid = "56f22d72-fd6d-98f1-02f0-08ddc0907c33"
13+
14+
[[Base64]]
15+
uuid = "2a0f44e3-6c83-55bd-87e4-b1978d98bd5f"
16+
17+
[[ChainRulesCore]]
18+
deps = ["Compat", "LinearAlgebra", "SparseArrays"]
19+
git-tree-sha1 = "9950387274246d08af38f6eef8cb5480862a435f"
20+
uuid = "d360d2e6-b24c-11e9-a2a3-2a2ae2dbcce4"
21+
version = "1.14.0"
22+
23+
[[ChangesOfVariables]]
24+
deps = ["ChainRulesCore", "LinearAlgebra", "Test"]
25+
git-tree-sha1 = "bf98fa45a0a4cee295de98d4c1462be26345b9a1"
26+
uuid = "9e997f8a-9a97-42d5-a9f1-ce6bfc15e2c0"
27+
version = "0.1.2"
28+
29+
[[Compat]]
30+
deps = ["Base64", "Dates", "DelimitedFiles", "Distributed", "InteractiveUtils", "LibGit2", "Libdl", "LinearAlgebra", "Markdown", "Mmap", "Pkg", "Printf", "REPL", "Random", "SHA", "Serialization", "SharedArrays", "Sockets", "SparseArrays", "Statistics", "Test", "UUIDs", "Unicode"]
31+
git-tree-sha1 = "96b0bc6c52df76506efc8a441c6cf1adcb1babc4"
32+
uuid = "34da2185-b29b-5c13-b0c7-acf172513d20"
33+
version = "3.42.0"
34+
35+
[[CompilerSupportLibraries_jll]]
36+
deps = ["Artifacts", "Libdl"]
37+
uuid = "e66e0078-7015-5450-92f7-15fbd957f2ae"
38+
39+
[[Dates]]
40+
deps = ["Printf"]
41+
uuid = "ade2ca70-3891-5945-98fb-dc099432e06a"
42+
43+
[[DelimitedFiles]]
44+
deps = ["Mmap"]
45+
uuid = "8bb1440f-4735-579b-a4ab-409b98df4dab"
46+
47+
[[Distributed]]
48+
deps = ["Random", "Serialization", "Sockets"]
49+
uuid = "8ba89e20-285c-5b6f-9357-94700520ee1b"
50+
51+
[[DocStringExtensions]]
52+
deps = ["LibGit2"]
53+
git-tree-sha1 = "b19534d1895d702889b219c382a6e18010797f0b"
54+
uuid = "ffbed154-4ef7-542d-bbb7-c09d3a79fcae"
55+
version = "0.8.6"
56+
57+
[[Documenter]]
58+
deps = ["ANSIColoredPrinters", "Base64", "Dates", "DocStringExtensions", "IOCapture", "InteractiveUtils", "JSON", "LibGit2", "Logging", "Markdown", "REPL", "Test", "Unicode"]
59+
git-tree-sha1 = "f425293f7e0acaf9144de6d731772de156676233"
60+
uuid = "e30172f5-a6a5-5a46-863b-614d45cd2de4"
61+
version = "0.27.10"
62+
63+
[[Downloads]]
64+
deps = ["ArgTools", "LibCURL", "NetworkOptions"]
65+
uuid = "f43a241f-c20a-4ad4-852c-f6b1247861c6"
66+
67+
[[Formatting]]
68+
deps = ["Printf"]
69+
git-tree-sha1 = "8339d61043228fdd3eb658d86c926cb282ae72a8"
70+
uuid = "59287772-0a20-5a39-b81b-1366585eb4c0"
71+
version = "0.4.2"
72+
73+
[[HyperSparseMatrices]]
74+
deps = ["SparseArrays", "StorageOrders"]
75+
git-tree-sha1 = "da26ff1f6a816f7a29ceb35df584068df517e8d1"
76+
uuid = "c7efdb1c-7caa-4c7d-9b5e-9093f9323c7c"
77+
version = "0.2.0"
78+
79+
[[IOCapture]]
80+
deps = ["Logging", "Random"]
81+
git-tree-sha1 = "f7be53659ab06ddc986428d3a9dcc95f6fa6705a"
82+
uuid = "b5f81e59-6552-4d32-b1f0-c071b021bf89"
83+
version = "0.2.2"
84+
85+
[[InteractiveUtils]]
86+
deps = ["Markdown"]
87+
uuid = "b77e0a4c-d291-57a0-90e8-8db25a27a240"
88+
89+
[[InverseFunctions]]
90+
deps = ["Test"]
91+
git-tree-sha1 = "91b5dcf362c5add98049e6c29ee756910b03051d"
92+
uuid = "3587e190-3f89-42d0-90ee-14403ec27112"
93+
version = "0.1.3"
94+
95+
[[IrrationalConstants]]
96+
git-tree-sha1 = "7fd44fd4ff43fc60815f8e764c0f352b83c49151"
97+
uuid = "92d709cd-6900-40b7-9082-c6be49f344b6"
98+
version = "0.1.1"
99+
100+
[[JLLWrappers]]
101+
deps = ["Preferences"]
102+
git-tree-sha1 = "abc9885a7ca2052a736a600f7fa66209f96506e1"
103+
uuid = "692b3bcd-3c85-4b1f-b108-f13ce0eb3210"
104+
version = "1.4.1"
105+
106+
[[JSON]]
107+
deps = ["Dates", "Mmap", "Parsers", "Unicode"]
108+
git-tree-sha1 = "3c837543ddb02250ef42f4738347454f95079d4e"
109+
uuid = "682c06a0-de6a-54ab-a142-c8b1cf79cde6"
110+
version = "0.21.3"
111+
112+
[[LaTeXStrings]]
113+
git-tree-sha1 = "f2355693d6778a178ade15952b7ac47a4ff97996"
114+
uuid = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
115+
version = "1.3.0"
116+
117+
[[Latexify]]
118+
deps = ["Formatting", "InteractiveUtils", "LaTeXStrings", "MacroTools", "Markdown", "Printf", "Requires"]
119+
git-tree-sha1 = "a8f4f279b6fa3c3c4f1adadd78a621b13a506bce"
120+
uuid = "23fbe1c1-3f47-55db-b15f-69d7ec21a316"
121+
version = "0.15.9"
122+
123+
[[LibCURL]]
124+
deps = ["LibCURL_jll", "MozillaCACerts_jll"]
125+
uuid = "b27032c2-a3e7-50c8-80cd-2d36dbcbfd21"
126+
127+
[[LibCURL_jll]]
128+
deps = ["Artifacts", "LibSSH2_jll", "Libdl", "MbedTLS_jll", "Zlib_jll", "nghttp2_jll"]
129+
uuid = "deac9b47-8bc7-5906-a0fe-35ac56dc84c0"
130+
131+
[[LibGit2]]
132+
deps = ["Base64", "NetworkOptions", "Printf", "SHA"]
133+
uuid = "76f85450-5226-5b5a-8eaa-529ad045b433"
134+
135+
[[LibSSH2_jll]]
136+
deps = ["Artifacts", "Libdl", "MbedTLS_jll"]
137+
uuid = "29816b5a-b9ab-546f-933c-edad1886dfa8"
138+
139+
[[Libdl]]
140+
uuid = "8f399da3-3557-5675-b5ff-fb832c97cbdb"
141+
142+
[[LinearAlgebra]]
143+
deps = ["Libdl", "libblastrampoline_jll"]
144+
uuid = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
145+
146+
[[LogExpFunctions]]
147+
deps = ["ChainRulesCore", "ChangesOfVariables", "DocStringExtensions", "InverseFunctions", "IrrationalConstants", "LinearAlgebra"]
148+
git-tree-sha1 = "58f25e56b706f95125dcb796f39e1fb01d913a71"
149+
uuid = "2ab3a3ac-af41-5b50-aa03-7779005ae688"
150+
version = "0.3.10"
151+
152+
[[Logging]]
153+
uuid = "56ddb016-857b-54e1-b83d-db4d58db5568"
154+
155+
[[MacroTools]]
156+
deps = ["Markdown", "Random"]
157+
git-tree-sha1 = "3d3e902b31198a27340d0bf00d6ac452866021cf"
158+
uuid = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
159+
version = "0.5.9"
160+
161+
[[Markdown]]
162+
deps = ["Base64"]
163+
uuid = "d6f4376e-aef5-505a-96c1-9c027394607a"
164+
165+
[[MbedTLS_jll]]
166+
deps = ["Artifacts", "Libdl"]
167+
uuid = "c8ffd9c3-330d-5841-b78e-0817d7145fa1"
168+
169+
[[Mmap]]
170+
uuid = "a63ad114-7e13-5084-954f-fe012c677804"
171+
172+
[[MozillaCACerts_jll]]
173+
uuid = "14a3606d-f60d-562e-9121-12d972cd8159"
174+
175+
[[NetworkOptions]]
176+
uuid = "ca575930-c2e3-43a9-ace4-1e988b2c1908"
177+
178+
[[OpenBLAS_jll]]
179+
deps = ["Artifacts", "CompilerSupportLibraries_jll", "Libdl"]
180+
uuid = "4536629a-c528-5b80-bd46-f80d51c5b363"
181+
182+
[[OpenLibm_jll]]
183+
deps = ["Artifacts", "Libdl"]
184+
uuid = "05823500-19ac-5b8b-9628-191a04bc5112"
185+
186+
[[OpenSpecFun_jll]]
187+
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"]
188+
git-tree-sha1 = "13652491f6856acfd2db29360e1bbcd4565d04f1"
189+
uuid = "efe28fd5-8261-553b-a9e1-b2916fc3738e"
190+
version = "0.5.5+0"
191+
192+
[[Parsers]]
193+
deps = ["Dates"]
194+
git-tree-sha1 = "621f4f3b4977325b9128d5fae7a8b4829a0c2222"
195+
uuid = "69de0a69-1ddd-5017-9359-2bf0b02dc9f0"
196+
version = "2.2.4"
197+
198+
[[Pkg]]
199+
deps = ["Artifacts", "Dates", "Downloads", "LibGit2", "Libdl", "Logging", "Markdown", "Printf", "REPL", "Random", "SHA", "Serialization", "TOML", "Tar", "UUIDs", "p7zip_jll"]
200+
uuid = "44cfe95a-1eb2-52ea-b672-e2afdf69b78f"
201+
202+
[[Preferences]]
203+
deps = ["TOML"]
204+
git-tree-sha1 = "d3538e7f8a790dc8903519090857ef8e1283eecd"
205+
uuid = "21216c6a-2e73-6563-6e65-726566657250"
206+
version = "1.2.5"
207+
208+
[[Printf]]
209+
deps = ["Unicode"]
210+
uuid = "de0858da-6303-5e67-8744-51eddeeeb8d7"
211+
212+
[[REPL]]
213+
deps = ["InteractiveUtils", "Markdown", "Sockets", "Unicode"]
214+
uuid = "3fa0cd96-eef1-5676-8a61-b3b8758bbffb"
215+
216+
[[Random]]
217+
deps = ["SHA", "Serialization"]
218+
uuid = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
219+
220+
[[Requires]]
221+
deps = ["UUIDs"]
222+
git-tree-sha1 = "838a3a4188e2ded87a4f9f184b4b0d78a1e91cb7"
223+
uuid = "ae029012-a4dd-5104-9daa-d747884805df"
224+
version = "1.3.0"
225+
226+
[[SHA]]
227+
uuid = "ea8e919c-243c-51af-8825-aaa63cd721ce"
228+
229+
[[SSGraphBLAS_jll]]
230+
deps = ["Artifacts", "CompilerSupportLibraries_jll", "JLLWrappers", "Libdl", "Pkg"]
231+
git-tree-sha1 = "0ed5031019c83ac7b1d9c747dbd40123b93d5c5a"
232+
uuid = "7ed9a814-9cab-54e9-8e9e-d9e95b4d61b1"
233+
version = "6.2.1+0"
234+
235+
[[Serialization]]
236+
uuid = "9e88b42a-f829-5b0c-bbe9-9e923198166b"
237+
238+
[[SharedArrays]]
239+
deps = ["Distributed", "Mmap", "Random", "Serialization"]
240+
uuid = "1a1011a3-84de-559e-8e89-a11a2f7dc383"
241+
242+
[[Sockets]]
243+
uuid = "6462fe0b-24de-5631-8697-dd941f90decc"
244+
245+
[[SparseArrays]]
246+
deps = ["LinearAlgebra", "Random"]
247+
uuid = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
248+
249+
[[SpecialFunctions]]
250+
deps = ["ChainRulesCore", "IrrationalConstants", "LogExpFunctions", "OpenLibm_jll", "OpenSpecFun_jll"]
251+
git-tree-sha1 = "5ba658aeecaaf96923dce0da9e703bd1fe7666f9"
252+
uuid = "276daf66-3868-5448-9aa4-cd146d93841b"
253+
version = "2.1.4"
254+
255+
[[Statistics]]
256+
deps = ["LinearAlgebra", "SparseArrays"]
257+
uuid = "10745b16-79ce-11e8-11f9-7d13ad32a3b2"
258+
259+
[[StorageOrders]]
260+
git-tree-sha1 = "365181758ec1084fecf147b72206f81a1310c8b7"
261+
uuid = "e9177fbf-8fde-426c-9425-4eed0f22262a"
262+
version = "0.2.0"
263+
264+
[[SuiteSparse]]
265+
deps = ["Libdl", "LinearAlgebra", "Serialization", "SparseArrays"]
266+
uuid = "4607b0f0-06f3-5cda-b6b1-a6196a1729e9"
267+
268+
[[SuiteSparseGraphBLAS]]
269+
deps = ["ChainRulesCore", "HyperSparseMatrices", "Libdl", "LinearAlgebra", "MacroTools", "Preferences", "Random", "SSGraphBLAS_jll", "Serialization", "SparseArrays", "SpecialFunctions", "StorageOrders", "SuiteSparse"]
270+
git-tree-sha1 = "9a8bd44246074bfdbb7c566d11b5e5caf3684b7c"
271+
repo-rev = "master"
272+
repo-url = "https://github.com/JuliaSparse/SuiteSparseGraphBLAS.jl.git"
273+
uuid = "c2e53296-7b14-11e9-1210-bddfa8111e1d"
274+
version = "0.5.0"
275+
276+
[[TOML]]
277+
deps = ["Dates"]
278+
uuid = "fa267f1f-6049-4f14-aa54-33bafae1ed76"
279+
280+
[[Tar]]
281+
deps = ["ArgTools", "SHA"]
282+
uuid = "a4e569a6-e804-4fa4-b0f3-eef7a1d5b13e"
283+
284+
[[Test]]
285+
deps = ["InteractiveUtils", "Logging", "Random", "Serialization"]
286+
uuid = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
287+
288+
[[UUIDs]]
289+
deps = ["Random", "SHA"]
290+
uuid = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"
291+
292+
[[Unicode]]
293+
uuid = "4ec0a83e-493e-50e2-b9ac-8f72acf5a8f5"
294+
295+
[[Zlib_jll]]
296+
deps = ["Libdl"]
297+
uuid = "83775a58-1f1d-513f-b197-d71354ab007a"
298+
299+
[[libblastrampoline_jll]]
300+
deps = ["Artifacts", "Libdl", "OpenBLAS_jll"]
301+
uuid = "8e850b90-86db-534c-a0d3-1478176c7d93"
302+
303+
[[nghttp2_jll]]
304+
deps = ["Artifacts", "Libdl"]
305+
uuid = "8e850ede-7688-5339-a07c-302acd2aaf8d"
306+
307+
[[p7zip_jll]]
308+
deps = ["Artifacts", "Libdl"]
309+
uuid = "3f19e933-33d8-53b3-aaab-bd5110c3b7a0"

src/operators/monoids.jl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -105,7 +105,9 @@ end
105105
# because users will mostly be exposed to the higher level interface.
106106

107107
@monoid (+) GrB_PLUS nB id=>zero
108+
(::Monoid{typeof(+)})(::Type{Bool}) = LOR_MONOID_BOOL
108109
@monoid (*) GrB_TIMES I id=>one term=>zero
110+
(::Monoid{typeof(*)})(::Type{Bool}) = LAND_MONOID_BOOL
109111
@monoid (*) GrB_TIMES FZ id=>one
110112

111113
@monoid any GxB_ANY T id=>one term=>one # This is technically incorrect. The identity and terminal are *ANY* value in the domain.

0 commit comments

Comments
 (0)