Skip to content

Commit 2ce95ba

Browse files
committed
Add visualization & case utility libraries
1 parent ecdf5b1 commit 2ce95ba

File tree

18 files changed

+255
-198
lines changed

18 files changed

+255
-198
lines changed

.github/file-filter.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ fortran_src: &fortran_src
77

88
python_src: &python_src
99
- '**/*.py'
10-
- 'toolchain/requirements.txt'
10+
- 'toolchain/pyproject.toml'
1111

1212
cmakelist: &cmakelist
1313
- 'CMakeLists.txt'

benchmarks/5eq_rk3_weno3_hllc/case.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@
1414
description="This MFC case was created for the purposes of benchmarking MFC.",
1515
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
1616

17-
parser.add_argument("dict", type=str, metavar="DICT", help=argparse.SUPPRESS)
18-
parser.add_argument("gbpp", type=int, metavar="MEM", default=16, help="Adjusts the problem size per rank to fit into [MEM] GB of GPU memory per GPU.")
17+
parser.add_argument("--mfc", type=str, metavar="DICT", help=argparse.SUPPRESS)
18+
parser.add_argument("--gbpp", type=int, metavar="MEM", default=16, help="Adjusts the problem size per rank to fit into [MEM] GB of GPU memory per GPU.")
1919

2020
ARGS = vars(parser.parse_args())
21-
DICT = json.loads(ARGS["dict"])
21+
DICT = json.loads(ARGS["mfc"])
2222

2323
size = 1 if DICT["gpu"] else 0
2424

benchmarks/hypo_hll/case.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,11 +12,11 @@
1212
description="This MFC case was created for the purposes of benchmarking MFC.",
1313
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
1414

15-
parser.add_argument("dict", type=str, metavar="DICT", help=argparse.SUPPRESS)
16-
parser.add_argument("gbpp", type=int, metavar="MEM", default=16, help="Adjusts the problem size per rank to fit into [MEM] GB of GPU memory per GPU.")
15+
parser.add_argument("--mfc", type=str, metavar="DICT", help=argparse.SUPPRESS)
16+
parser.add_argument("--gbpp", type=int, metavar="MEM", default=16, help="Adjusts the problem size per rank to fit into [MEM] GB of GPU memory per GPU.")
1717

1818
ARGS = vars(parser.parse_args())
19-
DICT = json.loads(ARGS["dict"])
19+
DICT = json.loads(ARGS["mfc"])
2020

2121
size = 1 if DICT["gpu"] else 0
2222

benchmarks/ibm/case.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
description="This MFC case was created for the purposes of benchmarking MFC.",
1212
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
1313

14-
parser.add_argument("dict", type=str, metavar="DICT", help=argparse.SUPPRESS)
15-
parser.add_argument("gbpp", type=int, metavar="MEM", default=16, help="Adjusts the problem size per rank to fit into [MEM] GB of GPU memory per GPU.")
14+
parser.add_argument("--mfc", type=str, metavar="DICT", help=argparse.SUPPRESS)
15+
parser.add_argument("--gbpp", type=int, metavar="MEM", default=16, help="Adjusts the problem size per rank to fit into [MEM] GB of GPU memory per GPU.")
1616

1717
ARGS = vars(parser.parse_args())
18-
DICT = json.loads(ARGS["dict"])
18+
DICT = json.loads(ARGS["mfc"])
1919

2020
size = 1 if DICT["gpu"] else 0
2121

benchmarks/viscous_weno5_sgb_acoustic/case.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -16,11 +16,11 @@
1616
description="This MFC case was created for the purposes of benchmarking MFC.",
1717
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
1818

19-
parser.add_argument("dict", type=str, metavar="DICT", help=argparse.SUPPRESS)
20-
parser.add_argument("gbpp", type=int, metavar="MEM", default=16, help="Adjusts the problem size per rank to fit into [MEM] GB of GPU memory per GPU.")
19+
parser.add_argument("--mfc", type=str, metavar="DICT", help=argparse.SUPPRESS)
20+
parser.add_argument("--gbpp", type=int, metavar="MEM", default=16, help="Adjusts the problem size per rank to fit into [MEM] GB of GPU memory per GPU.")
2121

2222
ARGS = vars(parser.parse_args())
23-
DICT = json.loads(ARGS["dict"])
23+
DICT = json.loads(ARGS["mfc"])
2424

2525
size = 1 if DICT["gpu"] else 0
2626

docs/documentation/case.md

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,17 +41,18 @@ parser = argparse.ArgumentParser(
4141
description="Weak- and strong-scaling benchmark case.",
4242
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
4343

44-
parser.add_argument("dict", type=str, metavar="DICT")
45-
parser.add_argument("-s", "--scaling", type=str, metavar="SCALING", choices=["weak", "strong"], help="Whether weak- or strong-scaling is being exercised.")
44+
parser.add_argument("--mfc", type=str, metavar="DICT", default='{}')
45+
parser.add_argument("-s", "--scaling", type=str, metavar="SCALING", choices=["weak", "strong"],
46+
help="Whether weak- or strong-scaling is being exercised.")
4647

4748
# Your parsed arguments are here
4849
args = parser.parse_args()
4950
```
5051

51-
The first argument is always a JSON string representing `mfc.sh run`'s internal
52-
state.
52+
The `--mfc` argument is a JSON string representing `mfc.sh run`'s internal
53+
state, passed in when MFC runs your input file.
5354
It contains all the runtime information you might want from the build/run system.
54-
You can add as many additional arguments as you may need.
55+
You can add as many additional arguments and options as you may need.
5556

5657
To run such a case, use the following format:
5758

examples/scaling/case.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
description="Weak- and strong-scaling benchmark case.",
88
formatter_class=argparse.ArgumentDefaultsHelpFormatter)
99

10-
parser.add_argument("dict", type=str, metavar="DICT")
10+
parser.add_argument("--mfc", type=str, metavar="MFC")
1111
parser.add_argument("-s", "--scaling", type=str, metavar="SCALING", choices=["weak", "strong"], help="Whether weak- or strong-scaling is being exercised.")
1212
parser.add_argument("-m", "--memory", type=int, metavar="MEMORY", help="Weak scaling: memory per rank in GB. Strong scaling: global memory in GB. Used to determine cell count.")
1313
parser.add_argument("-f", "--fidelity", type=str, metavar="FIDELITY", choices=["ideal", "exact"], default="ideal")
@@ -20,7 +20,7 @@
2020
parser.print_help()
2121
sys.exit(1)
2222

23-
DICT = json.loads(args.dict)
23+
DICT = json.loads(args.mfc)
2424

2525
# \approx The number of cells per GB of memory. The exact value is not important.
2626
cpg = 8000000 / 16.0

mfc.bat

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,11 +31,11 @@ if %errorlevel% neq 0 (
3131
exit /b 1
3232
)
3333

34-
fc /b "%cd%\build\requirements.txt" "%cd%\toolchain\requirements.txt" 2> NUL
34+
fc /b "%cd%\build\pyproject.toml" "%cd%\toolchain\pyproject.toml" 2> NUL
3535
if %errorlevel% neq 0 (
36-
pip3 install -r toolchain/requirements.txt
36+
pip3 install -e toolchain
3737

38-
copy "%cd%\toolchain\requirements.txt" "%cd%\build" 2> NUL
38+
copy "%cd%\toolchain\pyproject.toml" "%cd%\build" 2> NUL
3939
)
4040

4141
python "%cd%\toolchain\main.py" %*

misc/viz.py

Lines changed: 0 additions & 135 deletions
This file was deleted.

toolchain/bootstrap/lint.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22

33
log "(venv) Running$MAGENTA pylint$COLOR_RESET on$MAGENTA MFC$COLOR_RESET's $MAGENTA""toolchain$COLOR_RESET."
44

5-
pylint -d R1722,W0718,C0301,C0116,C0115,C0114,C0410,W0622,W0640,C0103,W1309,C0411,W1514,R0401,W0511 "$(pwd)/toolchain/"
5+
pylint -d R1722,W0718,C0301,C0116,C0115,C0114,C0410,W0622,W0640,C0103,W1309,C0411,W1514,R0401,W0511,C0321,C3001 "$(pwd)/toolchain/"
66

77
exit $?

0 commit comments

Comments
 (0)