Enable random port feature in standalone GUI (#111)

Signed-off-by: coleramos425 <colramos@amd.com>


[ROCm/rocprofiler-compute commit: e23a4dd9c5]
Этот коммит содержится в:
coleramos425
2023-05-02 16:20:33 -05:00
родитель 6bf4dd0fb7
Коммит 186deb0533
2 изменённых файлов: 13 добавлений и 1 удалений
+8 -1
Просмотреть файл
@@ -38,6 +38,7 @@ import sys
import copy
import random
import sys
import argparse
import os.path
@@ -170,7 +171,10 @@ def run_gui(args, runs):
args.verbose,
args,
)
app.run_server(debug=False, host="0.0.0.0", port=args.gui)
if(args.random_port):
app.run_server(debug=False, host="0.0.0.0", port=random.randint(1024, 49151))
else:
app.run_server(debug=False, host="0.0.0.0", port=args.gui)
else:
print("Multiple runs not yet supported in GUI. Retry without --gui flag.")
@@ -281,4 +285,7 @@ def analyze(args):
if args.gui:
run_gui(args, runs)
else:
if(args.random_port):
print("ERROR: --gui flag required to enable --random-port")
sys.exit(1)
run_cli(args, runs)
+5
Просмотреть файл
@@ -487,3 +487,8 @@ def parse(my_parser):
const=8050,
help="\t\tActivate a GUI to interate with Omniperf metrics.\n\t\tOptionally, specify port to launch application (DEFAULT: 8050)",
)
analyze_group.add_argument(
"--random-port",
action="store_true",
help="\t\tRandomly generate a port to launch GUI application.\n\t\tRegistered Ports range inclusive (1024-49151)."
)