Physics Informed Preconditioners and Solvers
Project description
Physics Informed Preconditioners
Introduction
Pipre, short for Physics Informed Preconditioners, is a large-scale linear equation solver package. It supports distributed heterogeneous parallel computing (MPI+CPU/GPU/DCU/...) and provides physics-informed preconditioners for solvers, especially physics-informed AMG preconditioners. It is dedicated to stably and efficiently solving large-scale linear algebraic equations derived from the discretization of mathematical and physical models.
Install
$ pip install pypipre
Usage
use the following command to get the help message:
$ python -m pypipre help
copy the example out
$ cp -r path_to_pypipre/examples .
then run the example:
$ python solver.py thermal1.mtx thermal1_b.mtx solver.json
The following python script shows the above solver.py. read matrix A and vector b from MatrixMarket files, using CUDA to solve Ax=b.
# solver.py
import pypipre as pipre
import sys, re, os
#import json
import commentjson as json
fnA = sys.argv[1]
fnb = sys.argv[2]
config = sys.argv[3]
params = json.load(open(config))
A = pipre.ParCSRMatrix()
A.loadFromFile(fnA)
b = pipre.ParMatrix()
b.loadFromFile(fnb)
if b.getSize() == 0:
b.resize(A.getRows(), 1)
b.fill(1)
# transfer the matrix and vector to gpu 0.
dev = pipre.Device("cuda:0")
A = A.toDevice(dev)
b = b.toDevice(dev)
# use gpu 0 to finish the computation.
precond = pipre.createPrecond(params["preconditioner"])
precond.setup(A)
solver = pipre.createSolver(params["solver"])
solver.setup(A)
out = solver.solve(precond, A, b)
Solvers and Preconditioners
use
$ python -m pypipre info
to show the builtin solvers, preconditioners, smoothers, level_transfers.
Compatibility
-
OS version
Now support Linux, Ubuntu/Federa/... will be OK. Windows version will be available later.
-
PYTHON version
the python version is >=3.8.
-
GPU/CUDA version
If you want to use CUDA, ensure that CUDA Version >= 12.4.
-
DCU version
please contact us to compile the specified version.
-
DISTRIBUTED version
pypipre support MPI since pypipre-1.0.4.
License
This software is free software distributed under the Lesser General Public License or LGPL, version 3.0 or any later versions. This software distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more details.
You should have received a copy of the GNU Lesser General Public License along with PIPRE. If not, see http://www.gnu.org/licenses/.
This software depends on GLOG, AMGCL, their license files are located in the package.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pypipre-1.0.4-py3-none-any.whl.
File metadata
- Download URL: pypipre-1.0.4-py3-none-any.whl
- Upload date:
- Size: 21.8 MB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.12.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2bee94bc6c1f4d306d7f6b2b751e1c4ea39962bd9143854bb312618f187ac14d
|
|
| MD5 |
94d526cc1a122ffd8d6eb7dbe4d44091
|
|
| BLAKE2b-256 |
fe87c6b92ac110a3e0a434541cd9b48a9365f21b98ed5e11faf6d3bd7599ae3d
|