Skip to content

Commit

Permalink
Setup documentation
Browse files Browse the repository at this point in the history
  • Loading branch information
neil-lindquist committed Feb 22, 2019
1 parent 3513a95 commit a91126e
Show file tree
Hide file tree
Showing 18 changed files with 285 additions and 28 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
Manifest.toml
docs/build/
29 changes: 21 additions & 8 deletions .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,31 +8,31 @@ julia:
- 1.0
- 1.1
- nightly

matrix:
allow_failures:
- julia: nightly

notifications:
email:
recipients:
- [email protected]
on_success: never
on_failure: always


cache:
directories:
- /home/travis/.julia/packages/MPI/
#MPI.jl needs mpi binaries plus compilers avalible

#MPI.jl needs mpi binaries plus compilers avalible
addons:
apt:
packages:
- gfortran
- mpich
- libmpich-dev

before_script:
- |
if [[ "$TRAVIS_OS_NAME" == "osx" ]]; then
Expand All @@ -41,7 +41,20 @@ before_script:
brew cask uninstall oclint # Prevent conflict with gcc
brew install mpich
fi
before_install:
- export CC=mpicc
- export FC=mpif90


# generate documentation
jobs:
include:
- stage: "Documentation"
julia: 1.1
os: linux
script:
- julia --project=docs/ -e 'using Pkg; Pkg.develop(PackageSpec(path=pwd()));
Pkg.instantiate()'
- julia --project=docs/ docs/make.jl
after_success: skip
4 changes: 3 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,6 +1,8 @@
# JuliaPetra

[![Build Status](https://travis-ci.org/Collegeville/JuliaPetra.jl.svg?branch=master)](https://travis-ci.org/Collegeville/JuliaPetra.jl)
[![Stable Docs](https://img.shields.io/badge/docs-stable-blue.svg)](https://Collegeville.github.io/JuliaPetra.jl/stable/)
[![Latest Docs](https://img.shields.io/badge/docs-latest-blue.svg)](https://Collegeville.github.io/JuliaPetra.jl/latest/)

This is an implmentation of [Trilinos's Petra Object Model](https://trilinos.github.io/data_service.html#trilinos-packages) in Julia.
It is a basic framework for sparse linear algebra.
Expand All @@ -12,4 +14,4 @@ JuliaPetra is licensed under the MIT "Expat" license. See LICENSE.md for more in
## Setup

JuliaPetra is not yet a registered package.
So to install it, run `add https://github.com/collegeville/JuliaPetra` from the Pkg REPL.
So to install it, run `add https://github.com/collegeville/JuliaPetra` from the Pkg REPL.
5 changes: 5 additions & 0 deletions docs/Project.toml
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
[deps]
Documenter = "e30172f5-a6a5-5a46-863b-614d45cd2de4"

[compat]
Documenter = "~0.21"
16 changes: 16 additions & 0 deletions docs/make.jl
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
using Documenter, JuliaPetra

makedocs(
modules = [JuliaPetra],
sitename="JuliaPetra",
pages = [
"Home" => "index.md",
"Communcation Layer" => "CommunicationLayer.md",
"Problem Distribution Layer" => "ProblemDistributionLayer.md",
"Linear Algebra Layer" => "LinearAlgebraLayer.md"
])


deploydocs(
repo = "github.com/collegeville/JuliaPetra.jl.git"
)
50 changes: 50 additions & 0 deletions docs/src/CommunicationLayer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
# Communications Layer

```@meta
CurrentModule = JuliaPetra
```

JuliaPetra abstracts communication with the [`Comm`](@ref) and [`Distributor`](@ref) interfaces.
There are two communication implementations with JuliaPetra [`SerialComm`](@ref) and [`MPIComm`](@ref).
Note that most objects dependent on inter-process communication support the [`getComm`](@ref) method.

## Interface

```@docs
Comm
Distributor
```

### Functions

```@docs
getComm
barrier
broadcastAll
gatherAll
sumAll
maxAll
minAll
scanSum
myPid
numProc
createDistributor
createFromSends
createFromRecvs
resolve
resolvePosts
resolveWaits
resolveReverse
resolveReversePosts
resolveReverseWaits
```

## Implementations

```@docs
LocalComm
SerialComm
SerialDistributor
MPIComm
MPIDistributor
```
49 changes: 49 additions & 0 deletions docs/src/LinearAlgebraLayer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,49 @@
# Linear Algebra Layer

```@meta
CurrentModule = JuliaPetra
```

The Linear Algebra layer provides the main abstractions for linear algebra codes.
The two top level interfaces are [`MultiVector`](@ref), for groups of vectors, and [`Operator`](@ref), for operations on `MultiVector`s.

## MultiVectors

MutliVectors support many basic array functions, including broadcasting.
Additionally, [`dot`] and [`norm`] are supported, however they return arrays since [`MultiVector`]s may have multiple dot products and norms.

```@docs
MultiVector
DenseMultiVector
localLength
globalLength
numVectors
getVectorView
getVectorCopy
getLocalArray
commReduce
```

## Operators

`Operator`s represent an operation on a [`MultiVector`](@ref), such as a matrix which applies a matrix-vector product.

```@docs
Operator
getRangeMap
getDomainMap
apply!
apply
TransposeMode
isTransposed
applyConjugation
```

### Matrices

Sparse matrices are the primary [`Operator`](@ref) in JuliaPetra.

```@docs
RowMatrix
CSRMatrix
```
77 changes: 77 additions & 0 deletions docs/src/ProblemDistributionLayer.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,77 @@
# Problem Distribution Layer

```@meta
CurrentModule = JuliaPetra
```

The Problem Distribution Layer managers how the problem is distributed across processes.
The main type is [`BlockMap`](@ref) which represents a problem distribution.

## BlockMap

```@docs
BlockMap
lid
gid
myLID
myGID
remoteIDList
minAllGID
maxAllGID
minMyGID
maxMyGID
minLID
maxLID
numGlobalElements
numMyElements
myGlobalElements
myGlobalElementIDs
uniqueGIDs
sameBlockMapDataAs
sameAs
globalIndicesType
linearMap
distributedGlobal
```

## Directory

```@docs
Directory
BasicDirectory
getDirectoryEntries
gidsAllUniquelyOwned
createDirectory
```

## Converting IDs Between Maps

```@docs
Export
Import
sourceMap
targetMap
distributor
isLocallyComplete
permuteToLIDs
permuteFromLIDs
exportLIDs
remoteLIDs
remotePIDs
numSameIDs
```

## Converting Data Structures Between Maps

Converting data structures between maps is built on the [`DistObject`](@ref) and [`SrcDistObject`](@ref) interfaces.

```@docs
DistObject
SrcDistObject
CombineMode
getMap
checkSizes
copyAndPermute
packAndPrepare
unpackAndCombine
```
11 changes: 11 additions & 0 deletions docs/src/index.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
# JuliaPetra

JuliaPetra is an implmentation of [Trilinos's Petra Object Model](https://trilinos.github.io/data_service.html#trilinos-packages) in Julia.
It is a basic framework for distributed sparse linear algebra.
Note that JuliaPetra uses Single Program Multiple Data parallelism instead of the master/worker parallelism often used in Julia.

# Organization
JuliaPetra is organized into a series of layers.
* The [Communications Layer](@ref) contains an interface for Single Program Multiple Data parallel systems
* The [Problem Distribution Layer](@ref) manages how the problem is distributed across the processes
* The [Linear Algebra Layer](@ref) provides the interfaces and implementations for linear algebra objects
4 changes: 2 additions & 2 deletions src/BlockMap.jl
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
export BlockMap
export remoteIDList, lid, gid, findLocalElementID
export remoteIDList, lid, gid
export minAllGID, maxAllGID, minMyGID, maxMyGID, minLID, maxLID
export numGlobalElements, myGlobalElements
export uniqueGIDs, globalIndicesType, sameBlockMapDataAs, sameAs
export linearMap, myGlobalElementIDs, comm
export linearMap, myGlobalElementIDs
export myGID, myLID, distributedGlobal, numMyElements


Expand Down
3 changes: 3 additions & 0 deletions src/CSRMatrix.jl
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@ export CSRMatrix, insertGlobalValues

using TypeStability

"""
An implementation of [`RowMatrix`](@ref) that uses CSR format
"""
mutable struct CSRMatrix{Data <: Number, GID <: Integer, PID <: Integer, LID <: Integer} <: RowMatrix{Data, GID, PID, LID}
rowMap::BlockMap{GID, PID, LID}
colMap::Union{BlockMap{GID, PID, LID}, Nothing}
Expand Down
2 changes: 1 addition & 1 deletion src/Comm.jl
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ scanSum(comm::Comm, val) = scanSum(comm, [val])[1]
"""
getComm(obj)
Gets the Comm for the object, if aplicable
Gets the Comm for the object, if applicable
"""
getComm(comm::Comm) = comm

Expand Down
2 changes: 1 addition & 1 deletion src/Directory.jl
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ export Directory, getDirectoryEntries, gidsAllUniquelyOwned
# methods and docs based straight off Epetra_Directory to match Comm

"""
A base type as an interface to allow Map and BlockMap objects to reference non-local
A base type as an interface to allow BlockMap objects to reference non-local
elements.
All subtypes must have the following methods, with DirectoryImpl standing in for
Expand Down
Loading

0 comments on commit a91126e

Please sign in to comment.