Tidy up some MPI parts in preparation for implementation.

这个提交包含在:
Craig Warren
2020-02-13 13:22:36 +00:00
父节点 30c7070fad
当前提交 10e78f6ef5
共有 3 个文件被更改,包括 1 次插入21 次删除

查看文件

@@ -26,7 +26,7 @@ def write_simulation_config(args):
args (Namespace): Arguments from either API or CLI. 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) config.sim_config = config.SimulationConfigMPI(args)
else: else:
config.sim_config = config.SimulationConfig(args) config.sim_config = config.SimulationConfig(args)

查看文件

@@ -121,16 +121,6 @@ class MPIContext(Context):
pass pass
class MPINoSpawnContext(Context):
def __init__(self):
super().__init__()
from mpi4py import MPI
def _run(self):
pass
def create_context(): def create_context():
"""Create a context in which to run the simulation. i.e MPI. """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: if config.sim_config.args.mpi:
context = MPIContext() context = MPIContext()
elif config.sim_config.args.mpi_no_spawn:
context = MPINoSpawnContext()
else: else:
context = NoMPIContext() context = NoMPIContext()

查看文件

@@ -83,11 +83,6 @@ def run(
parallel performance section of the User Guide. parallel performance section of the User Guide.
:type mpi: int, optional :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 :param gpu: flag to use NVIDIA GPU or list of NVIDIA GPU device ID(s) for
specific GPU card(s). specific GPU card(s).
:type gpu: list or bool, optional :type gpu: list or bool, optional
@@ -127,7 +122,6 @@ def run(
args.task = task args.task = task
args.restart = restart args.restart = restart
args.mpi = mpi args.mpi = mpi
args.mpi_no_spawn = mpi_no_spawn
args.mpicomm = mpicomm args.mpicomm = mpicomm
args.gpu = gpu args.gpu = gpu
args.subgrid = subgrid 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('-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('-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', 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('-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-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') 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')