Add MPI flag to CLI and API

这个提交包含在:
nmannall
2024-03-04 16:21:14 +00:00
父节点 20b45fcb78
当前提交 3069fec883

查看文件

@@ -31,6 +31,7 @@ args_defaults = {
"n": 1,
"i": None,
"taskfarm": False,
"mpi": False,
"gpu": None,
"opencl": None,
"subgrid": False,
@@ -62,6 +63,10 @@ help_msg = {
" farm, e.g. to create a B-scan with 60 traces and use MPI to farm out each trace. For"
" further details see the performance section of the User Guide."
),
"mpi": (
"(bool, opt): Flag to use Message Passing Interface (MPI) to divide the model between MPI"
"ranks."
),
"gpu": (
"(list/bool, opt): Flag to use NVIDIA GPU or list of NVIDIA GPU device ID(s) for specific"
" GPU card(s)."
@@ -98,6 +103,7 @@ def run(
n=args_defaults["n"],
i=args_defaults["i"],
taskfarm=args_defaults["taskfarm"],
mpi=args_defaults["mpi"],
gpu=args_defaults["gpu"],
opencl=args_defaults["opencl"],
subgrid=args_defaults["subgrid"],
@@ -131,7 +137,9 @@ def run(
n to allow individual models to be farmed out using a MPI
task farm, e.g. to create a B-scan with 60 traces and use
MPI to farm out each trace. For further details see the
performance section of the User Guide
performance section of the User Guide.
mpi: optional boolean flag to use Message Passing Interface
(MPI) to divide the model between MPI ranks.
gpu: optional list/boolean to use NVIDIA GPU or list of NVIDIA
GPU device ID(s) for specific GPU card(s).
opencl: optional list/boolean to use OpenCL or list of OpenCL
@@ -161,6 +169,7 @@ def run(
"n": n,
"i": i,
"taskfarm": taskfarm,
"mpi": mpi,
"gpu": gpu,
"opencl": opencl,
"subgrid": subgrid,
@@ -193,6 +202,9 @@ def cli():
default=args_defaults["taskfarm"],
help=help_msg["taskfarm"],
)
parser.add_argument(
"-mpi", action="store_true", default=args_defaults["mpi"], help=help_msg["mpi"]
)
parser.add_argument("-gpu", type=int, action="append", nargs="*", help=help_msg["gpu"])
parser.add_argument("-opencl", type=int, action="append", nargs="*", help=help_msg["opencl"])
parser.add_argument(