Skip to content

Commit

Permalink
fix doc typos
Browse files Browse the repository at this point in the history
  • Loading branch information
lmiq committed Nov 21, 2023
1 parent 6677b89 commit 33d8ba1
Show file tree
Hide file tree
Showing 6 changed files with 12 additions and 13 deletions.
4 changes: 2 additions & 2 deletions docs/src/LowLevel.md
Original file line number Diff line number Diff line change
Expand Up @@ -414,7 +414,7 @@ NumberOfBatches
Number of batches for cell list construction: 8
Number of batches for function mapping: 32
```
The construction of the cell lists is performed by creating copies of the data, and currently does not scale very well. Thus, no more than 8 batches are used by default, to avoid delays associated to data copying and gargabe collection. The number of batches of the mapping function uses an heuristic which currently limits somewhat the number of batches for small systems, when the overhead of spawning tasks is greater than the computation.
The construction of the cell lists is performed by creating copies of the data, and currently does not scale very well. Thus, no more than 8 batches are used by default, to avoid delays associated to data copying and garbage collection. The number of batches of the mapping function uses an heuristic which currently limits somewhat the number of batches for small systems, when the overhead of spawning tasks is greater than the computation.
Using more batches than threads for the function mapping is effective most times in avoiding uneven workload, but it may be a problem if the output to be reduced is too large, as the threaded version of the output contains `nbatches` copies of the output.

Using less batches than the number of threads also allows the efficient use of nested multi-threading, as the computations will only use the number of threads required, leaving the other threads available for other tasks.
Expand Down Expand Up @@ -557,7 +557,7 @@ For long-running computations, the user might want to see the progress. A progre
```julia
map_pairwise!(f,output,box,cl,show_progress=true)
```
whill print something like:
will print something like:
```julia-repl
Progress: 43%|█████████████████ | ETA: 0:18:25
```
Expand Down
8 changes: 4 additions & 4 deletions docs/src/PeriodicSystems.md
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ u = map_pairwise((x,y,i,j,d2,u) -> energy(d2,u,masses), system)
## Potential energy example

!!! note
The `output` of the `CellListMap` computation may be of any kind. Most commonly, it is an energy, a set of forces, or other data type that can be represented either as a number, an array of numbers, or an array of vectors (`SVectors` in particular), such as arrays of forces.
The `output` of the `CellListMap` computation may be of any kind. Most commonly, it is an energy, a set of forces, or other data type that can be represented either as a number, an array of numbers, or an array of vectors (`SVectors` in particular), such as an arrays of forces.

Additionally, the properties are frequently additive (the energy is the sum of the energy of the particles, or the forces are added by summation).

Expand Down Expand Up @@ -265,7 +265,7 @@ If the `map_pairwise!` function will compute energy and/or forces in a iterative

### Updating coordinates

The coordinates can be updated (mutated, or the array of coordinates can change in size by pushing or deleting particles), simply by directly acessing the `xpositions` field of the system. The `xpositions` array is a `Vector` of `SVector` (from `StaticArrays`), with coordinates copied from the input array provided. Thus, the coordinates in the `PeriodicSystem` structure must be updated independently of updates in the original array of coordinates.
The coordinates can be updated (mutated, or the array of coordinates can change in size by pushing or deleting particles), simply by directly accessing the `xpositions` field of the system. The `xpositions` array is a `Vector` of `SVector` (from `StaticArrays`), with coordinates copied from the input array provided. Thus, the coordinates in the `PeriodicSystem` structure must be updated independently of updates in the original array of coordinates.

Let us exemplify the interface with the computation of forces:

Expand Down Expand Up @@ -539,7 +539,7 @@ The number of batches launched in parallel runs can be tunned by the
`nbatches` keyword parameter of the `PeriodicSystem` constructor.
By default, the number of batches is defined as heuristic function
dependent on the number of particles, and possibly returns optimal
values in most cases. For a detailed dicussion about this parameter,
values in most cases. For a detailed discussion about this parameter,
see [Number of batches](@ref Number-of-batches).

For example, to set the number of batches for cell list calculation
Expand Down Expand Up @@ -791,7 +791,7 @@ function update_forces!(x, y, i, j, d2, forces, cutoff)
forces[j] -= dudr
return forces
end
# Function that initializes the system: it is preferrable to initialize
# Function that initializes the system: it is preferable to initialize
# the system outside the function that performs the simulation, because
# the system (data)type is defined on initialization. Initializing it outside
# the simulation function avoids possible type-instabilities.
Expand Down
1 change: 0 additions & 1 deletion docs/src/ecosystem.md
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,6 @@ julia> function sum_sqr(x,sides,cutoff)
)
return sum_sqr
end
sum_sqr (generic function with 1 method)
```

Note that we allow `cutoff` and `sides` to be converted to the same type of the input `x` of the function. For a simple call to the function this is inconsequential:
Expand Down
2 changes: 1 addition & 1 deletion docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Since version `0.7.22`, a new simpler, higher level interface was introduced, th

### Cutoff-delimited neighbor lists

The user might be more confortable in using the package to compute the list of neighboring particles. A custom interface for this application is provided though the [Neighbor lists](@ref) interface.
The user might be more comfortable in using the package to compute the list of neighboring particles. A custom interface for this application is provided though the [Neighbor lists](@ref) interface.

Note that, in general, neighbor lists are used to compute other pairwise dependent properties, and these can be, in principle, computed directly with `CellListMap` without the need to compute or store the lists of neighbors.

Expand Down
8 changes: 4 additions & 4 deletions docs/src/neighborlists.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ julia> neighborlist(x, 0.05; unitcell=[1.0 0.5; 0.5 1.0])

## In-place computation of neighbor lists

If neighbor lists are computed within a interative scenario, it is interesting preallocate all the necessary
If neighbor lists are computed within a interactive scenario, it is interesting preallocate all the necessary
data and just update the lists at every iteration. This can be achieved by constructing the `InPlaceNeighborList`
object in advance. The performance gain of performing the operations in place might vary and may not be
important for single runs, as the allocations do not dominate the computing time.
Expand All @@ -107,7 +107,7 @@ Current list buffer size: 0
```

Note that the buffer size has size `0`. The first time the neighbor lists are computed, the list will
be allocated. We will use the `neighborlist!` (with the bang) function, because it will effectivelly
be allocated. We will use the `neighborlist!` (with the bang) function, because it will effectively
mutate the `system`, by allocating all necessary data:

```julia-repl
Expand Down Expand Up @@ -143,8 +143,8 @@ julia> @time list = neighborlist!(system);
- The `cutoff` and `unitcell` can be modified by providing additional keyword parameters
to the `update!` function (for example `update!(system, x; cutoff=0.1)`).
- Allocations can occur if the cutoff, unit cell, or number of particles change such
that greater buffers are required. The number of allocations tend to disminish as
the buffers become large enough to accomodate the possible variations of the computation.
that greater buffers are required. The number of allocations tend to diminish as
the buffers become large enough to accommodate the possible variations of the computation.

For parallel runs, the allocations are minimal, but some small auxiliary data is required for the
launching of multiple threads. We illustrate here the convergence of the allocations to the
Expand Down
2 changes: 1 addition & 1 deletion docs/src/python.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ In [9]: i_inds, j_inds, d = cl.neighborlist_cross(x, y, 0.05, unitcell=np.array(
```

!!! note
The indexes of the particles the `i_inds` and `j_inds` arrays are 0-based, to conform the numpy array standard.
The indexes of the particles the `i_inds` and `j_inds` arrays are 0-based, to conform the `numpy` array standard.

!!! tip
To run the code multi-threaded, set the `JULIA_NUM_THREADS` environment variable before launching python:
Expand Down

0 comments on commit 33d8ba1

Please sign in to comment.