-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathPythonGUI.py
54 lines (37 loc) · 1.89 KB
/
PythonGUI.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
from Tkinter import *
import os
root = Tk(className ="Parallel tester GUI")
Label(root, text=" Parameters ").grid(row = 1, column = 0)
Label(root, text=" Number of nodes : ").grid(row = 1, column = 1)
Label(root, text=" Total Search : ").grid(row = 1, column = 3)
Label(root, text=" Packet size : ").grid(row = 1, column = 5)
Label(root, text=" Percision (area only): ").grid(row = 1, column = 7)
numberOfNodes = StringVar() # defines the widget state as string
Entry(root, textvariable = numberOfNodes).grid(row = 1, column = 2)
totalSearch = StringVar() # defines the widget state as string
Entry(root, textvariable = totalSearch).grid(row = 1, column = 4)
packetSize = StringVar() # defines the widget state as string
Entry(root, textvariable = packetSize).grid(row = 1, column = 6)
percision = StringVar() # defines the widget state as string
Entry(root, textvariable = percision).grid(row = 1, column = 8)
def runPrimes():
os.system("mpirun -np " + numberOfNodes.get() + " primesfour " + totalSearch.get() + " " + packetSize.get())
Button(root, text=" Find prime numbers ", command=runPrimes).grid(row = 2, column = 0)
def runPrimes():
os.system("mpirun -np " + numberOfNodes.get() + " areaunder " + totalSearch.get() + " " + packetSize.get() + " " + percision.get())
Button(root, text=" Find the area under a curve ", command=runPrimes).grid(row = 2, column = 1)
fii = Button(root, text="Quit", command = root.quit).grid(row = 2, column = 2)
def optimizePrimes():
y = 2
z = 0
runTime=[]
for x in range (20):
from subprocess import call
runTime.extend(call(["mpirun -np ", y * x, "primesopt", 10000, y * x]))
print runTime[y]
y+=1
runTime.extend(call(["mpirun -np ", y * x, "primesopt", 10000, y * x]))
print runTime[y]
y+=1
Button(root, text = "optimize primefiner", command=optimizePrimes).grid(row = 3, column = 0)
root.mainloop()