Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
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
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -6,3 +6,5 @@ pyranda.egg-info
*.o
*.so
*.a
pyranda/parcop/parcopmodule.c
pyranda/parcop/parcop-f2pywrappers2.f90
22 changes: 13 additions & 9 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -46,42 +46,47 @@ You can also verify that you're in your venv by checking your `$PATH`:
pip install . [--user]
```

###

## Installing without pip

```
[python setup.py build [extra_build_args]]
python setup.py install
```


## Legacy Instructions - Manual Install
This process should work on any system and will allow for an arbitrary compiler to be used for
This process should work on any system and will allow for an arbitrary compiler to be used for
the fortran and for the mpi4py.

### Step 1: Ensure python and numpy
#### Python-

#### Python
Though other versions of python may very well work, we recommend and support
python 2.7, 3.5, and 3.6 for pyranda.
#### numpy-

#### numpy
As long as numpy is working with your version of python above, there will be no
compability issues. This can be installed in a number of ways. http://www.numpy.org

### Step 2: Custom install of mpi4py
This python package provides MPI bindings to python and may or may not exists on your system
and python path.

#### Install mpi4py (this should work on most systems with a mpi compiler installed)
```
wget https://bitbucket.org/mpi4py/mpi4py/downloads/mpi4py-3.0.0.tar.gz
tar xvzf mpi4py-3.0.0.tar.gz
cd mpi4py*
export version=4.1.0
wget https://github.com/mpi4py/mpi4py/releases/download/$version/mpi4py-$version.tar.gz
tar xvzf mpi4py-$version.tar.gz
cd mpi4py-$version
python setup.py build --mpicc=/where/you/have/mpicc
python setup.py install --prefix=install_location_mpi4py
```

** Add install_location_mpi4py/*/site_packages to PYTHONPATH **

### Step 3: Pyranda build/install
A fortran compiler compatible with the mpicc used in mpi4py is used by default.
A fortran compiler compatible with the mpicc used in mpi4py is used by default.
2003 and above standards enforced and MPI libraries is required.
### Install pyranda
```
Expand All @@ -98,4 +103,3 @@ Trying navigating to pyranda/examples and running
```
python advection.py
```

9 changes: 6 additions & 3 deletions pyranda/parcop/makefile
Original file line number Diff line number Diff line change
Expand Up @@ -34,9 +34,10 @@ intel.fflags = -fPIC -O3 -cpp
# it's likely that mpiclang is using gfortran
clang.fflags = $(gnu.fflags)
ibm.linkflags = -qoffload -W@,-v -qsmp=omp -qinfo=omperrtrace
ibm.fflags = -fPIC -qxlf2003=polymorphic $(ibm.linkflags) -qsuffix=cpp=f90:f=f90
ibm.fflags = -fPIC -qxlf2003=polymorphic $(ibm.linkflags) -qsuffix=cpp=f90:f=f90
ibm.lopts = -qmkshrobj
pgi.fflags = -fPIC
cray.fflags = -ffree -efF -fPIC

sys_type = $(call use-if,$(SYS_TYPE),$(shell uname))
python ?= $(call use-if,$($(compiler).$(sys_type).python),$(shell which python))
Expand All @@ -56,8 +57,9 @@ python.Iflags = -I$(shell $(python) -c "from sysconfig import get_config_var; p
python.libdir = $(shell $(python) -c "from sysconfig import get_config_var; print(get_config_var('LIBDIR'))")
python.version = $(shell $(python) -c "from sysconfig import get_config_var; print(get_config_var('VERSION'))")
python.abiflag = $(shell $(python) -c "import sys; print(getattr(sys,'abiflags',''))")
# TODO: how should we do this so it's portable?
#python.Lflags = -L$(python.libdir) -Wl,-R$(python.libdir)
python.Lflags = -L$(python.libdir) -Wl,-rpath $(python.libdir)
python.Lflags = -L$(python.libdir) -Wl,-rpath=$(python.libdir)
python.lflags = -lpython$(python.version)$(python.abiflag)

numpy.dir = $(shell $(python) -c "import numpy; print(numpy.__path__[0])")
Expand All @@ -79,8 +81,9 @@ vpath %.c $(f2py.dir)
%.o: %.f90
$(mpif90) $(fflags) -c $<

# TODO: is `-Wno-implicit...` portable?
%.o: %.c
$(mpicc) -fPIC $(python.Iflags) $(numpy.Iflags) $(f2py.Iflags) -c $^
$(mpicc) -fPIC $(python.Iflags) $(numpy.Iflags) $(f2py.Iflags) -Wno-implicit-function-declaration -c $^

all: parcop.so test_pent

Expand Down
1 change: 1 addition & 0 deletions pyranda/parcop/vendor.sh
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,6 @@ echo $info | grep -i "ibm" > /dev/null && { echo "ibm"; exit 0; }
echo $info | grep -i "pgi" > /dev/null && { echo "pgi"; exit 0; }
echo $info | grep -i "clang" > /dev/null && { echo "clang"; exit 0; }
echo $info | grep -iE "gnu|gcc" > /dev/null && { echo "gnu"; exit 0; }
echo $info | grep -i "cray" > /dev/null && { echo "cray"; exit 0; }

echo $default
2 changes: 1 addition & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
matplotlib
numpy<2
numpy
scipy
mpi4py
24 changes: 24 additions & 0 deletions scripts/toss_4_x86_64_ib_cray.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
#!/bin/bash

test -e INSTALL.md || { echo "this must run from the root of pyranda"; exit 1; }

version=4.1.0
name=mpi4py-$version
mpicc=/usr/tce/packages/cray-mpich/cray-mpich-9.0.1-cce-20.0.0-magic/bin/mpicc


if [[ ! -d $name ]]; then
wget https://github.com/mpi4py/mpi4py/releases/download/$version/$name.tar.gz
tar xvzf $name.tar.gz
fi

if [[ ! $(pip list | grep mpi4py) ]]; then
pushd $name
python3 setup.py build --mpicc=$mpicc
python3 setup.py install
popd
fi

pip install -r requirements.txt

pip install .
Loading