你已经派生过 gprMax
镜像自地址
https://gitee.com/sunhf/gprMax.git
已同步 2025-08-06 04:26:52 +08:00
Updates to MPI testing to allow passing of communicator object through api().
这个提交包含在:
@@ -76,6 +76,7 @@ def api(
|
|||||||
task=None,
|
task=None,
|
||||||
restart=None,
|
restart=None,
|
||||||
mpi=False,
|
mpi=False,
|
||||||
|
mpicomm=None,
|
||||||
mpialt=False,
|
mpialt=False,
|
||||||
gpu=None,
|
gpu=None,
|
||||||
benchmark=False,
|
benchmark=False,
|
||||||
@@ -99,6 +100,7 @@ def api(
|
|||||||
args.task = task
|
args.task = task
|
||||||
args.restart = restart
|
args.restart = restart
|
||||||
args.mpi = mpi
|
args.mpi = mpi
|
||||||
|
args.mpicomm = mpicomm
|
||||||
args.mpialt = mpialt
|
args.mpialt = mpialt
|
||||||
args.gpu = gpu
|
args.gpu = gpu
|
||||||
args.benchmark = benchmark
|
args.benchmark = benchmark
|
||||||
@@ -464,7 +466,7 @@ def run_mpi_sim(args, inputfile, usernamespace, optparams=None):
|
|||||||
comm.Disconnect()
|
comm.Disconnect()
|
||||||
|
|
||||||
|
|
||||||
def run_mpi_alt_sim(args, inputfile, usernamespace, optparams=None):
|
def run_mpi_alt_sim(args, inputfile, usernamespace, optparams=None, mpicomm=None):
|
||||||
"""
|
"""
|
||||||
Run mixed mode MPI/OpenMP simulation - MPI task farm for models with
|
Run mixed mode MPI/OpenMP simulation - MPI task farm for models with
|
||||||
each model parallelised using either OpenMP (CPU) or CUDA (GPU)
|
each model parallelised using either OpenMP (CPU) or CUDA (GPU)
|
||||||
@@ -484,9 +486,13 @@ def run_mpi_alt_sim(args, inputfile, usernamespace, optparams=None):
|
|||||||
tags = Enum('tags', {'READY': 0, 'DONE': 1, 'EXIT': 2, 'START': 3})
|
tags = Enum('tags', {'READY': 0, 'DONE': 1, 'EXIT': 2, 'START': 3})
|
||||||
|
|
||||||
# Initializations and preliminaries
|
# Initializations and preliminaries
|
||||||
comm = MPI.COMM_WORLD # get MPI communicator object
|
if args.mpicomm:
|
||||||
|
comm = args.mpicomm
|
||||||
|
else:
|
||||||
|
comm = MPI.COMM_WORLD # get MPI communicator object
|
||||||
size = comm.Get_size() # total number of processes
|
size = comm.Get_size() # total number of processes
|
||||||
rank = comm.Get_rank() # rank of this process
|
rank = comm.Get_rank() # rank of this process
|
||||||
|
print('gprMax rank {}'.format(rank))
|
||||||
status = MPI.Status() # get MPI status object
|
status = MPI.Status() # get MPI status object
|
||||||
hostname = MPI.Get_processor_name() # get name of processor/host
|
hostname = MPI.Get_processor_name() # get name of processor/host
|
||||||
|
|
||||||
|
在新工单中引用
屏蔽一个用户