你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-07 23:14:03 +08:00
Tidy up some MPI parts in preparation for implementation.
这个提交包含在:
@@ -26,7 +26,7 @@ def write_simulation_config(args):
|
||||
args (Namespace): Arguments from either API or CLI.
|
||||
"""
|
||||
|
||||
if args.mpi or args.mpi_no_spawn:
|
||||
if args.mpi:
|
||||
config.sim_config = config.SimulationConfigMPI(args)
|
||||
else:
|
||||
config.sim_config = config.SimulationConfig(args)
|
||||
|
@@ -121,16 +121,6 @@ class MPIContext(Context):
|
||||
pass
|
||||
|
||||
|
||||
class MPINoSpawnContext(Context):
|
||||
|
||||
def __init__(self):
|
||||
super().__init__()
|
||||
from mpi4py import MPI
|
||||
|
||||
def _run(self):
|
||||
pass
|
||||
|
||||
|
||||
def create_context():
|
||||
"""Create a context in which to run the simulation. i.e MPI.
|
||||
|
||||
@@ -140,8 +130,6 @@ def create_context():
|
||||
|
||||
if config.sim_config.args.mpi:
|
||||
context = MPIContext()
|
||||
elif config.sim_config.args.mpi_no_spawn:
|
||||
context = MPINoSpawnContext()
|
||||
else:
|
||||
context = NoMPIContext()
|
||||
|
||||
|
@@ -83,11 +83,6 @@ def run(
|
||||
parallel performance section of the User Guide.
|
||||
:type mpi: int, optional
|
||||
|
||||
:param mpi_no_spawn: flag to use MPI task farm without spawn mechanism.
|
||||
For further details see the parallel performance
|
||||
section of the User Guide.
|
||||
:type mpi_no_spawn: bool, optional
|
||||
|
||||
:param gpu: flag to use NVIDIA GPU or list of NVIDIA GPU device ID(s) for
|
||||
specific GPU card(s).
|
||||
:type gpu: list or bool, optional
|
||||
@@ -127,7 +122,6 @@ def run(
|
||||
args.task = task
|
||||
args.restart = restart
|
||||
args.mpi = mpi
|
||||
args.mpi_no_spawn = mpi_no_spawn
|
||||
args.mpicomm = mpicomm
|
||||
args.gpu = gpu
|
||||
args.subgrid = subgrid
|
||||
@@ -152,8 +146,6 @@ def main():
|
||||
parser.add_argument('-task', type=int, help='task identifier (model number) for job array on Open Grid Scheduler/Grid Engine (http://gridscheduler.sourceforge.net/index.html)')
|
||||
parser.add_argument('-restart', type=int, help='model number to restart from, e.g. when creating B-scan')
|
||||
parser.add_argument('-mpi', type=int, help='number of MPI tasks, i.e. master + workers')
|
||||
parser.add_argument('--mpi-no-spawn', action='store_true', default=False, help='flag to use MPI without spawn mechanism')
|
||||
parser.add_argument('--mpi-worker', action='store_true', default=False, help=argparse.SUPPRESS)
|
||||
parser.add_argument('-gpu', type=int, action='append', nargs='*', help='flag to use Nvidia GPU or option to give list of device ID(s)')
|
||||
parser.add_argument('--geometry-only', action='store_true', default=False, help='flag to only build model and produce geometry file(s)')
|
||||
parser.add_argument('--geometry-fixed', action='store_true', default=False, help='flag to not reprocess model geometry, e.g. for B-scans where the geometry is fixed')
|
||||
|
在新工单中引用
屏蔽一个用户