Skip to content

Commit

Permalink
fixes for suitesparse apps
Browse files Browse the repository at this point in the history
  • Loading branch information
Kalhan Koul committed Dec 14, 2023
1 parent 80dae0c commit 2c699f9
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion scripts/formatting/datastructure_suitesparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,7 +139,7 @@ def write_datastructure_bench(args, tensor, out_path, tiles=None):
vec = vec.toarray().flatten()
formatWriter.writeout_separate_vec(vec, dirname, tensorname)
elif "mat_vecmul" == args.benchname or "mat_vecmul_ji" in args.benchname:
formatWriter.writeout_separate_sparse_only(coo, dirname, tensorname, format_str="ss10")
formatWriter.writeout_separate_sparse_only(coo, dirname, tensorname, format_str="ss01")
if not args.no_gen_other:
tensorname = 'c'
vec = scipy.sparse.random(shape[1], 1, density=args.density, data_rvs=np.ones)
Expand Down
4 changes: 2 additions & 2 deletions scripts/util/util.py
Original file line number Diff line number Diff line change
Expand Up @@ -496,7 +496,7 @@ def writeout_separate_vec(self, vec, dir_path, tensorname, format_str="s0", hw=T
else:
filename = os.path.join(vec_dir, "tensor_" + tensorname + "_mode_0_seg")
with open(filename, "w") as ofile:
ofile.write(array_newline_str([0, len(vec_sp) + 1]))
ofile.write(array_newline_str([0, len(vec_sp)]))

if not hw:
filename = os.path.join(vec_dir, tensorname + "0_crd.txt")
Expand Down Expand Up @@ -535,7 +535,7 @@ def writeout_separate_vec(self, vec, dir_path, tensorname, format_str="s0", hw=T
ofile.write(array_newline_str(vec_shape))

def writeout_separate_sparse_only(self, coo, dir_path, tensorname, format_str="ss01", hw=True):

if format_str == "ss01":
dcsr_dir = Path(dir_path)
dcsr_dir.mkdir(parents=True, exist_ok=True, mode=0o777)
Expand Down

0 comments on commit 2c699f9

Please sign in to comment.