Skip to content

Commit f30ca3d

Browse files
authored
Sphinx Documentation: Minor wording fixes (#5217)
Minor editing pass by Codex.
1 parent 24716d0 commit f30ca3d

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

44 files changed

+554
-557
lines changed

Docs/sphinx_documentation/source/AMReX_Profiling_Tools.rst

Lines changed: 18 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -20,15 +20,15 @@ Currently, AMReX has two options for built-in profiling:
2020
Tiny Profiling
2121
----------------------
2222

23-
To enable "Tiny Profiling" with GNU Make edit the options in the file ``GNUMakefile``
24-
to show,
23+
To enable "Tiny Profiling" with GNU Make, edit the options in the file ``GNUMakefile``
24+
as follows:
2525

2626
::
2727

2828
TINY_PROFILE = TRUE
2929
PROFILE = FALSE
3030

31-
If building with CMake, set the following CMake flags,
31+
If building with CMake, set the following CMake flags:
3232

3333
::
3434

@@ -82,21 +82,21 @@ be written at user-defined points in the code by inserting the line:
8282
BL_PROFILE_TINY_FLUSH();
8383

8484
Any timers that have not reached their ``BL_PROFILE_VAR_STOP`` call or exited
85-
their scope and been destructed will not be included in these partial outputs.
85+
their scope and been destroyed will not be included in these partial outputs.
8686
(e.g., a properly instrumented ``main()`` should show a time of zero in all
8787
partial outputs.) Therefore, it is recommended to place these flush calls in
8888
easily identifiable regions of your code and outside of as many profiling
8989
timers as possible, such as immediately before or after writing a checkpoint.
9090

91-
Also, since flush calls will print multiple, similar looking outputs to ``stdout``,
91+
Also, since flush calls will print multiple, similar-looking outputs to ``stdout``,
9292
it is also recommended to wrap any ``BL_PROFILE_TINY_FLUSH();`` calls in
9393
informative ``amrex::Print()`` lines to ensure accurate identification of each
9494
set of timers.
9595

9696
Hot Spots and Load Balance
9797
~~~~~~~~~~~~~~~~~~~~~~~~~~
9898

99-
The output of TinyProfiler can help us to identify hot spots. For example,
99+
The output of TinyProfiler can help identify hot spots. For example,
100100
the following output shows the top three hot spots of a linear solver test
101101
running on 4 MPI processes.
102102

@@ -176,7 +176,7 @@ AMReX profiler objects are created and managed through :cpp:`BL_PROF` macros.
176176

177177
.. highlight:: c++
178178

179-
To start, you must at least instrument main(), i.e.:
179+
To start, you must at least instrument ``main()``, i.e.:
180180

181181
::
182182

@@ -209,7 +209,7 @@ Or:
209209
amrex::Finalize();
210210
}
211211

212-
You can then instrument any of your functions, or code blocks. There are four general
212+
You can then instrument any of your functions or code blocks. There are four general
213213
profiler macro types available:
214214

215215
1) A scoped timer, :cpp:`BL_PROFILE`:
@@ -246,7 +246,7 @@ In some cases, using scopes to control a timer is not ideal. In such cases, you
246246
FORT_FLATENX(arg1, arg2);
247247
BL_PROFILE_VAR_STOP(anyname); // Stop the "anyname" timer object.
248248

249-
This can also be used to selectively time with the same scope. For example, to include :cpp:`Func_0`
249+
This can also be used to selectively time within the same scope. For example, to include :cpp:`Func_0`
250250
and :cpp:`Func_2`, but not :cpp:`Func_1`:
251251

252252
::
@@ -279,7 +279,7 @@ timers by just using the :cpp:`_VAR` macro:
279279
3) A named, scoped timer that doesn't auto-start, :cpp:`BL_PROFILE_VAR_NS`:
280280
----------------------------------------------------------------------------------------
281281

282-
Sometimes, a complicated scoping may mean the profiling object needs to be defined before it's
282+
Sometimes, a complicated scope may mean the profiling object needs to be defined before it's
283283
started. To create a named AMReX timer that doesn't start automatically, use the ``_NS_`` macros.
284284
("NS" stands for "no start"). For example, this implementation times :cpp:`MyFunc0`
285285
and :cpp:`MyFunc1` but not any of the
@@ -288,7 +288,7 @@ and :cpp:`MyFunc1` but not any of the
288288
::
289289

290290
{
291-
BL_PROFILE_VAR_NS("MyFuncs()", myfuncs); // dont start the timer
291+
BL_PROFILE_VAR_NS("MyFuncs()", myfuncs); // don't start the timer
292292

293293
<Additional Code A>
294294

@@ -309,7 +309,7 @@ and :cpp:`MyFunc1` but not any of the
309309
}
310310
}
311311

312-
.. Note::
312+
.. note::
313313
The ``_NS_`` macro must, by necessity, also be a ``_VAR_`` macro. Otherwise, you would never be
314314
able to turn the timer on!
315315

@@ -355,7 +355,7 @@ macros in the following way:
355355
}
356356

357357
The ``MyFuncs`` region appears in the Tiny Profiler output as an additional table.
358-
The following output example, mimics the above code. In it, the region is
358+
The following output example mimics the above code. In it, the region is
359359
indicated by ``REG::MyFuncs``.
360360

361361
.. code-block:: console
@@ -448,7 +448,7 @@ and at the point in the function where you want to stop profiling. The profiling
448448
output will only warn of any :fortran:`bl_proffortfuncstart` calls that were not stopped with
449449
:fortran:`bl_proffortfuncstop` calls when in debug mode.
450450

451-
For functions with a high number of calls, there is a lighter-weight interface,
451+
For functions with a high number of calls, there is a lighter-weight interface:
452452

453453
::
454454

@@ -474,10 +474,10 @@ in the ``bl_proffortfuncstart_int/bl_proffortfuncstop_int`` calls.
474474
Profiling Options
475475
=================
476476

477-
AMReX's communication algorithms are often regions of code that increase in wall clock time
477+
AMReX's communication algorithms are often regions of code that increase in wall-clock time
478478
when the application is load imbalanced, due to the MPI_Wait calls in these functions.
479479
To better understand if this is occurring and by how much, you can turn on an AMReX timed
480-
synchronization with the runtime variable: ``amrex.use_profiler_syncs=1`` This adds named timers
480+
synchronization with the runtime variable ``amrex.use_profiler_syncs=1``. This adds named timers
481481
beginning with ``SyncBeforeComms`` immediately prior to the start of the FillBoundary,
482482
ParallelCopy and particle Redistribute functions, isolating any prior load imbalance to that timer
483483
before beginning the comm operation.
@@ -486,7 +486,7 @@ This is a diagnostic tool and may slow your code down, so it is not recommended
486486
on for production runs.
487487

488488
.. note::
489-
Note: the ``SyncBeforeComms`` timer is not equal to your load imbalance. It only captures imbalance
489+
The ``SyncBeforeComms`` timer is not equal to your load imbalance. It only captures imbalance
490490
between the comm functions and the previous sync point; there may be other load imbalances
491491
captured elsewhere. Also, the timer reports in terms of MPI rank, so if the most imbalanced
492492
rank changes throughout the simulation, the timer will be an underestimation.
@@ -508,6 +508,6 @@ data products. The parser's data services functionality can be called from an
508508
interactive environment such as :ref:`sec:amrvis`, from a sidecar for dynamic performance
509509
optimization, and from other utilities such as the command line version of the
510510
parser itself. It has been integrated into Amrvis for visual interpretation of
511-
the data allowing Amrvis to open the ``bl_prof`` database like a plotfile but with
511+
the data, allowing Amrvis to open the ``bl_prof`` database like a plotfile but with
512512
interfaces appropriate to profiling data. AMRProfParser and Amrvis can be run
513513
in parallel both interactively and in batch mode.

Docs/sphinx_documentation/source/AMReX_Profiling_Tools_Chapter.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ More details can be found in the documentation below.
1313

1414
Lecture 1: `Introduction and TINYPROFILER <http://ccse.lbl.gov/AMReX/AMReX_Profiling_Lecture1.pdf>`_
1515

16-
Lecture 2: `Introduction to Full Profiling <http://ccse.lbl.gov/AMReX/AMReX_Profiling_Lecture2.pdf>`_
16+
Lecture 2: `Introduction to Full Profiling <http://ccse.lbl.gov/AMReX/AMReX_Profiling_Lecture2.pdf>`_
1717

1818
Lecture 3: `Using ProfVis -- GUI Features <http://ccse.lbl.gov/AMReX/AMReX_Profiling_Lecture3.pdf>`_
1919

Docs/sphinx_documentation/source/AmrCore.rst

Lines changed: 38 additions & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@
2525

2626
.. _fig:Adv:
2727

28-
.. table:: Time sequence (:math:`t=0,0.5,1,1.5,2` s) of advection of a Gaussian profile using the SingleVortex tutorial. The analytic velocity field distorts the profile, and then restores the profile to the original configuration. The red, green, and blue boxes indicate grids at AMR levels :math:`\ell=0,1`, and :math:`2`.
28+
.. table:: Time sequence (:math:`t=0, 0.5, 1, 1.5, 2` s) of advection of a Gaussian profile using the SingleVortex tutorial. The analytic velocity field distorts the profile, and then restores the profile to its original configuration. The red, green, and blue boxes indicate grids at AMR levels :math:`\ell=0,1`, and :math:`2`.
2929
:align: center
3030

3131
+-----+-----+-----+-----+-----+
@@ -85,7 +85,7 @@ The protected data members are:
8585
Vector<BoxArray> grids;
8686

8787
The following parameters are frequently set via the inputs file or the command line.
88-
Their usage is described in the section on :ref:`sec:grid_creation`
88+
Their usage is described in the section on :ref:`sec:grid_creation`.
8989

9090
.. raw:: latex
9191

@@ -127,9 +127,9 @@ have any data members, just additional member functions, some of which override
127127
the base class AmrMesh.
128128

129129
There are no pure virtual functions in :cpp:`AmrMesh`, but
130-
there are 5 pure virtual functions in the :cpp:`AmrCore` class. Any applications
130+
there are five pure virtual functions in the :cpp:`AmrCore` class. Any applications
131131
you create must implement these functions. The tutorial code
132-
Amr/Advection_AmrCore provides sample implementation in the derived
132+
Amr/Advection_AmrCore provides a sample implementation in the derived
133133
class :cpp:`AmrCoreAdv`.
134134

135135
.. highlight:: c++
@@ -162,8 +162,8 @@ Refer to the :cpp:`AmrCoreAdv` class in the
162162
``amrex-tutorials/ExampleCodes/Amr/AmrCore_Advection/Source``
163163
code for a sample implementation.
164164

165-
TagBox, and Cluster
166-
-------------------
165+
TagBox and Cluster
166+
------------------
167167

168168
These classes are used in the grid generation process.
169169
The :cpp:`TagBox` class is essentially a data structure that marks which
@@ -193,15 +193,15 @@ FillPatchUtil and Interpolater
193193
:cpp:`operator()` that fills domain boundaries for a :cpp:`MultiFab`.
194194
195195
Many codes, including the Advection_AmrCore example, contain an array of MultiFabs
196-
(one for each level of refinement), and then use "fillpatch" operations to fill temporary
197-
MultiFabs that may include a different number of ghost cells. Fillpatch operations fill
198-
all cells, valid and ghost, from actual valid data at that level, space-time interpolated data
196+
(one for each level of refinement), and then use FillPatch operations to fill temporary
197+
MultiFabs that may include a different number of ghost cells. FillPatch operations fill
198+
all cells, valid and ghost, using actual valid data at that level, space-time interpolated data
199199
from the next-coarser level, neighboring grids at the same level, and domain
200200
boundary conditions (for examples that have non-periodic boundary conditions).
201201
Note that at the coarsest level,
202-
the interior and domain boundary (which can be periodic or prescribed based on physical considerations)
203-
need to be filled. At the non-coarsest level, the ghost cells can also be interior or domain,
204-
but can also be at coarse-fine interfaces away from the domain boundary.
202+
interior cells and domain boundaries (which can be periodic or prescribed based on physical considerations)
203+
need to be filled. At non-coarsest levels, the ghost cells can also be interior or on the domain boundary,
204+
but they can also be at coarse-fine interfaces away from the domain boundary.
205205
:cpp:`AMReX_FillPatchUtil.cpp/H` contains two primary functions of interest.
206206

207207
#. :cpp:`FillPatchSingleLevel()` fills a :cpp:`MultiFab` and its ghost region at a single level of
@@ -218,11 +218,11 @@ to fill interior, periodic, and physical boundary ghost cells. In principle, yo
218218
write a single-level application that calls :cpp:`FillPatchSingleLevel()` instead
219219
of using :cpp:`MultiFab::FillBoundary` and :cpp:`FillDomainBoundary()`.
220220

221-
A :cpp:`FillPatchUtil` uses an :cpp:`Interpolator`. This is largely hidden from application codes.
221+
The :cpp:`FillPatchUtil` routines use an :cpp:`Interpolator`. This is largely hidden from application codes.
222222
AMReX_Interpolater.cpp/H contains the virtual base class :cpp:`Interpolater`, which provides
223223
an interface for coarse-to-fine spatial interpolation operators. The fillpatch routines described
224-
above require an Interpolater for FillPatchTwoLevels().
225-
Within AMReX_Interpolater.cpp/H are the derived classes:
224+
above require an :cpp:`Interpolater` for :cpp:`FillPatchTwoLevels()`.
225+
Within AMReX_Interpolater.cpp/H, the derived classes are:
226226

227227
- :cpp:`NodeBilinear`
228228

@@ -240,7 +240,7 @@ Within AMReX_Interpolater.cpp/H are the derived classes:
240240

241241
- :cpp:`FaceLinear`
242242

243-
- :cpp:`FaceDivFree`: This is more accurately a divergence-preserving interpolation on face centered data, i.e., it ensures the divergence of the fine ghost cells match the value of the divergence of the underlying coarse cell. All fine cells overlying a given coarse cell will have the same divergence, even when the coarse grid divergence is spatially varying. Note that when using this with :cpp:`FillPatch` for time sub-cycling, the coarse grid times may not match the fine grid time, in which case :cpp:`FillPatch` will create coarse values at the fine time before calling this interpolation and the result of the :cpp:`FillPatch` is *not* guaranteed to preserve the original divergence.
243+
- :cpp:`FaceDivFree`: This is more accurately a divergence-preserving interpolation on face-centered data, i.e., it ensures the divergence of the fine ghost cells matches the value of the divergence of the underlying coarse cell. All fine cells overlying a given coarse cell will have the same divergence, even when the coarse grid divergence is spatially varying. Note that when using this with :cpp:`FillPatch` for time sub-cycling, the coarse grid times may not match the fine grid time, in which case :cpp:`FillPatch` will create coarse values at the fine time before calling this interpolation and the result of the :cpp:`FillPatch` is *not* guaranteed to preserve the original divergence.
244244

245245
These Interpolaters can be executed on CPU or GPU, with certain limitations:
246246

@@ -283,12 +283,12 @@ the coarse grid flux must be compared to the area *and* time-weighted fine grid
283283
fluxes. A :cpp:`FluxRegister` accumulates and ultimately stores the net
284284
difference in fluxes between the coarse grid and fine grid advance over each
285285
face over a given coarse time step. The simplest possible synchronization step
286-
is to modify the coarse grid solution in coarse cells immediately adjacent to
287-
the coarse-fine interface are updated to account for the mismatch stored in the
286+
is to modify the coarse grid solution in the coarse cells immediately adjacent to
287+
the coarse-fine interface to account for the mismatch stored in the
288288
FluxRegister. This can be done "simply" by taking the coarse-level divergence of
289289
the data in the FluxRegister using the :cpp:`reflux` function.
290290

291-
The Fortran routines that perform the actual floating point work associated with
291+
The Fortran routines that perform the actual floating-point work associated with
292292
incrementing data in a :cpp:`FluxRegister` are contained in the files
293293
AMReX_FLUXREG_F.H and AMReX_FLUXREG_xD.F.
294294

@@ -358,8 +358,7 @@ easily be thought of as a recursive algorithm in which, to advance level :math:`
358358

359359
\end{center}
360360

361-
Specifically, for a 3-level simulation, depicted graphically in the figure
362-
showing the :ref:`fig:subcycling` above:
361+
Specifically, for a 3-level simulation, as depicted in :ref:`fig:subcycling`:
363362

364363
#. Integrate :math:`\ell=0` over :math:`\Delta t`.
365364

@@ -415,28 +414,28 @@ Code Structure
415414
Source code tree for the AmrAdvection_AmrCore example.
416415

417416

418-
The figure shows the :ref:`fig:AmrAdvection_AmrCore_flowchart`
417+
The figure above shows the source tree for the example.
419418

420419

421-
- amrex/Src/
420+
- ``amrex/Src/``
422421

423-
- Base/ Base amrex library.
422+
- ``Base/`` Base AMReX library.
424423

425-
- Boundary/ An assortment of classes for handling boundary data.
424+
- ``Boundary/`` An assortment of classes for handling boundary data.
426425

427-
- AmrCore/ AMR data management classes, described in more detail above.
426+
- ``AmrCore/`` AMR data management classes, described in more detail above.
428427

429428

430-
- ``Advection_AmrCore/Src`` Source code specific to this example. Most notably
431-
is the :cpp:`AmrCoreAdv` class, which is derived from :cpp:`AmrCore`. The subdirectories ``Src_2d``
432-
and ``Src_3d`` contain dimension specific routines. ``Src_nd`` contains dimension-independent routines.
429+
- ``Advection_AmrCore/Src`` contains source code specific to this example. Most notably,
430+
it includes the :cpp:`AmrCoreAdv` class, which is derived from :cpp:`AmrCore`. The subdirectories ``Src_2d``
431+
and ``Src_3d`` contain dimension-specific routines. ``Src_nd`` contains dimension-independent routines.
433432

434433

435-
- Exec Contains a makefile so a user can write other examples besides SingleVortex.
434+
- ``Exec`` contains a makefile so that users can write other examples besides ``SingleVortex``.
436435

437436

438-
- SingleVortex Build the code here by editing the GNUmakefile and running make. There
439-
is also problem-specific source code here used for initialization or specifying the velocity field used in this
437+
- ``SingleVortex`` builds the code by editing the ``GNUmakefile`` and running ``make``. There
438+
is also problem-specific source code here for initialization and for specifying the velocity field used in this
440439
simulation.
441440

442441
Here is a high-level pseudo-code of the flow of the program:
@@ -448,7 +447,7 @@ Here is a high-level pseudo-code of the flow of the program:
448447
/* Advection_AmrCore Pseudocode */
449448
main()
450449
AmrCoreAdv amr_core_adv; // build an AmrCoreAdv object
451-
amr_core_adv.InitData() // initialize data all all levels
450+
amr_core_adv.InitData() // initialize data on all levels
452451
AmrCore::InitFromScratch()
453452
AmrMesh::MakeNewGrids()
454453
AmrMesh::MakeBaseGrids() // define level 0 grids
@@ -547,12 +546,12 @@ Regridding
547546
----------
548547

549548
The regrid function belongs to the :cpp:`AmrCore` class (it is virtual -- in this
550-
tutorial we use the instance in :cpp:`AmrCore`).
549+
tutorial we use the implementation in :cpp:`AmrCore`).
551550

552551
At the beginning of each time step, we check whether we need to regrid.
553-
In this example, we use a :cpp:`regrid_int` and keep track of how many times each level
554-
has been advanced. When any given particular level :math:`\ell<\ell_{\rm max}` has been
555-
advanced a multiple of :cpp:`regrid_int`, we call the :cpp:`regrid` function.
552+
In this example, we use :cpp:`regrid_int` and keep track of how many times each level
553+
has been advanced. When any given level :math:`\ell<\ell_{\rm max}` has been
554+
advanced a number of times equal to a multiple of :cpp:`regrid_int`, we call the :cpp:`regrid` function.
556555

557556
.. highlight:: c++
558557

@@ -568,7 +567,7 @@ advanced a multiple of :cpp:`regrid_int`, we call the :cpp:`regrid` function.
568567
{
569568
if (istep[lev] % regrid_int == 0)
570569
{
571-
// regrid could add newly refine levels
570+
// regrid could add newly refined levels
572571
// (if finest_level < max_level)
573572
// so we save the previous finest level index
574573
int old_finest = finest_level;
@@ -582,7 +581,7 @@ advanced a multiple of :cpp:`regrid_int`, we call the :cpp:`regrid` function.
582581
}
583582
}
584583

585-
Central to the regridding process is the concept of "tagging" which cells need refinement.
584+
Central to the regridding process is the concept of "tagging" cells that need refinement.
586585
:cpp:`ErrorEst` is a pure virtual function of :cpp:`AmrCore`, so each application code must
587586
contain an implementation. In AmrCoreAdv.cpp the ErrorEst function is essentially an
588587
interface to a Fortran routine that tags cells (in this case, :fortran:`state_error` in

0 commit comments

Comments
 (0)