Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove MPIData #270

Open
wants to merge 33 commits into
base: develop
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
33 commits
Select commit Hold shift + click to select a range
94fdf96
Test segmented buffer
mtsch Apr 8, 2024
9420620
implement a buffer for alltoall
mtsch Apr 9, 2024
3817739
fix buffer communication
mtsch Apr 9, 2024
eebafe7
implement startegy
mtsch Apr 9, 2024
6d38578
add reporting for communication strats
mtsch Apr 11, 2024
c436034
add reporting for point to point
mtsch Apr 11, 2024
44e1cad
fix bug with NotDistributed
mtsch Apr 11, 2024
13b9691
Change initialisation, add check to all MPI calls PDVec makes.
mtsch Apr 16, 2024
28d70c0
MPI workaround
mtsch Apr 22, 2024
c18dfcc
Merge branch 'feature/alltoall' of github.com:joachimbrand/Rimu.jl in…
mtsch Apr 22, 2024
2371302
Merge branch 'develop' into feature/alltoall
mtsch Jun 7, 2024
a86808a
Merge branch 'develop' into feature/alltoall
mtsch Jun 24, 2024
c3c21de
Make AllToAll the default
mtsch Jun 24, 2024
6d353d3
add dot for alltoall
mtsch Jun 26, 2024
ceccbf5
Fix broken tests
mtsch Jun 27, 2024
84740c1
Docstrings, make sure both strategies are tested
mtsch Jun 27, 2024
152d154
Fix broken test, more parallelism
mtsch Jun 27, 2024
8b4aee8
remove print
mtsch Jun 27, 2024
3c5cfd0
more parallelism
mtsch Jun 27, 2024
f439b29
Fix communicator switching in tests
mtsch Jun 27, 2024
5796f1f
test that communicator is preserved
mtsch Jun 27, 2024
9edac04
more docstring updates
mtsch Jun 27, 2024
08a8f64
some renames, docstring updates
mtsch Jul 2, 2024
9f2ed77
report wait time
mtsch Jul 2, 2024
657de1c
add show methods to communicators
mtsch Jul 4, 2024
aef2ad0
More links and explanations
mtsch Jul 7, 2024
861a4e7
Small tweak in docstring
mtsch Jul 7, 2024
eec8aae
remove MPIData
mtsch Jul 7, 2024
2842aa1
remove RMPI, move helpers to toplevel
mtsch Aug 21, 2024
5f957a3
Merge branch 'develop' into feature/remove-mpidata
mtsch Aug 21, 2024
2e05573
scrub all mentions of RMPI
mtsch Aug 21, 2024
1ea42d6
add missing file
mtsch Aug 21, 2024
a27cfc7
Merge branch 'develop' into feature/remove-mpidata
mtsch Nov 6, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -64,7 +64,6 @@ makedocs(;
"Dict vectors" => "dictvectors.md",
"BitString addresses" => "addresses.md",
"Stochastic styles" => "stochasticstyles.md",
"RMPI" => "RMPI.md",
"I/O" => "rimuio.md",
"Random numbers" => "randomnumbers.md",
"Documentation generation" => "documentation.md",
Expand Down
4 changes: 0 additions & 4 deletions docs/src/API.md
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,6 @@ See [Module `DictVectors`](@ref)

See [Module `StatsTools`](@ref)

## RMPI

See [Module `RMPI`](@ref)

# Index

```@index
Expand Down
43 changes: 0 additions & 43 deletions docs/src/RMPI.md

This file was deleted.

3 changes: 1 addition & 2 deletions docs/src/index.md
Original file line number Diff line number Diff line change
Expand Up @@ -113,8 +113,7 @@ needs to be done for communicating between different processes.
Using MPI parallelism with `Rimu` is easy. Enabling MPI enabled automatically if
[`PDVec`](@ref) is used to store a vector. In that case, data will be stored in a
distributed fashion among the MPI ranks and only communicated between ranks when
necessary. Additional MPI-related functionality is provided by the module [`RMPI`](@ref
Rimu.RMPI).
necessary.

## Compatibility

Expand Down
11 changes: 3 additions & 8 deletions docs/src/mpi.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,9 +5,6 @@ MPI should be fairly straightforward. Generally, [`PDVec`](@ref Main.DictVectors
work with MPI automatically, as long as MPI is set up correctly and a few common pitfalls
are avoided.

Rimu includes an unexported module [`RMPI`](@ref Main.Rimu.RMPI), which must be imported to access
additional MPI-related functionality.

## Configuring MPI

When running on a cluster, ensure that MPI.jl is using the system binary. See [the MPI.jl
Expand All @@ -16,7 +13,6 @@ documentation](https://juliaparallel.org/MPI.jl/latest/configuration/) for more
It is always a good idea to start your script with a quick test that ensures the MPI is set up correctly. One way to do this is to open with

```julia
using Rimu.RMPI
mpi_allprintln("hello")
```

Expand Down Expand Up @@ -60,10 +56,9 @@ srun mpi=pmi2 julia --project -tauto script.jl
### Using `@mpi_root`

Take care to not use reducing functions (such as `length`, `sum`, `norm`, ...) inside
[`@mpi_root`](@ref Main.Rimu.RMPI.@mpi_root) blocks. Doing so will only initiate the
distributed reduction on one rank only, which will cause the code to go out of sync and
freeze. As an example, to report the current length of a vector, calculate the length before
the [`@mpi_root`](@ref Main.Rimu.RMPI.@mpi_root) block:
[`@mpi_root`](@ref) blocks. Doing so will only initiate the distributed reduction on one
rank only, which will cause the code to go out of sync and freeze. As an example, to report
the current length of a vector, calculate the length before the [`@mpi_root`](@ref) block:

```julia
len = length(pdvec)
Expand Down
2 changes: 1 addition & 1 deletion docs/src/randomnumbers.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,4 +9,4 @@ If you want FCIQMC runs to be reproducible, make sure to seed the RNG with
[Random.seed!](https://docs.julialang.org/en/v1/stdlib/Random/#Random.seed!).

MPI-distributed runs can also be made reproducible by seeding the RNG with
[`Rimu.RMPI.mpi_seed!`](@ref).
[`mpi_seed!`](@ref).
8 changes: 3 additions & 5 deletions scripts/BHM-example-mpi.jl
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,8 @@
# [here](https://github.com/joachimbrand/Rimu.jl/blob/develop/scripts/BHM-example-mpi.jl).
# Run it with 2 MPI ranks with `mpirun -n 2 julia BHM-example-mpi.jl`.

# We start by importing `Rimu` and `Rimu.RMPI`, which contains MPI-related
# functionality.
# We start by importing `Rimu`.
using Rimu
using Rimu.RMPI

# Note that it is not necessary to initialise the MPI library, as this is already done
# automatically when Rimu is loaded.
Expand Down Expand Up @@ -62,8 +60,8 @@ problem = ProjectorMonteCarloProblem(H;
last_step=10_000
);

# The [`@mpi_root`](@ref Main.Rimu.RMPI.@mpi_root) macro performs an action on the root rank
# only, which is useful for printing.
# The [`@mpi_root`](@ref) macro performs an action on the root rank only, which is useful
# for printing.
@mpi_root println("Running FCIQMC with ", mpi_size(), " rank(s).")

# Finally, we can run the computation.
Expand Down
2 changes: 2 additions & 0 deletions src/DictVectors/communicators.jl
Original file line number Diff line number Diff line change
@@ -1,3 +1,5 @@
import Rimu: mpi_rank, mpi_size, mpi_comm

struct CommunicatorError <: Exception
msg::String
end
Expand Down
2 changes: 1 addition & 1 deletion src/DictVectors/pdvec.jl
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ function PDVec{K,V,N}(

# This is a bit clunky. If you modify the communicator by hand, you have to make sure it
# knows to hold values of type W. When we introduce more communicators, they should
# probably be constructed by a function, similar to how it's done in RMPI.
# probably be constructed by a function.
IW = initiator_valtype(irule, W)
if isnothing(communicator)
if MPI.Comm_size(MPI.COMM_WORLD) > 1
Expand Down
1 change: 0 additions & 1 deletion src/DictVectors/projectors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -109,7 +109,6 @@ end

# NOTE that this returns a `Float64` opposite to the convention for
# dot to return the promote_type of the arguments.
# NOTE: This operation should work for `MPIData` and is MPI synchronizing

"""
PopsProjector() <: AbstractProjector
Expand Down
2 changes: 0 additions & 2 deletions src/Interfaces/dictvectors.jl
Original file line number Diff line number Diff line change
Expand Up @@ -75,8 +75,6 @@ StochasticStyle(::AbstractArray{T}) where {T} = default_style(T)
Create a "frozen" version of `dv` which can no longer be modified or used in the
conventional manner, but supports faster dot products.
If `dv` is an [`MPIData`](@ref Main.Rimu.RMPI.MPIData), synchronize its contents among the ranks first.
"""
freeze(v::AbstractVector) = copy(v)

Expand Down
50 changes: 0 additions & 50 deletions src/RMPI/RMPI.jl

This file was deleted.

173 changes: 0 additions & 173 deletions src/RMPI/alltoall.jl

This file was deleted.

Loading
Loading