Merge pull request #496 from gprMax/mpi

Small bug fixes and docs update
这个提交包含在:
Craig Warren
2025-07-18 00:03:59 +03:00
提交者 GitHub
当前提交 59d80060f7
共有 6 个文件被更改,包括 43 次插入5 次删除

查看文件

@@ -1,5 +1,9 @@
cython>=0.20
numpy>=1.9
colorama
reframe-hpc
scipy
typing_extensions
# Note: beware of https://github.com/readthedocs/sphinx_rtd_theme/issues/1115
docutils==0.17.1

查看文件

@@ -29,6 +29,16 @@ extensions = [
"sphinx.ext.autosummary",
]
autodoc_mock_imports = [
"h5py",
"humanize",
"mpi4py_fft",
"mpi4py",
"psutil",
"terminaltables",
"tqdm",
]
# Figure numbering
numfig = True

查看文件

@@ -196,6 +196,10 @@ Geometry View
-------------
.. autoclass:: gprMax.user_objects.cmds_output.GeometryView
Geometry Objects Read
----------------------
.. autoclass:: gprMax.user_objects.cmds_geometry.geometry_objects_read.GeometryObjectsRead
Geometry Objects Write
----------------------
.. autoclass:: gprMax.user_objects.cmds_output.GeometryObjectsWrite

查看文件

@@ -169,10 +169,11 @@ class MPIContext(Context):
requested_mpi_size = np.prod(config.sim_config.mpi)
if self.comm.size < requested_mpi_size:
raise ValueError(
logger.error(
f"MPI_COMM_WORLD size of {self.comm.size} is too small for requested dimensions of"
f" {config.sim_config.mpi}. {requested_mpi_size} ranks are required."
)
exit()
if self.rank >= requested_mpi_size:
logger.warning(

查看文件

@@ -1,5 +1,5 @@
# Copyright (C) 2015-2025: The University of Edinburgh, United Kingdom
# Authors: Craig Warren, Antonis Giannopoulos, John Hartley,
# Authors: Craig Warren, Antonis Giannopoulos, John Hartley,
# and Nathan Mannall
#
# This file is part of gprMax.
@@ -328,7 +328,10 @@ def process_multicmds(multicmds):
p2 = (float(tmp[3]), float(tmp[4]), float(tmp[5]))
dl = (float(tmp[6]), float(tmp[7]), float(tmp[8]))
filename = tmp[10]
fileext = "." + filename.split(".")[-1]
if "." in filename:
fileext = "." + filename.split(".")[-1]
else:
fileext = None
try:
iterations = int(tmp[9])

查看文件

@@ -1,5 +1,5 @@
# Copyright (C) 2015-2025: The University of Edinburgh, United Kingdom
# Authors: Craig Warren, Antonis Giannopoulos, John Hartley,
# Authors: Craig Warren, Antonis Giannopoulos, John Hartley,
# and Nathan Mannall
#
# This file is part of gprMax.
@@ -33,6 +33,22 @@ logger = logging.getLogger(__name__)
class GeometryObjectsRead(GeometryUserObject):
"""Allows you to insert pre-defined geometry into a model.
The geometry is specified using a 3D array of integer numbers stored
in a HDF5 file. The integer numbers must correspond to the order of
a list of ``#material`` commands specified in a text file.
Attributes:
p1: list of lower left (x,y,z) coordinates in the domain where
the lower left corner of the geometry array should be
placed.
geofile: string path to and filename of the HDF5 file that
contains an integer array which defines the geometry.
matfile: string path to and filename of the text file that
contains ``#material`` commands.
"""
@property
def hash(self):
return "#geometry_objects_read"
@@ -75,7 +91,7 @@ class GeometryObjectsRead(GeometryUserObject):
free_space = f"#material: 1 0 1 0 free_space{{{matstr}}}\n"
if materials[0] == pec and materials[1] == free_space:
materials.pop(0)
materials.pop(1)
materials.pop(0)
numexistmaterials -= 2
elif materials[0] == pec or materials[0] == free_space:
materials.pop(0)