PyPardisoProject icon indicating copy to clipboard operation
PyPardisoProject copied to clipboard

ENH: manually set iparm & support `overwrite_b` parameter

Open capric98 opened this issue 6 months ago • 0 comments

  1. Manually set the iparm so that:

    • iparm(2)=103 to use an OMP version of fill-in reduce algorithm with L=10 optimization
    • iparm(6)=0 or 1 depends on overwrite b or not
    • iparm(35)=1 to use 0-based indexing, hence no need to add 1 for ia and ja
  2. Support overwrite_b parameter:

    • if b got an implicit copy in _check_b() (c_contiguous -> f_contiguous or b is not contiguous), or overwrite_b=True is explicitly provided by the user, however currently the ans array still need to be allocated (I change it to np.empty_like(b) to avoid a 0-fill overhead) because PARDISO will try to overwrite x with 0 if iparm(6)=1
    • removed return np.ascontiguousarray(x) in _call_pardiso(), in case user can benefit from keeping f_contiguous with overwrite_b=True or multiplicate ccontig matrix with fcontig matrix, etc.
  3. pytest result: 1 failed, 23 passed. There is a "ValueError: scipy.sparse does not support dtype float16." I guess it is not from my changes?

capric98 avatar Jul 24 '25 02:07 capric98