Skip to content

Commit

Permalink
Comment out non distributed version of mult
Browse files Browse the repository at this point in the history
Comment out the non ditributed version of the sparse matrix
multiplication and also reduce the problem size in the test to make sure
we don't run out of memory

Signed-off-by: Shreyas Khandekar <60454060+ShreyasKhandekar@users.noreply.github.com>
  • Loading branch information
ShreyasKhandekar committed Sep 11, 2024
1 parent a9d8c6c commit 9e54d23
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions src/SparseMatrix.chpl
Original file line number Diff line number Diff line change
Expand Up @@ -57,12 +57,12 @@ module SparseMatrix {
// of nonzeroes to be passed in and updated rather than assuming that
// the multiplication is the first/only step.
//
proc sparseMatMatMult(A, B, ref spsData) {
forall ac_br in A.cols() with (merge reduce spsData) do
for (ar, a) in A.rowsAndVals(ac_br) do
for (bc, b) in B.colsAndVals(ac_br) do
spsData.add((ar, bc), a * b);
}
// proc sparseMatMatMult(A, B, ref spsData) {
// forall ac_br in A.cols() with (merge reduce spsData) do
// for (ar, a) in A.rowsAndVals(ac_br) do
// for (bc, b) in B.colsAndVals(ac_br) do
// spsData.add((ar, bc), a * b);
// }

proc sparseMatMatMult(A, B) where (!A.chpl_isNonDistributedArray() &&
!B.chpl_isNonDistributedArray()) {
Expand Down
4 changes: 2 additions & 2 deletions tests/sparse_test.py
Original file line number Diff line number Diff line change
Expand Up @@ -73,8 +73,8 @@ def matmatmult(rowsA, colsA, valsA, rowsB, colsB, valsB):
result_rows, result_cols, result_vals = zip(*[(r, c, v) for (r, c), v in result.items()])

return list(result_rows), list(result_cols), list(result_vals)
matA = ak.random_sparse_matrix(100, 1, 'CSC') # Make it fully dense to make testing easy
matB = ak.random_sparse_matrix(100, 1, 'CSR') # Make it fully dense to make testing easy
matA = ak.random_sparse_matrix(10, 1, 'CSC') # Make it fully dense to make testing easy
matB = ak.random_sparse_matrix(10, 1, 'CSR') # Make it fully dense to make testing easy
fill_vals_a = ak.randint(0, 10, matA.nnz)
fill_vals_b = ak.randint(0, 10, matB.nnz)
matA.fill_vals(fill_vals_a)
Expand Down

0 comments on commit 9e54d23

Please sign in to comment.