theislab / cellrank

CellRank: dynamics from multi-view single-cell data
https://cellrank.org
BSD 3-Clause "New" or "Revised" License
347 stars 46 forks source link

g.compute_schur get undefined symbol: ompi_mpi_op_null #902

Closed Roger-GOAT closed 1 year ago

Roger-GOAT commented 2 years ago

Dear cellrank team, thanks for the wonderful software! Recently, I get this error and can't repeat my result anymore. The env did not have been modified.

Computing Schur decomposition
---------------------------------------------------------------------------
ImportError                               Traceback (most recent call last)
Input In [33], in <cell line: 1>()
----> 1 g.compute_schur(n_components=20)
      2 g.plot_spectrum()

File ~/miniconda3/envs/cellrank2/lib/python3.8/site-packages/cellrank/tl/estimators/mixins/decomposition/_schur.py:165, in SchurMixin.compute_schur(self, n_components, initial_distribution, method, which, alpha)
    162 start = logg.info("Computing Schur decomposition")
    164 try:
--> 165     self._gpcca._do_schur_helper(n_components)
    166 except ValueError as e:
    167     if "will split complex conjugate eigenvalues" not in str(e):

File ~/miniconda3/envs/cellrank2/lib/python3.8/site-packages/pygpcca/_gpcca.py:853, in GPCCA._do_schur_helper(self, m)
    851                 logging.info("Using pre-computed Schur decomposition")
    852 else:
--> 853     self._p_X, self._p_R, self._p_eigenvalues = _do_schur(
    854         self._P, eta=self._eta, m=m, z=self._z, method=self._method
    855     )

File ~/miniconda3/envs/cellrank2/lib/python3.8/site-packages/pygpcca/_gpcca.py:254, in _do_schur(P, eta, m, z, method, tol_krylov)
    251     P_bar = np.diag(np.sqrt(eta)).dot(P).dot(np.diag(1.0 / np.sqrt(eta)))
    253 # Make a Schur decomposition of P_bar and sort the Schur vectors (and form).
--> 254 R, Q, eigenvalues = sorted_schur(P_bar, m, z, method, tol_krylov=tol_krylov)  # Pbar!!!
    256 # Orthonormalize the sorted Schur vectors Q via modified Gram-Schmidt-orthonormalization,
    257 # if the (Schur)vectors aren't orthogonal!
    258 if not np.allclose(Q.T.dot(Q * eta[:, None]), np.eye(Q.shape[1]), rtol=1e6 * EPS, atol=1e6 * EPS):

File ~/miniconda3/envs/cellrank2/lib/python3.8/site-packages/pygpcca/_sorted_schur.py:383, in sorted_schur(P, m, z, method, tol_krylov)
    381     R, Q, eigenvalues = sorted_brandts_schur(P=P, k=m, z=z)
    382 elif method == "krylov":
--> 383     R, Q, eigenvalues, _ = sorted_krylov_schur(P=P, k=m, z=z, tol=tol_krylov)
    384 else:
    385     raise ValueError(f"Unknown method `{method!r}`.")

File ~/miniconda3/envs/cellrank2/lib/python3.8/site-packages/pygpcca/_sorted_schur.py:225, in sorted_krylov_schur(P, k, z, tol)
    190 r"""
    191 Calculate an orthonormal basis of the subspace associated with the `k`
    192 dominant eigenvalues of `P` using the Krylov-Schur method as implemented in SLEPc.
   (...)
    218     norm, of the `i`th eigenpair at index `i`.
    219 """  # noqa: D205, D400
    220 # We like to thank A. Sikorski and M. Weber for pointing us to SLEPc for partial Schur decompositions of
    221 # sparse matrices.
    222 # Further parts of sorted_krylov_schur were developed based on the function krylov_schur
    223 # https://github.com/zib-cmd/cmdtools/blob/1c6b6d8e1c35bb487fcf247c5c1c622b4b665b0a/src/cmdtools/analysis/pcca.py#L64,
    224 # written by Alexander Sikorski.
--> 225 from petsc4py import PETSc
    226 from slepc4py import SLEPc
    228 M = PETSc.Mat().create()

File ~/.local/lib/python3.8/site-packages/petsc4py/PETSc.py:3, in <module>
      1 ARCH = None
      2 from petsc4py.lib import ImportPETSc
----> 3 PETSc = ImportPETSc(ARCH)
      4 PETSc._initialize()
      5 del PETSc

File ~/.local/lib/python3.8/site-packages/petsc4py/lib/__init__.py:29, in ImportPETSc(arch)
     25 """
     26 Import the PETSc extension module for a given configuration name.
     27 """
     28 path, arch = getPathArchPETSc(arch)
---> 29 return Import('petsc4py', 'PETSc', path, arch)

File ~/.local/lib/python3.8/site-packages/petsc4py/lib/__init__.py:73, in Import(pkg, name, path, arch)
     71 warnings.filterwarnings("ignore", message="numpy.ndarray size changed")
     72 # import extension module from 'path/arch' directory
---> 73 module = import_module(pkg, name, path, arch)
     74 module.__arch__ = arch  # save arch value
     75 setattr(sys.modules[pkg], name, module)

File ~/.local/lib/python3.8/site-packages/petsc4py/lib/__init__.py:58, in Import.<locals>.import_module(pkg, name, path, arch)
     56 pathlist = [os.path.join(path, arch)]
     57 f, fn, info = imp.find_module(name, pathlist)
---> 58 with f: return imp.load_module(fullname, f, fn, info)

File ~/miniconda3/envs/cellrank2/lib/python3.8/imp.py:242, in load_module(name, file, filename, details)
    240             return load_dynamic(name, filename, opened_file)
    241     else:
--> 242         return load_dynamic(name, filename, file)
    243 elif type_ == PKG_DIRECTORY:
    244     return load_package(name, filename)

File ~/miniconda3/envs/cellrank2/lib/python3.8/imp.py:342, in load_dynamic(name, path, file)
    338 # Issue #24748: Skip the sys.modules check in _load_module_shim;
    339 # always load new extension
    340 spec = importlib.machinery.ModuleSpec(
    341     name=name, loader=loader, origin=path)
--> 342 return _load(spec)

ImportError: /home/data/ssy102/.local/lib/python3.8/site-packages/petsc4py/lib/PETSc.cpython-38-x86_64-linux-gnu.so: undefined symbol: ompi_mpi_op_null
Marius1311 commented 2 years ago

Anything to do here @michalk8 ?

michalk8 commented 1 year ago

Closing this due to inactivity, hopefully new PETSc/SLEPc version solve this.