Du kan inte välja fler än 25 ämnen Ämnen måste starta med en bokstav eller siffra, kan innehålla bindestreck ('-') och vara max 35 tecken långa.

bench.py 1.2KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748
  1. import sys
  2. import json
  3. from cassandra.cluster import Cluster
  4. sys.path.append("config/db")
  5. from db_read_csv_txs import db_insert_csv_txs
  6. import os
  7. config = json.load(open("./settings.json"))
  8. cluster = Cluster(config['cassandra_addresses'],
  9. port=config['cassandra_port'])
  10. session = cluster.connect(config['cassandra_keyspace'])
  11. print(f"Connection OK")
  12. file = "/home/osboxes/Downloads/zec_tx_inputs.csv"
  13. num_rows = 128
  14. db_insert_csv_txs(config, file, skip=0, limit=num_rows)
  15. algorithms = [
  16. 'rik_merge',
  17. 'sve_merge',
  18. 'hoc_merge',
  19. 'nik_merge',
  20. 'rob_merge',
  21. 'agf_merge',
  22. 'agf_opt_merge',
  23. 'che_merge',
  24. 'ale_merge',
  25. 'nik_rew_merge_skip'
  26. ]
  27. for algo in algorithms:
  28. os.system(f"mkdir -p benchmarks/partition/{algo}")
  29. for i in range(16):
  30. for algo in algorithms:
  31. os.system(f"ALGO={algo} ./submit_partition.sh | sed '1d' | sed '2d' > benchmarks/partition/{algo}/{num_rows}.txt")
  32. os.system(f"rm -rf ./checkpoints")
  33. #os.system(f"./submit_graph.sh | sed '1d' | sed '2d' > benchmarks/graph/{num_rows}.txt")
  34. #os.system(f"rm -rf ./checkpoints")
  35. db_insert_csv_txs(config, file, skip=num_rows, limit=num_rows*2)
  36. num_rows = num_rows*2
  37. print(num_rows)