Skip to content

Commit

Permalink
Update languages/julia/demos/scripts/README.md
Browse files Browse the repository at this point in the history
Updates from review.
  • Loading branch information
jmaack24 authored and diskwarrior committed Dec 11, 2020
1 parent 265029e commit 0e75f40
Showing 1 changed file with 17 additions and 9 deletions.
26 changes: 17 additions & 9 deletions languages/julia/demos/scripts/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,11 +9,14 @@
5. *pi_func.jl* -- "Library" functions for *mpi_jl_pi_as_lib.py* and *mpi_jl_cv_pi.py*.

### Environment Set Up
You will need to have Julia installed with the `julia` executable in your path prior to starting the following steps to setup the needed environment.
You will need to have Julia installed with the `julia` executable in your path prior to starting the following steps to setup the needed environment. For details on how to do this, see the [Julia bulid instructions](../../how-to-guides/install-Julia.md).

These instructions are given for python 3. The mpi4py and pyjulia modules do (as of this writing) support python 2. If you decide to use python 2, you will need to alter the below commands appropriately. It is also likely that the scripts in this directory will require alterations to work with python 2. However, given that python 2 is [no longer supported](https://www.python.org/doc/sunset-python-2/), it is recommended that you use python 3.

1. Create a conda environment with python, numpy installed and activate it:
```
conda create -c conda-forge --name py-jl-mpi python=3 numpy
conda activate py-jl-mpi
source activate py-jl-mpi
```
2. Load the MPI module of your choice. For example, OpenMPI 3.1.6 built with gcc 8.4.0:
```
Expand All @@ -27,29 +30,34 @@ You will need to have Julia installed with the `julia` executable in your path p
```
/nopt/nrel/apps/openmpi/3.1.6-centos77/bin/mpicc
```
4. Install pyjulia and mpi4py:
4. Check that julia is accessible from the command line
```
which julia
```
This should return the path the julia executable you desire to use with PyJulia.
5. Install pyjulia and mpi4py:
```
pip install julia mpi4py
pip3 install julia mpi4py
```
The install process for mpi4py picks out the MPI library it uses based on the `mpicc` executable it finds (hence step 3).
The install process for mpi4py picks out the MPI library it uses based on the `mpicc` executable it finds (hence step 3). The PyJulia module requires that your python installation must be able to call command line program julia (hence step 4).

5. Start the python interpreter and install the required julia packages:
6. Start the python interpreter and install the required julia packages:
```
python
import julia
julia.install()
```
6. Set environment variables to point MPI.jl at the same module loaded MPI:
7. Set environment variables to point MPI.jl at the same module loaded MPI:
```
export JULIA_MPI_BINARY=system
export JULIA_MPI_PATH=/nopt/nrel/apps/openmpi/3.1.6-centos77
```
7. Go to demo/scripts directory and start up Julia REPL:
8. Go to demo/scripts directory and start up Julia REPL:
```
cd demos/scripts
julia --project
```
8. Go to the package manager and install MPI.jl:
9. Go to the package manager and install MPI.jl:
```
]
instantiate
Expand Down

0 comments on commit 0e75f40

Please sign in to comment.