Skip to content
Merged
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
13 changes: 9 additions & 4 deletions benchmarks/sparse.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,9 +28,11 @@ def compare_scipy(left, right, rtol=1e-9, atol=0.0, equal_nan=False):
return True


def time_ak_sparse(N, trials, dtype, seed):
print(">>> arkouda {} sparse".format(dtype))
def time_ak_sparse(N_per_locale, trials, dtype, seed):
cfg = ak.get_config()
N = N_per_locale * cfg["numNodes"]

print(">>> arkouda {} sparse".format(dtype))
print("numLocales = {}, numNodes {}, N = {:,}".format(cfg["numLocales"], cfg["numNodes"], N))

nnz = N * 10
Expand Down Expand Up @@ -66,7 +68,10 @@ def time_ak_sparse(N, trials, dtype, seed):
print("Average CSCxCSR time = {:.4f} seconds".format(np.mean(multiplication_times)))


def time_np_sparse(N, trials, dtype, seed):
def time_np_sparse(N_per_locale, trials, dtype, seed):
cfg = ak.get_config()
N = N_per_locale * cfg["numNodes"]

print(">>> numpy {} sparse".format(dtype))
print("N = {:,}".format(N))

Expand Down Expand Up @@ -145,7 +150,7 @@ def create_parser():
parser = argparse.ArgumentParser(description="Benchmark sparse matrix creation and multiplication.")
parser.add_argument("hostname", type=str, help="Name of the Arkouda server")
parser.add_argument("port", type=int, help="Port of the Arkouda server")
parser.add_argument("-n", "--size", type=int, default=(10**6), help="Size of the sparse matrices")
parser.add_argument("-n", "--size", type=int, default=62500, help="Size of the sparse matrices")
parser.add_argument("-t", "--trials", type=int, default=3, help="Number of trials for benchmarking")
parser.add_argument(
"-d", "--dtype", default="int64", help="Dtype of array ({})".format(", ".join(TYPES))
Expand Down
Loading