Skip to content

Commit

Permalink
update docs
Browse files Browse the repository at this point in the history
  • Loading branch information
AStupidBear committed May 12, 2020
1 parent 6daff60 commit 76bcb9e
Show file tree
Hide file tree
Showing 3 changed files with 29 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Project.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
name = "GCMAES"
uuid = "4aa9d100-eb0f-11e8-15f1-25748831eb3b"
authors = ["Yao Lu <[email protected]>"]
version = "0.1.5"
version = "0.1.6"

[deps]
BSON = "fbb218c0-5317-5bc6-957e-2ee96dd4b1f0"
Expand Down
28 changes: 27 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,13 @@ using Pkg
pkg"add GCMAES"
```

## Features

- use low level BLAS operations to ensure performance
- use `Elemental` to do distributed eigendecomposition, which is crutial for high dimensional (>10000) problem
- compatible with `julia`'s native parallelism
- compatible with `MPI.jl`, therefore suitable to be run on clusters without good TCP connections

## Usage

```julia
Expand Down Expand Up @@ -35,4 +42,23 @@ using ForwardDiff
GCMAES.minimize((rastrigin, ∇rastrigin), x0, σ0, lo, hi, maxiter = 200)
```

A checkpoint file named `CMAES.bson` will be created in the current working directory during optimization, which will be loaded back to initilize `CMAESOpt` if dimensions are equal.
You can also enable `autodiff` and then `GCMAES` will internally use `Zygote` to do the gradient calculation

```julia
using Zygote
GCMAES.minimize((rastrigin, ∇rastrigin), x0, σ0, lo, hi, maxiter = 200, autodiff = true)
```

A checkpoint file named `CMAES.bson` will be created in the current working directory during optimization, which will be loaded back to initilize `CMAESOpt` if dimensions are equal.

## Parallel Usage

Just simply add `@mpirun` before `GCMAES.minimize`

```
# ....
@mpirun GCMAES.minimize(...)
# ....
```

Then you can use `mpirun -n N julia ...` or `julia -p N ...` to start your job.
1 change: 1 addition & 0 deletions src/util.jl
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,7 @@ macro mpirun(ex)
MPI.Barrier(MPI.COMM_WORLD)
$(esc(ex))
MPI.Barrier(MPI.COMM_WORLD)
atexit(MPI.Finalize)
end
end

Expand Down

0 comments on commit 76bcb9e

Please sign in to comment.