@@ -145,143 +145,98 @@ function singlebench(pathornum)
145
145
throw (ErrorException (" Argument is not a path or SuiteSparseMatrixCollection ID number" ))
146
146
end
147
147
name = basename (path)
148
- # A = SuiteSparseGraphBLAS.mmread(path)
149
- # if eltype(A) == Bool
150
- # A = Int64.(A)
151
- # end
152
- # GC.gc()
153
- # printstyled(stdout, "\n#################################################################################\n"; bold=true, color=:green)
154
- # printstyled(stdout, "Benchmarking $name:\n"; bold=true, color=:green)
155
- # printstyled(stdout, "#################################################################################\n"; bold=true, color=:green)
148
+ A = SuiteSparseGraphBLAS. mmread (path)
149
+ if eltype (A) == Bool
150
+ A = Int64 .(A)
151
+ end
152
+ GC. gc ()
153
+ printstyled (stdout , " \n #################################################################################\n " ; bold= true , color= :green )
154
+ printstyled (stdout , " Benchmarking $name :\n " ; bold= true , color= :green )
155
+ printstyled (stdout , " #################################################################################\n " ; bold= true , color= :green )
156
156
157
- # printstyled(stdout, "\nSparse * Vec\n"; bold=true)
158
- # println(stdout, "################################")
159
- # flush(stdout)
160
- # B = rand(eltype(A), size(A, 2))
161
- # B = GBVector(B)
162
- #
163
- # gbresultsR = runthreaded(A, B; accumdenseoutput=true)
164
- # gbset(A, :format, SuiteSparseGraphBLAS.BYCOL)
165
- # diag(A)
166
- # gbresultsC = runthreaded(A, B; accumdenseoutput=true)
167
- # SAresults = mxm(SparseMatrixCSC(A), Vector(B))
168
- # printstyled(stdout, "\nRESULTS, Sparse * DenseVec: \n"; bold=true, color=:green)
169
- # println(stdout, "################################")
170
- # println(stdout, "A by row (1, 2, 16 thread): $gbresultsR")
171
- # println(stdout, "A by col (1, 2, 16 thread): $gbresultsC")
172
- # println(stdout, "SparseArrays: $SAresults")
173
- # flush(stdout)
157
+ printstyled (stdout , " \n Sparse * Vec\n " ; bold= true )
158
+ println (stdout , " ################################" )
159
+ flush (stdout )
160
+ B = rand (eltype (A), size (A, 2 ))
161
+ B = GBVector (B)
174
162
#
175
- # printstyled(stdout, "\nSparse * (n x 2)\n"; bold=true)
176
- # println(stdout, "################################")
177
- # flush(stdout)
178
- # B = GBMatrix(rand(eltype(A), size(A, 2), 2))
179
- # gbset(A, :format, SuiteSparseGraphBLAS.BYROW)
180
- # diag(A)
181
- # gbresultsR = runthreaded(A, B; accumdenseoutput=true)
182
- # gbset(A, :format, SuiteSparseGraphBLAS.BYCOL)
183
- # diag(A)
184
- # gbresultsC = runthreaded(A, B; accumdenseoutput=true)
185
- # SAresults = mxm(SparseMatrixCSC(A), Matrix(B))
186
- # printstyled(stdout, "\nRESULTS, Sparse * n x 2 Dense: \n"; bold=true, color=:green)
187
- # println(stdout, "################################")
188
- # println(stdout, "A by row (1, 2, 16 thread): $gbresultsR")
189
- # println(stdout, "A by col (1, 2, 16 thread): $gbresultsC")
190
- # println(stdout, "SparseArrays: $SAresults")
191
- # flush(stdout)
163
+ gbresultsR = runthreaded (A, B; accumdenseoutput= true )
164
+ gbset (A, :format , SuiteSparseGraphBLAS. BYCOL)
165
+ diag (A)
166
+ gbresultsC = runthreaded (A, B; accumdenseoutput= true )
167
+ SAresults = mxm (SparseMatrixCSC (A), Vector (B))
168
+ printstyled (stdout , " \n RESULTS, Sparse * DenseVec: \n " ; bold= true , color= :green )
169
+ println (stdout , " ################################" )
170
+ println (stdout , " A by row (1, 2, 16 thread): $gbresultsR " )
171
+ println (stdout , " A by col (1, 2, 16 thread): $gbresultsC " )
172
+ println (stdout , " SparseArrays: $SAresults " )
173
+ flush (stdout )
192
174
#
193
- # printstyled(stdout, "\nSparse * (n x 32 )\n"; bold=true)
194
- # println(stdout, "################################")
195
- # flush(stdout)
196
- # B = GBMatrix(rand(eltype(A), size(A, 2), 32 ))
197
- # gbset(A, :format, SuiteSparseGraphBLAS.BYROW)
198
- # diag(A)
199
- # gbresultsR = runthreaded(A, B; accumdenseoutput=true)
200
- # gbset(A, :format, SuiteSparseGraphBLAS.BYCOL)
201
- # diag(A)
202
- # gbresultsC = runthreaded(A, B; accumdenseoutput=true)
203
- # SAresults = mxm(SparseMatrixCSC(A), Matrix(B))
204
- # printstyled(stdout, "\nRESULTS, Sparse * n x 32 Dense: \n"; bold=true, color=:green)
205
- # println(stdout, "################################")
206
- # println(stdout, "A by row (1, 2, 16 thread): $gbresultsR")
207
- # println(stdout, "A by col (1, 2, 16 thread): $gbresultsC")
208
- # println(stdout, "SparseArrays: $SAresults")
209
- # flush(stdout)
175
+ printstyled (stdout , " \n Sparse * (n x 2 )\n " ; bold= true )
176
+ println (stdout , " ################################" )
177
+ flush (stdout )
178
+ B = GBMatrix (rand (eltype (A), size (A, 2 ), 2 ))
179
+ gbset (A, :format , SuiteSparseGraphBLAS. BYROW)
180
+ diag (A)
181
+ gbresultsR = runthreaded (A, B; accumdenseoutput= true )
182
+ gbset (A, :format , SuiteSparseGraphBLAS. BYCOL)
183
+ diag (A)
184
+ gbresultsC = runthreaded (A, B; accumdenseoutput= true )
185
+ SAresults = mxm (SparseMatrixCSC (A), Matrix (B))
186
+ printstyled (stdout , " \n RESULTS, Sparse * n x 2 Dense: \n " ; bold= true , color= :green )
187
+ println (stdout , " ################################" )
188
+ println (stdout , " A by row (1, 2, 16 thread): $gbresultsR " )
189
+ println (stdout , " A by col (1, 2, 16 thread): $gbresultsC " )
190
+ println (stdout , " SparseArrays: $SAresults " )
191
+ flush (stdout )
210
192
#
211
- # printstyled(stdout, "\nSparse * Sparse'"; bold=true)
212
- # println(stdout, "################################")
213
- # flush(stdout)
214
- # gbset(A, :format, SuiteSparseGraphBLAS.BYROW)
215
- # diag(A)
216
- # gbresultsR = runthreaded(A, transpose(A))
217
- # gbset(A, :format, SuiteSparseGraphBLAS.BYCOL)
218
- # diag(A)
219
- # gbresultsC = runthreaded(A, transpose(A))
220
- # A2 = SparseMatrixCSC(A)
221
- # SAresults = mxm(A2, transpose(A2))
222
- # println(stdout, )
223
- # printstyled(stdout, "\nRESULTS, Sparse * Sparse: \n"; bold=true, color=:green)
224
- # println(stdout, "################################")
225
- # println(stdout, "A by row (1, 2, 16 thread): $gbresultsR")
226
- # println(stdout, "A by col (1, 2, 16 thread): $gbresultsC")
227
- # println(stdout, "SparseArrays: $SAresults")
228
- # flush(stdout)
193
+ printstyled (stdout , " \n Sparse * (n x 32)\n " ; bold= true )
194
+ println (stdout , " ################################" )
195
+ flush (stdout )
196
+ B = GBMatrix (rand (eltype (A), size (A, 2 ), 32 ))
197
+ gbset (A, :format , SuiteSparseGraphBLAS. BYROW)
198
+ diag (A)
199
+ gbresultsR = runthreaded (A, B; accumdenseoutput= true )
200
+ gbset (A, :format , SuiteSparseGraphBLAS. BYCOL)
201
+ diag (A)
202
+ gbresultsC = runthreaded (A, B; accumdenseoutput= true )
203
+ SAresults = mxm (SparseMatrixCSC (A), Matrix (B))
204
+ printstyled (stdout , " \n RESULTS, Sparse * n x 32 Dense: \n " ; bold= true , color= :green )
205
+ println (stdout , " ################################" )
206
+ println (stdout , " A by row (1, 2, 16 thread): $gbresultsR " )
207
+ println (stdout , " A by col (1, 2, 16 thread): $gbresultsC " )
208
+ println (stdout , " SparseArrays: $SAresults " )
209
+ flush (stdout )
229
210
#
230
- # printstyled(stdout, "\nSparse * Sparse'"; bold=true)
231
- # println(stdout, "################################")
232
- # flush(stdout)
233
- # gbset(A, :format, SuiteSparseGraphBLAS.BYROW)
234
- # diag(A)
235
- # gbresultsR = runthreaded(A, transpose(A))
236
- # gbset(A, :format, SuiteSparseGraphBLAS.BYCOL)
237
- # diag(A)
238
- # gbresultsC = runthreaded(A, transpose(A))
239
- # A2 = SparseMatrixCSC(A)
240
- # SAresults = mxm(A2, transpose(A2))
241
- # println(stdout, )
242
- # printstyled(stdout, "\nRESULTS, Sparse * Sparse: \n"; bold=true, color=:green)
243
- # println(stdout, "################################")
244
- # println(stdout, "A by row (1, 2, 16 thread): $gbresultsR")
245
- # println(stdout, "A by col (1, 2, 16 thread): $gbresultsC")
246
- # println(stdout, "SparseArrays: $SAresults")
247
- # flush(stdout)
248
- # printstyled(stdout, "\nC = copy(transpose(A))"; bold=true)
249
- # println(stdout, "################################")
250
- # flush(stdout)
251
- # gbset(A, :format, SuiteSparseGraphBLAS.BYROW)
252
- # diag(A)
253
- # gbresultsR = runthreadedt(A)
254
- # gbset(A, :format, SuiteSparseGraphBLAS.BYCOL)
255
- # diag(A)
256
- # gbresultsC = runthreadedt(A)
257
- # A2 = SparseMatrixCSC(A)
258
- # SAresults = tpose(A2)
259
- # println(stdout, )
260
- # printstyled(stdout, "\nRESULTS, C = copy(transpose(A)): \n"; bold=true, color=:green)
261
- # println(stdout, "################################")
262
- # println(stdout, "A by row (1, 2, 16 thread): $gbresultsR")
263
- # println(stdout, "A by col (1, 2, 16 thread): $gbresultsC")
264
- # println(stdout, "SparseArrays: $SAresults")
265
- # flush(stdout)
266
-
267
-
268
- printstyled (stdout , " \n C[I, J] = A)" ; bold= true )
211
+ printstyled (stdout , " \n Sparse * Sparse'" ; bold= true )
269
212
println (stdout , " ################################" )
270
- C = SuiteSparseGraphBLAS. wait (SuiteSparseGraphBLAS. gbrand (Float64, 25_000_000 , 25_000_000 , 5.76e-8 ))
271
- A = SuiteSparseGraphBLAS. wait (SuiteSparseGraphBLAS. gbrand (Float64, 5_000 , 5_000 , 0.002 ))
272
- I = rand (1 : size (C, 1 ), size (A, 1 ))
273
- J = rand (1 : size (C, 2 ), size (A, 2 ))
274
-
275
213
flush (stdout )
276
214
gbset (A, :format , SuiteSparseGraphBLAS. BYROW)
277
- gbset (C, :format , SuiteSparseGraphBLAS. BYROW)
278
- SuiteSparseGraphBLAS. wait (A)
279
- gbresultsR = runthreadedt (A, transpose (A))
215
+ diag (A)
216
+ gbresultsR = runthreaded (A, transpose (A))
280
217
gbset (A, :format , SuiteSparseGraphBLAS. BYCOL)
281
- gbset (C, :format , SuiteSparseGraphBLAS. BYCOL)
282
- SuiteSparseGraphBLAS. wait (A)
283
- gbresultsC = runthreadedt (A, transpose (A))
218
+ diag (A)
219
+ gbresultsC = runthreaded (A, transpose (A))
284
220
A2 = SparseMatrixCSC (A)
221
+ SAresults = mxm (A2, transpose (A2))
222
+ println (stdout , )
223
+ printstyled (stdout , " \n RESULTS, Sparse * n x 32 Dense: \n " ; bold= true , color= :green )
224
+ println (stdout , " ################################" )
225
+ println (stdout , " A by row (1, 2, 16 thread): $gbresultsR " )
226
+ println (stdout , " A by col (1, 2, 16 thread): $gbresultsC " )
227
+ println (stdout , " SparseArrays: $SAresults " )
228
+ flush (stdout )
229
+
230
+ printstyled (stdout , " \n C = copy(transpose(A))" ; bold= true )
231
+ println (stdout , " ################################" )
232
+ flush (stdout )
233
+ gbset (A, :format , SuiteSparseGraphBLAS. BYROW)
234
+ diag (A)
235
+ gbresultsR = runthreadedt (A)
236
+ gbset (A, :format , SuiteSparseGraphBLAS. BYCOL)
237
+ diag (A)
238
+ gbresultsC = runthreadedt (A)
239
+ A2 = SparseMatrixCSC (A)
285
240
SAresults = tpose (A2)
286
241
println (stdout , )
287
242
printstyled (stdout , " \n RESULTS, C = copy(transpose(A)): \n " ; bold= true , color= :green )
0 commit comments