Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- import subprocess
- import matplotlib.pyplot as plt
- s = ["gradlew", "run", "runShadow", "--args=--problem projection --plot"]
- fignum = 1
- size = [12, 24, 48, 96, 192, 384]
- threads = [i for i in range(1, 17)]
- print(threads)
- for problem in ['projection', 'heat']:
- for max_threads in threads:
- print(problem)
- total_time = []
- creation_time = []
- initialization_time = []
- solution_time = []
- for problem_size in size:
- for stepss in [2]:
- print('a')
- # print("problem_size: ", problem_size)
- p = "--problem"
- s = "--problem-size"
- m = "--max-threads"
- steps = "--steps"
- l = ["java", "-jar", "-Xmx6G", "./dist/iga-adi-sm.jar", p, str(problem), s, str(problem_size), m, str(max_threads), steps, str(stepss), "--store-file", "false"]
- proc = subprocess.Popen(l, shell=True, stdout=subprocess.PIPE)
- output = proc.stdout.read()
- o = output.decode("utf-8")
- creation_t, initialization_t, solution_t, total_t = o.split(',')
- total_time.append(total_t)
- creation_time.append(creation_t)
- initialization_time.append(initialization_t)
- solution_time.append(solution_t)
- plt.plot(size, total_time, 'ro')
- plt.title(problem + ' ' + "total_time")
- plt.savefig('./' + str(problem) + ' total_time, thread = '+ str(max_threads) + '.png')
- plt.clf()
- plt.plot(size, creation_time, 'ro')
- plt.title(problem + ' ' + "creation_time")
- plt.savefig('./' + str(problem) + ' creation_time, thread = '+ str(max_threads) + '.png')
- plt.clf()
- plt.plot(size, initialization_time, 'ro')
- plt.title(problem + ' ' + "initialization_time")
- plt.savefig('./' + str(problem) + ' initialization_time, thread = '+ str(max_threads) + '.png')
- plt.clf()
- plt.plot(size, solution_time, 'ro')
- plt.title(problem + ' ' + "solution_time")
- plt.savefig('./' + str(problem) + ' solution_time, thread = '+ str(max_threads) + '.png')
- plt.clf()
- print("DONE")
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement