36 lines
616 B
Python
36 lines
616 B
Python
|
from flask import Flask, redirect, request, render_template
|
||
|
import matrix
|
||
|
|
||
|
app = Flask(__name__, template_folder='')
|
||
|
|
||
|
results = ''
|
||
|
|
||
|
|
||
|
@app.route('/')
|
||
|
def home():
|
||
|
global results
|
||
|
return render_template("template.html", results_html=results)
|
||
|
|
||
|
|
||
|
@app.route('/do')
|
||
|
def do():
|
||
|
global results
|
||
|
|
||
|
data = request.args
|
||
|
results = matrix.get_results(int(data['size']), int(data['proc_num']))
|
||
|
|
||
|
return redirect("/")
|
||
|
|
||
|
|
||
|
@app.route('/benchmark')
|
||
|
def benchmark():
|
||
|
global results
|
||
|
|
||
|
results = matrix.get_benchmark()
|
||
|
|
||
|
return redirect("/")
|
||
|
|
||
|
|
||
|
if __name__ == '__main__':
|
||
|
app.run(host='0.0.0.0', port=8082)
|