Skip to content

Commit

Permalink
update readme and project.toml
Browse files Browse the repository at this point in the history
  • Loading branch information
jalving committed Nov 2, 2020
1 parent a8aaefb commit fb03b81
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 18 deletions.
1 change: 1 addition & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"

[compat]
julia = "1"
Plasmo = "0.3.0"

[extras]
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"
34 changes: 16 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,33 @@
# PipsSolver.jl

[![Build Status](https://travis-ci.com/jalving/MGPipsSolver.jl.svg?branch=master)](https://travis-ci.com/jalving/PipsSolver.jl)
[![Codecov](https://codecov.io/gh/jalving/MGPipsSolver.jl/branch/master/graph/badge.svg)](https://codecov.io/gh/jalving/PipsSolver.jl)

## Overview
PipsSolver.jl is a Julia interface to the [PIPS-NLP](https://github.com/Argonne-National-Laboratory/PIPS/tree/master/PIPS-NLP) nonlinear optimization solver.
Running the solver requires a working PIPS-NLP installation following the [instructions](https://github.com/Argonne-National-Laboratory/PIPS).
The PipsSolver.jl package works with the graph-based algebraic modeling package [Plasmo.jl](https://github.com/zavalab/Plasmo.jl).

## Installation
PipsSolver.jl can be installed using the following Julia Pkg command.
PipsSolver.jl can be installed using the following Julia Pkg command. Note that currently, PipsSolver.jl only works with Plasmo.jl v0.3.0.

```julia
using Pkg
Pkg.add(Pkg.PackageSpec(name="Plasmo", version="0.3.0"))
Pkg.add(PackageSpec(url="https://github.com/zavalab/PipsSolver.jl.git"))
```

## Useage
```julia
using MPIClusterManagers # to import MPIManager
using Distributed # need to also import Distributed to use addprocs()
using Plasmo

#Setup worker environments
#This will load the environment specified in this script's directory onto each worker
@everywhere using Pkg
@everywhere Pkg.activate((@__DIR__))

#Load Plasmo and PipsSolver on every worker
@everywhere using Plasmo
@everywhere using PipsSolver

graph = OptiGraph()

Expand All @@ -47,21 +54,12 @@ manager=MPIManager(np=2) # specify, number of mpi workers, launch cmd, etc.
addprocs(manager) # start mpi workers and add them as julia workers too.


#Setup worker environments
#NOTE: You will need to load your Julia environment onto each worker
@everywhere using Pkg
@everywhere Pkg.activate((@__DIR__))

#Load Plasmo and PipsSolver on every worker
@everywhere using Plasmo
@everywhere using PipsSolver


julia_workers = sort(collect(values(manager.mpi2j))) # #Distribute the graph to workers

remote_references = PipsSolver.distribute(graph,julia_workers,remote_name = :pipsgraph) #create the variable pipsgraph on each worker
#Map julia workers to MPI ranks
julia_workers = sort(collect(values(manager.mpi2j)))
#Distribute the graph to workers. This creates the variable `pipsgraph` on each worker with an allocation of optinodes.
remote_references = PipsSolver.distribute(graph,julia_workers,remote_name = :pipsgraph)

# The remote modelgraphs can be queried if they are fetched from the other workers
# The remote optigraphs can be queried if they are fetched from the other workers.
r1 = fetch(remote_references[1])
r2 = fetch(remote_references[2])

Expand Down

0 comments on commit fb03b81

Please sign in to comment.