Skip to content

Commit

Permalink
docs: Elaborate message on swapping issue
Browse files Browse the repository at this point in the history
  • Loading branch information
georgebisbas committed Nov 25, 2024
1 parent 0267d74 commit 9656baf
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
9 changes: 6 additions & 3 deletions devito/types/dense.py
Original file line number Diff line number Diff line change
Expand Up @@ -1372,9 +1372,12 @@ def __init_finalize__(self, *args, **kwargs):

# Check we won't allocate too much memory for the system
available_mem = virtual_memory().available
if np.dtype(self.dtype).itemsize * self.size > available_mem:
warning("Trying to allocate more memory for symbol %s " % self.name +
"than available on physical device, this will start swapping")
required_mem = np.dtype(self.dtype).itemsize * self.size
if required_mem > available_mem:
warning("Trying to allocate more memory (%s) "
% humanbytes(required_mem) + "for symbol %s " % self.name +
"than available (%s) " % humanbytes(available_mem) +
"on physical device, this will start swapping")
if not isinstance(self.time_order, int):
raise TypeError("`time_order` must be int")

Expand Down
3 changes: 1 addition & 2 deletions examples/userapi/04_boundary_conditions.ipynb
Original file line number Diff line number Diff line change
Expand Up @@ -11,8 +11,7 @@
"cell_type": "markdown",
"metadata": {},
"source": [
"This tutorial aims to demonstrate how users can implement various boundary conditions in Devito, building on concepts introduced in previous tutorials. More specifically, this tutorial will use `SubDomain`s to model boundary conditions. `SubDomain`s are the recommended way to model BCs in order to run with MPI and distributed memory parallelism,\n",
"as they align with Devito's support for distributed NumPy arrays with zero changes needed to the user coded.\n",
"This tutorial aims to demonstrate how users can implement various boundary conditions in Devito, building on concepts introduced in previous tutorials. More specifically, this tutorial will use `SubDomain`s to model boundary conditions. `SubDomain`s are the recommended way to model BCs in order to run with MPI and distributed memory parallelism, as they align with Devito's support for distributed NumPy arrays with zero changes needed to the user code.\n",
"\n",
"Over the course of this notebook we will go over the implementation of both free surface boundary conditions and perfectly-matched layers (PMLs) in the context of the first-order acoustic wave equation. This tutorial is based on a simplified version of the method outlined in Liu and Tao's 1997 paper (https://doi.org/10.1121/1.419657).\n",
"\n",
Expand Down

0 comments on commit 9656baf

Please sign in to comment.