Skip to content
Merged
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
15 changes: 12 additions & 3 deletions .github/workflows/documentation.yml.disabled
Original file line number Diff line number Diff line change
@@ -1,10 +1,19 @@
name: documentation
name: Documentation

on:
push:
branches: [ devel ]
paths:
- 'docs/**'
- 'psydac/**.py'

pull_request:
branches: [ devel ]
paths:
- 'docs/**'
- 'psydac/**.py'

workflow_dispatch:

permissions:
contents: read
Expand All @@ -29,7 +38,7 @@ jobs:
sudo apt install graphviz
- name: Install Python dependencies
run: |
python -m pip install -r docs_requirements.txt
python -m pip install -r docs/requirements.txt
- name: Make the sphinx doc
run: |
rm -rf docs/source/modules/STUBDIR
Expand All @@ -44,7 +53,7 @@ jobs:
path: 'docs/build/html'

deploy_docs:
if: github.event_name != 'pull_request'
if: github.event_name == 'push' && github.ref == 'refs/heads/devel'
needs: build_docs
runs-on: ubuntu-latest
environment:
Expand Down
9 changes: 0 additions & 9 deletions .github/workflows/testing.yml
Original file line number Diff line number Diff line change
Expand Up @@ -146,10 +146,6 @@ jobs:
python -m pip install wheel Cython numpy
python -m pip install src/binding/petsc4py

- name: Install Python dependencies
run: |
python -m pip install -r requirements.txt --no-cache-dir
python -m pip list
# - name: Check parallel h5py installation
# run: |
# python -c "
Expand Down Expand Up @@ -323,11 +319,6 @@ jobs:
python -m pip install wheel Cython numpy
python -m pip install src/binding/petsc4py

- name: Install Python dependencies
run: |
python -m pip install -r requirements.txt --no-cache-dir
python -m pip list

# - name: Check parallel h5py installation
# run: |
# python -c "
Expand Down
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -35,3 +35,5 @@ __test__/
env/
env*/
*env/
# Visual Studio Code workspace files
*.code-workspace
1 change: 0 additions & 1 deletion .travis.yml
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@ before_install:
- python -m pip uninstall -y sympde
- python -m pip uninstall -y pyccel
- python -m pip uninstall -y gelato
- python -m pip install -r requirements.txt

# command to install project
install:
Expand Down
10 changes: 10 additions & 0 deletions CITATION.bib
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
@inproceedings{Guclu2022,
title = {{{PSYDAC}}: A High-Performance {{IGA}} Library in {{Python}}},
booktitle = {8th {{European Congress}} on {{Computational Methods}} in {{Applied Sciences}} and {{Engineering}}},
author = {Güçlü, Y. and Hadjout, S. and Ratnani, A.},
year = {2022},
publisher = {CIMNE},
doi = {10.23967/eccomas.2022.227},
url = {https://www.scipedia.com/public/Guclu_et_al_2022a},
eventtitle = {8th {{European Congress}} on {{Computational Methods}} in {{Applied Sciences}} and {{Engineering}}},
}
202 changes: 202 additions & 0 deletions docs/installation.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,202 @@
# Installation

- [Requirements](#requirements)
- [Python setup and project download](#python-setup-and-project-download)
- [Installing the library](#installing-the-library)
- [Optional PETSc installation](#optional-petsc-installation)
- [Uninstall](#uninstall)

## Requirements

Psydac requires a certain number of components to be installed on the machine:

- Fortran and C compilers with OpenMP support
- OpenMP library
- BLAS and LAPACK libraries
- MPI library
- HDF5 library with MPI support

The installation instructions depend on the operating system and on the packaging manager used.

### Linux Debian-Ubuntu-Mint

To install all requirements on a Linux Ubuntu operating system, just use APT, the Advanced Packaging Tool:
```sh
sudo apt update
sudo apt install python3 python3-dev python3-pip
sudo apt install gcc gfortran
sudo apt install libblas-dev liblapack-dev
sudo apt install libopenmpi-dev openmpi-bin
sudo apt install libomp-dev libomp5
sudo apt install libhdf5-openmpi-dev
```

### macOS

To install all the requirements on a macOS operating system we recommend using [Homebrew](https://brew.sh/):

```eh
brew update
brew install gcc
brew install openblas
brew install lapack
brew install open-mpi
brew install libomp
brew install hdf5-mpi
```

### Other operating systems

Please see the [instructions for the pyccel library](https://github.com/pyccel/pyccel#Requirements) for further details.

### High-performance computers using Environment Modules

Many high-performance computers use [Environment Modules](https://modules.sourceforge.net/).
On those systems one typically needs to load the correct versions (i.e. compatible with each other) of the modules `gcc`, `openmpi`, and `hdf5-mpi`, e.g.

```sh
module load gcc/15
module load openmpi/5.0
module load hdf5-mpi/1.14.1
```
OpenMP instructions should work out of the box.
For access to BLAS and LAPACK routines there are usually different options, we refer therefore to any documentation provided by the supercomputer's maintainers.

## Python setup and project download

We recommend creating a clean Python virtual environment using [venv](https://packaging.python.org/en/latest/guides/installing-using-pip-and-virtual-environments/#creating-a-virtual-environment):
```sh
python3 -m venv <ENV-PATH>
```
where `<ENV-PATH>` is the location to create the virtual environment.
(A new directory will be created at the required location.)
In order to activate the environment just run the command
```sh
source <ENV-PATH>/bin/activate
```
At this point the commands `python` and [`pip`](https://pip.pypa.io/en/stable/) will refer to the Python 3 interpreter and package manager of the virtual environment, respectively.
Additionally, the command `deactivate` closes the environment.
It is good practice to keep `pip` up to date with
```sh
pip install --upgrade pip
```

One can clone the Psydac repository at any location `<ROOT-PATH>` in the filesystem which does not require administrator privileges, using either
```sh
git clone https://github.com/pyccel/psydac.git
```
or
```sh
git clone [email protected]:pyccel/psydac.git
```
The latter command requires a GitHub account.

## Installing the library

Psydac depends on several Python packages, which should be installed in the newly created virtual environment.
Almost all of these dependencies will be automatically installed by `pip` at the time of installing the `psydac` package later on.

The single exception is the `h5py` package, which needs to be installed in parallel mode.
This means that a wheel will be built from sources and linked to the local parallel HDF5 library.

To this end, we first set the environment variable `HDF5_DIR` s.t. the path `$HDF5_DIR/lib/` will correspond to the folder containing the dynamic library `libhdf5.so` (on Ubuntu/Debian) or `libhdf5.dylib` (on macOS).
This path can be obtained with a command which depends on your system.

- **Ubuntu/Debian**:
```sh
export HDF5_DIR=$(dpkg -L libhdf5-openmpi-dev | grep "libhdf5.so" | xargs dirname)
```

- **macOS**:
```sh
export HDF5_DIR=$(brew list hdf5-mpi | grep "libhdf5.dylib" | xargs dirname | xargs dirname)
```

- **High-performance computers using [Environment Modules](https://modules.sourceforge.net/)**:

The correct location of the HDF5 library can be found using the `module show` command, which reveals any environment variables after the `setenv` keyword.
For example, on this system both `HDF5_HOME` and `HDF5_ROOT` contain the information we need:

```sh
> module show hdf5-mpi/1.14.1

-------------------------------------------------------------------
/mpcdf/soft/SLE_15/sub/gcc_15/sub/openmpi_5_0/modules/libs/hdf5-mpi/1.14.1:

module-whatis {HDF5 library 1.14.1 with MPI support, built for openmpi_5_0_7_gcc_15_1}
conflict hdf5-serial
conflict hdf5-mpi
setenv HDF5_HOME /mpcdf/soft/SLE_15/packages/skylake/hdf5/gcc_15-15.1.0-openmpi_5.0-5.0.7/1.14.1
setenv HDF5_ROOT /mpcdf/soft/SLE_15/packages/skylake/hdf5/gcc_15-15.1.0-openmpi_5.0-5.0.7/1.14.1
prepend-path PATH /mpcdf/soft/SLE_15/packages/skylake/hdf5/gcc_15-15.1.0-openmpi_5.0-5.0.7/1.14.1/bin
-------------------------------------------------------------------
```

Therefore it is sufficient to set

```sh
export HDF5_DIR=$HDF5_HOME
```

Next, install `h5py` in parallel mode using `pip`:
```sh
export CC="mpicc"
export HDF5_MPI="ON"

pip install h5py --no-cache-dir --no-binary h5py
```

At this point the Psydac library may be installed from the cloned directory `<ROOT-PATH>/psydac` in **standard mode**, which copies the relevant files to the correct locations of the virtual environment, or in **development mode**, which only installs symbolic links to the Psydac directory. The latter mode allows one to affect the behavior of Psydac by modifying the source files.

- **Standard mode**:
```bash
pip install .
```

- **Development mode**:
```bash
pip install --editable .
```

## Optional PETSc installation

Although Psydac provides several iterative linear solvers which work with our native matrices and vectors, it is often useful to access a dedicated library like [PETSc](https://petsc.org). To this end, our matrices and vectors have the method `topetsc()`, which converts them to the corresponding `petsc4py` objects.
(`petsc4py` is a Python package which provides Python bindings to PETSc.) After solving the linear system with a PETSc solver, the function `petsc_to_psydac` allows converting the solution vector back to the Psydac format.

In order to use these additional feature, PETSc and petsc4py must be installed as follows.
First, we download the latest release of PETSc from its [official Git repository](https://gitlab.com/petsc/petsc):
```sh
git clone --depth 1 --branch v3.21.4 https://gitlab.com/petsc/petsc.git
```
Next, we specify a configuration for complex numbers, and install PETSc in a local directory:
```sh
cd petsc

export PETSC_DIR=$(pwd)
export PETSC_ARCH=petsc-cmplx

./configure --with-scalar-type=complex --with-fortran-bindings=0 --have-numpy=1

make all check

cd -
```
Finally, we install the Python package `petsc4py` which is included in the `PETSc` source distribution:
```sh
pip install wheel Cython numpy
pip install petsc/src/binding/petsc4py
```

## Uninstall

- **Whichever the install mode**:
```bash
pip uninstall psydac
```
- **If PETSc was installed**:
```bash
pip uninstall petsc4py
```

The non-Python dependencies can be uninstalled manually using the package manager.
In the case of PETSc, it is sufficient to remove the cloned source directory given that the installation has been performed locally.
9 changes: 9 additions & 0 deletions docs/psydac-mesh.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
# Mesh Generation

After installation, the command `psydac-mesh` will be available.

## Example of usage

```bash
psydac-mesh -n='16,16' -d='3,3' square mesh.h5
```
File renamed without changes.
12 changes: 3 additions & 9 deletions pyproject.toml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
[build-system]
requires = ["setuptools >= 64.0", "wheel", "numpy", "pyccel >= 1.11.2"]
requires = ["setuptools >= 64.0, != 67.2.0", "wheel", "numpy", "pyccel >= 2.0.1"]
build-backend = "setuptools.build_meta"

[project]
Expand All @@ -8,7 +8,7 @@ version = "2.4.5.dev0"
description = "Python package for isogeometric analysis (IGA)"
readme = "README.md"
requires-python = ">= 3.10"
license = "MIT"
license = {file = "LICENSE"}
authors = [
{name = "Psydac development team", email = "[email protected]"}
]
Expand All @@ -30,13 +30,7 @@ dependencies = [
'pyevtk',

# Our packages from PyPi
'pyccel >= 2.0',

# In addition, we depend on mpi4py and h5py (MPI version).
# Since h5py must be built from source, we run the commands
#
# python3 -m pip install requirements.txt
# python3 -m pip install .
'pyccel >= 2.0.1',
'mpi4py >= 4',
'h5py',

Expand Down
9 changes: 0 additions & 9 deletions requirements.txt

This file was deleted.