PSYDAC is a Python 3 Library for isogeometric analysis.
- Requirements
- Python setup and project download
- Installing the library
- Uninstall
- Running tests
- Speeding up Psydac's core
- User Documentation
- Code Documentation
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 installations instructions depend on the operating system and on the packaging manager used.
To install all requirements on a Linux Ubuntu operating system, just use APT, the Advanced Packaging Tool:
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
To install all the requirements on a macOS operating system we recommend using Homebrew:
brew update
brew install gcc
brew install openblas
brew install lapack
brew install open-mpi
brew install libomp
brew install hdf5-mpi
Please see the instructions for the pyccel library for further details.
We recommend creating a clean Python virtual environment using venv:
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 from a new terminal session just run the command
source <ENV-PATH>/bin/activate
One can clone the Psydac repository at any location <ROOT-PATH>
in the filesystem which does not require administrator privileges, using either
git clone https://github.com/pyccel/psydac.git
or
git clone git@github.com:pyccel/psydac.git
The latter command requires a GitHub account.
Psydac depends on several Python packages, which should be installed in the newly created virtual environment.
These dependencies can be installed from the cloned directory <ROOT-PATH>/psydac
using
export CC="mpicc"
export HDF5_MPI="ON"
export HDF5_DIR=/path/to/parallel/hdf5
python3 -m pip install --upgrade pip
python3 -m pip install -r requirements.txt
python3 -m pip install -r requirements_extra.txt --no-build-isolation
where the HDF5_DIR
environment variable should store the absolute path to the installation point of your parallel HDF5 library, which can be found with
h5pcc -showconfig
or (on macOS)
brew info hdf5-mpi
At this point the Psydac library may be installed 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 effect the behavior of Psydac by modifying the source files.
-
Standard mode:
python3 -m pip install .
-
Development mode:
python3 -m pip install --editable .
- Whichever the install mode:
python3 -m pip uninstall psydac
export PSYDAC_MESH_DIR=/path/to/psydac/mesh/
python3 -m pytest --pyargs psydac -m "not parallel"
python3 /path/to/psydac/mpi_tester.py --pyargs psydac -m "parallel"
Some of the low-level functions in psydac are written in python in a way that can be accelerated by pyccel. Currently, all of those are in psydac/core/kernels.py
, psydac/core/bsplines_pyccel.py
and psydac/linalg/kernels.py
.
cd path/to/psydac/core
pyccel kernels.py --language fortran
pyccel bsplines_pyccel.py --language fortran
cd ../linalg
pyccel kernels.py --language fortran
Find our latest code documentation here.
After installation, a command psydac-mesh
will be available.
psydac-mesh -n='16,16' -d='3,3' square mesh.h5