Skip to content

Commit

Permalink
Add shell script to create the development env
Browse files Browse the repository at this point in the history
  • Loading branch information
otvam committed Mar 8, 2023
1 parent 1cf6cb3 commit aa12d26
Show file tree
Hide file tree
Showing 2 changed files with 71 additions and 8 deletions.
22 changes: 14 additions & 8 deletions docs/technical.md
Original file line number Diff line number Diff line change
Expand Up @@ -28,13 +28,15 @@ The following platform and system configurations have been tested:
The code is reasonably optimized, leveraging NumPy and SciPy for the heavy operations.
All the code is vectorized, no loops are used for the array operations.
Sparse matrix algebra is used wherever appropriate to speed up the code and limit the memory consumption.
However, this code is pure Python and advanced optimizations (MKL, MPI, etc.) are not implemented.
Moreover, the memory consumption is not heavily optimized (no customized garbage collection).
Wherever possible, multithreading is used for exploiting multicore CPUs.

The following optional optimizations are available:
* FFTW can be used for computing FFTs (default is SciPy)
* UMFPACK can be used for factorizing sparse matrices (default is SuperLU)
* CuPy can be used for computing FFTs and matrix multiplications with GPUs (default is CPU)
* CuPy can be used for computing FFTs and matrix multiplications with GPUs (default is NumPy/SciPy))
* UMFPACK pr MKL/PARDISO can be used for factorizing sparse matrices (default is SuperLU)

Advanced optimizations (MKL, MPI, OpenMP, or C/FORTRAN) are not implemented.
Moreover, the memory consumption is not heavily optimized.

## Configuration

Expand All @@ -49,6 +51,7 @@ Afterwards, a custom configuration (JSON or YAML) file can be set:
* A Python package can be built from the `pyproject.toml` and `setup.cfg` files.
* In order to create a Python Virtual Environment, use `requirements.txt`.
* In order to create a Conda Environment, use `conda.yml`.
* In order to create a development environment, use `run_dev_env.sh`.

## Tests

Expand All @@ -62,6 +65,9 @@ Afterwards, a custom configuration (JSON or YAML) file can be set:
> **Warning**: For problems with magnetic domains, the preconditioner is not heavily optimized.
> This might lead to a very slow convergence of the matrix solver.
> **Warning**: For large problems, the code might allocate huge amounts of memory.
> This might crash the program and/or your operating system.
> **Warning**: The voxelization of STL files does consider tolerances.
> This implies same the same voxel can be assigned to several domains.
> The problem is solved with used-provided conflict resolution rules.
Expand All @@ -88,13 +94,13 @@ Afterwards, a custom configuration (JSON or YAML) file can be set:
# General Warnings

> **Warning**: For large problems, the code might allocate huge amounts of memory.
> This might crash the program and/or your operating system.
> **Warning**: Python Pickle files are using to store the mesher and solver results.
> Pickling data is not secure.
> Only load Pickle files that you trust.
> Do not commit the Pickle files in the Git repository.
> **Warning**: Some dependencies are under various licences (including copyleft and non-free).
> **Warning**: Some dependencies are under various licences (including copyleft and proprietary).
> Make sure to respect these licenses if you package and/or distribute these libraries.
> Qt is under copyleft licenses (GPL/LGPL).
> FFTW is under copyleft licenses (GPL).
> MKL/PARDISO is proprietary library (ISSL).
57 changes: 57 additions & 0 deletions run_dev_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
#!/bin/bash
# Script for creating the development environment:
# - using Conda for Python and MKL
# - using Pip for the Python packages
#
# (c) Thomas Guillod - Dartmouth College

set -o nounset
set -o pipefail

# check argument
if [ "$#" -ne 1 ]; then
echo "error : usage : run_dev.sh CONDA_PATH"
exit 1
fi

# activate conda
CONDA_PATH="$1/bin/activate"
source $CONDA_PATH

# remove previous env
conda env remove -n pypeec

# create new env
conda create -y -n pypeec python=3.10

# activate env
conda activate pypeec

# install the base packages
pip install -r requirements.txt

# package for building the package
pip install "build>=0.10"

# Jupyter notebook
pip install "jupyterlab>=3.6"

# Jupyter support for PyVista
pip install "pyvista[all,trame]>=0.38"

# FFTW optional library
pip install "pyFFTW>=0.13"

# UMFPACK optional library
pip install "scikit-umfpack>=0.3"

# MKL optional library
conda install -y "mkl-devel=2023.0.0"

# MKL/PARDISO optional library
pip install "pydiso>=0.0"

# CuPy optional library
pip install "cupy-cuda11x>=11.6"

exit 0

0 comments on commit aa12d26

Please sign in to comment.