From 10e78f6ef5eb721badd342d7aebfcb92e0a30bdf Mon Sep 17 00:00:00 2001 From: Craig Warren Date: Thu, 13 Feb 2020 13:22:36 +0000 Subject: [PATCH] Tidy up some MPI parts in preparation for implementation. --- gprMax/config_parser.py | 2 +- gprMax/contexts.py | 12 ------------ gprMax/gprMax.py | 8 -------- 3 files changed, 1 insertion(+), 21 deletions(-) diff --git a/gprMax/config_parser.py b/gprMax/config_parser.py index 93bf9828..83fc277d 100755 --- a/gprMax/config_parser.py +++ b/gprMax/config_parser.py @@ -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) diff --git a/gprMax/contexts.py b/gprMax/contexts.py index b1c3d227..81a5cdf5 100644 --- a/gprMax/contexts.py +++ b/gprMax/contexts.py @@ -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() diff --git a/gprMax/gprMax.py b/gprMax/gprMax.py index c5659c99..506be565 100644 --- a/gprMax/gprMax.py +++ b/gprMax/gprMax.py @@ -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')