romtools.linalg#
This module defines the linear algebra functions used throughout the romtools library. These functions can be run in serial or parallel.
- class romtools.linalg.DistributedSvd(comm=None)[source]#
Bases:
objectNumPy-compatible thin SVD callable for a row-distributed matrix.
Bind an MPI communicator once, then pass this object anywhere a callable compatible with
numpy.linalg.svd()is expected, includingromtools.vector_space.VectorSpaceFromPOD.- Parameters:
comm (MPI_Comm) – Communicator over which matrix rows are distributed. If
None, supported calls delegate to NumPy in serial.
Example
>>> distributed_svd = DistributedSvd(comm) >>> U_local, s, Vh = distributed_svd( ... A_local, full_matrices=False, compute_uv=True, hermitian=False ... )
Modules
see this for why this file exists and is done this way https://stackoverflow.com/questions/47599162/pybind11-how-to-package-c-and-python-code-into-a-single-package?rq=1 |
|
Helper functions for testing and writing parallel code with the romtools.linalg module. |