Giter Site home page Giter Site logo

pardiso.jl's Introduction

Pardiso.jl

CI Testing

The Pardiso.jl package provides an interface for using Panua Pardiso, it's predecessors from pardiso-project.org, and Intel MKL PARDISO from the Julia language.

You cannot use Pardiso.jl without either having a valid license for Panua Pardiso or having the MKL library installed. This package is available free of charge and in no way replaces or alters any functionality of the linked libraries.

Installation

The package itself is installed with Pkg.add("Pardiso") but you also need to follow the installation instructions below to install a working PARDISO library.

MKL PARDISO

By default, when adding "Pardiso.jl" to the active environmnent, Julia will automatically install a suitable MKL for your platform by loading MKL_jll.jl. Note that if you use a mac you will need to pin MKL_jll to version 2023.

If you instead use a self installed MKL, follow these instructions:

  • Set the MKLROOT environment variable. See the MKL set environment variables manual for a thorough guide how to set this variable correctly, typically done by executing something like source /opt/intel/oneapi/setvars.sh intel64 or running "C:\Program Files (x86)\IntelSWTools\compilers_and_libraries\windows\mkl\bin\mklvars.bat" intel64
  • Run Pkg.build("Pardiso", verbose=true)
  • Eventually, run Pardiso.show_build_log() to see the build log for additional information.
  • Note that the MKLROOT environment variable must be set, and LD_LIBRARY_PATH must contain $MKLROOT/lib whenever using the library this way.

PARDISO from panua.ch ("PanuaPardiso", formerly "ProjectPardiso")

  • Unzip the download file panua-pardiso-yyyymmdd-os.zip to some folder and set the environment variable JULIA_PARDISO to the lib subdirectory of this folder. For example, create an entry ENV["JULIA_PARDISO"] = "/Users/Someone/panua-pardiso-yyyymmdd-os/lib" in .julia/config/startup.jl. If you have a valid license for the predecessor from pardiso-project.org, put the PARDISO library to a subdirectory denoted by ENV["JULIA_PARDISO"] and evenutally rename it to libpardiso.so.
  • Perform the platform specific steps described below
  • Run Pkg.build("Pardiso", verbose=true)
  • Eventually, run Pardiso.show_build_log() to see the build log for additional information.

Note: In the past, weird errors and problems with MKL Pardiso had been observed when PanuaPardiso is enabled (likely because some library that is needed by PanauaPardiso was problematic with MKL). In that case, if you want to use MKL Pardiso it is better to just disable PanuaPardiso by not setting the environment variable JULIA_PARDISO (and rerunning Pkg.build("Pardiso")).

Linux / macOS specific
  • Make sure that the version of gfortran corresponding to the pardiso library is installed.
  • Make sure OpenMP is installed.
  • Install a (fast) installation of a BLAS and LAPACK (this should preferably be single threaded since PARDISO handles threading itself), using for example OpenBLAS

gfortran and OpenMP usually come with recent version of gcc/gfortran. On Linux, Panua Pardiso looks for libraries libgfortran.so and libgomp.so . They may be named differently on your system. In this situation you may try to create links to them with names known to Pardiso.jl (bash; pathnames serve as examples here):

$ mkdir $HOME/extralibs
$ ln -s /usr/lib64/libgomp.so.1 $HOME/extralibs/libgomp.so
$ ln -s /usr/lib64/libgfortran.so.5 $HOME/extralibs/libgfortran.so
$ export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$HOME/extralibs/

Basic Usage

This section will explain how to solve equations using Pardiso.jl with the default settings of the library. For more advanced users there is a section further down.

Creating the PardisoSolver

A PardisoSolver is created with PardisoSolver() for solving with PanuaPardiso or MKLPardisoSolver() for solving with MKL PARDISO. This object will hold the settings of the solver and will be passed into the solve functions. In the following sections an instance of a PardisoSolver or an MKLPardisoSolver() will be referred to as ps.

Solving

Solving equations is done with the solve and solve! functions. They have the following signatures:

  • solve(ps, A, B) solves AX=B and returns X
  • solve!(ps, X, A, B) solves AX=B and stores it in X

The symbols :T or :C can be added as an extra argument to solve the transposed or the conjugate transposed system of equations, respectively.

Here is an example of solving a system of real equations with two right-hand sides:

ps = PardisoSolver()

A = sparse(rand(10, 10))
B = rand(10, 2)
X = zeros(10, 2)
solve!(ps, X, A, B)

which happened to give the result

julia> X
10x2 Array{Float64,2}:
 -0.487361  -0.715372
 -0.644219  -3.38342
  0.465575   4.4838
  1.14448   -0.103854
  2.00892   -7.04965
  0.870507   1.7014
  0.590723  -5.74338
 -0.843841  -0.903796
 -0.279381   7.24754
 -1.17295    8.47922

Schur Complement (PanuaPardiso only)

Given a partitioned matrix M = [A B; C D], the Schur complement of A in M is S = D-CA⁻¹B. This can be found with the function schur_complement with the following signatures:

  • schur_complement(ps, M, n) returns Schur complement of submatrix A in M, where n is the size of submatrix D (and therefore also of Schur complement)
  • schur_complement(ps, M, x) returns Schur complement of submatrix A in M, where submatrix D is defined by nonzero rows of SparseVector or SparseMatrix x.

The symbols :T or :C can be added as an extra argument to solve the transposed or the conjugate transposed system of equations, respectively.

Here is an example of finding the Schur complement:

ps = PardisoSolver()
m = 100; n = 5; p = .5; T = Float64
rng = MersenneTwister(1234);
A = I + sprand(rng,T,m,m,p)
A⁻¹ = inv(Matrix(A))
B = sprand(rng,T,m,n,p)
C = sprand(rng,T,n,m,p)
D = sprand(rng,T,n,n,p)
M = [A B; C D]
S = schur_complement(ps,M,n)

which gives

julia> S
5×5 Array{Float64,2}:
  -0.121404    1.49473  -1.25965    7.40326    0.571538
 -19.4928     -7.71151  12.9496    -7.13646  -20.4194
   9.88029     3.35502  -7.2346     1.70651   13.9759
  -9.06094    -5.86454   7.44917   -2.54985   -9.17327
 -33.7006    -17.8323   20.2588   -19.5863   -37.6132

We can check the validity by comparing to explicity form:

julia> norm(D - C*A⁻¹*B - S)
5.033075778861378e-13

At present there seems to be an instability in the Schur complement computation for complex matrices.

Setting the number of threads

The number of threads to use is set in different ways for MKL PARDISO and PanuaPardiso.

MKL PARDISO

set_nprocs!(ps, i) # Sets the number of threads to use
get_nprocs(ps) # Gets the number of threads being used

PanuaPardiso

The number of threads are set at the creation of the PardisoSolver by looking for the environment variable OMP_NUM_THREADS. This can be done in Julia with for example ENV["OMP_NUM_THREADS"] = 2. Note: OMP_NUM_THREADS must be set before Pardiso is loaded and can not be changed during runtime.

The number of threads used by a PardisoSolver can be retrieved with get_nprocs(ps)

More advanced usage.

This section discusses some more advanced usage of Pardiso.jl.

For terminology in this section please refer to the PanuaPardiso manual and the oneMKL PARDISO manual.

After using functionality in this section, calls should no longer be made to the solve functions but instead directly to the function

pardiso(ps, X, A, B)

This will ensure that the properties you set will not be overwritten.

If you want, you can use get_matrix(ps, A, T) to return a matrix that is suitable to use with pardiso depending on the matrix type that ps has set. The parameter T is a symbol representing if you will solve the normal, transposed or conjugated system. These are represented by :N, :T, :C) respectively.

For ease of use, Pardiso.jl provides enums for most options. These are not exported so has to either be explicitly imported or qualified with the module name first. It is possible to both use the enum as an input key to the options or the corresponding integer as given in the manuals.

Setting the matrix type

The matrix type can be explicitly set with set_matrixtype!(ps, key) where the key has the following meaning:

enum integer Matrix type
REAL_SYM 1 real and structurally symmetric
REAL_SYM_POSDEF 2 real and symmetric positive definite
REAL_SYM_INDEF -2 real and symmetric indefinite
COMPLEX_STRUCT_SYM 3 complex and structurally symmetric
COMPLEX_HERM_POSDEF 4 complex and Hermitian positive definite
COMPLEX_HERM_INDEF -4 complex and Hermitian indefinite
COMPLEX_SYM 6 complex and symmetric
REAL_NONSYM 11 real and nonsymmetric
COMPLEX_NONSYM 13 complex and nonsymmetric

The matrix type for a solver can be retrieved with get_matrixtype(ps).

Setting the solver (PanuaPardiso only)

PanuatPardiso supports direct and iterative solvers. The solver is set with set_solver!(ps, key) where the key has the following meaning:

enum integer Solver
DIRECT_SOLVER 0 sparse direct solver
ITERATIVE_SOLVER 1 multi-recursive iterative solver

Setting the phase

Depending on the phase calls to solve (and pardiso which is mentioned later) does different things. The phase is set with set_phase!(ps, key) where key has the meaning:

enum integer Solver Execution Steps
ANALYSIS 11 Analysis
ANALYSIS_NUM_FACT 12 Analysis, numerical factorization
ANALYSIS_NUM_FACT_SOLVE_REFINE 13 Analysis, numerical factorization, solve, iterative refinement
NUM_FACT 22 Numerical factorization
SELECTED_INVERSION -22 Selected Inversion
NUM_FACT_SOLVE_REFINE 23 Numerical factorization, solve, iterative refinement
SOLVE_ITERATIVE_REFINE 33 Solve, iterative refinement
SOLVE_ITERATIVE_REFINE_ONLY_FORWARD 331 MKL only, like phase=33, but only forward substitution
SOLVE_ITERATIVE_REFINE_ONLY_DIAG 332 MKL only, like phase=33, but only diagonal substitution (if available)
SOLVE_ITERATIVE_REFINE_ONLY_BACKWARD 333 MKL only, like phase=33, but only backward substitution
RELEASE_LU_MNUM 0 Release internal memory for L and U matrix number MNUM
RELEASE_ALL -1 Release all internal memory for all matrices

Setting IPARM and DPARM explicitly

Advanced users likely want to explicitly set and retrieve the IPARM and DPARM (PanuaPardiso only) parameters. This can be done with the getters and setters:

get_iparm(ps, i) # Gets IPARM[i]
get_iparms(ps) # Gets IPARM
set_iparm!(ps, i, v) # Sets IPARM[i] = v

# PanuaPardiso only
get_dparm(ps, i) # Gets DPARM[i]
get_dparms(ps) # Gets DPARM
set_dparm!(ps, i, v) # Sets DPARM[i] = v

To set the default values of the IPARM and DPARM call pardisoinit(ps). The default values depend on what solver and matrix type is set.

Setting message level

It is possible for Pardiso to print out timings and statistics when solving. This is done by set_msglvl!(ps, key) where key has the meaning:

enum integer Solver
MESSAGE_LEVEL_OFF 0 no statistics printed
MESSAGE_LEVEL_ON 1 statistics printed

Matrix and vector checkers

PanuaPardiso comes with a few matrix and vector checkers to check the consistency and integrity of the input data. These can be called with the functions:

printstats(ps, A, B)
checkmatrix(ps, A)
checkvec(ps, B)

In MKL PARDISO this is instead done by setting IPARM[27] to 1 before calling pardiso.

MNUM, MAXFCT, PERM

These are set and retrieved with the functions

set_mnum!(ps, i)
get_mnum(ps)

set_maxfct!(ps, i)
get_maxfct(ps)

get_perm(ps)
set_perm!(ps, perm) # Perm is a Vector{Int}

Schur Complement (PanuaPardiso only)

The pardiso(ps,...) syntax can be used to compute the Schur compelement (as described below). The answer can be retrieved with pardisogetschur(ps).

To use the low-level API to compute the Schur complement:

  • use custom IPARMS (set_iparm!(ps,1,1)), set the Schur complement block size to n (set_iparm!(ps,38,n)), and set the phase to analyze & factorize (set_phase!(ps,12)).
  • compute the Schur complement by calling pardiso(ps,X,M,X), where B is a dummy vector with length(X)=size(M,1) that shares element type with M.
  • retrieve with pardisogetschur(ps)

Potential "gotchas"

  • Julia uses CSC sparse matrices while PARDISO expects a CSR matrix. These can be seen as transposes of each other so to solve AX = B the transpose flag (IPARAM[12]) should be set to 1.
  • For symmetric matrices, PARDISO needs to have the diagonal stored in the sparse structure even if the diagonal element happens to be 0. The manual recommends adding an eps to the diagonal when you suspect you might have 0 values diagonal elements that are not stored in the sparse structure.
  • Unless IPARM[1] = 1, all values in IPARM will be ignored and default values are used.
  • When solving a symmetric matrix, Pardiso expects only the upper triangular part. Since Julia has CSC matrices this means you should pass in tril(A) to the pardiso function. Use checkmatrix to see that you managed to get the matrix in a valid format.

Contributions

If you have suggestions or idea of improving this package, please file an issue or even better, create a PR!

pardiso.jl's People

Contributors

fverdugo avatar j-fu avatar knutam avatar kristofferc avatar lkapelevich avatar mipals avatar pablosanjose avatar pbellive avatar tehrengruber avatar tkelman avatar viralbshah avatar wrs28 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

pardiso.jl's Issues

found library but it failed to load due to: libpardiso500-WIN-X86-64.dll

  • Pardiso libary is in deps folder:
  • Working on Windows 10

Pkg.build("Pardiso") yields:

julia> Pkg.build("Pardiso")
INFO: Building Pardiso
found library but it failed to load due to:
could not load library "C:\Users\TEM\ .julia\v0.6\Pardiso\deps\libpardiso500-WIN-X86-64.dll"
�found library but it failed to load due to:
could not load library "libpardiso500-WIN-X86-64.dll"
did not find libpardiso, assuming PARDISO 5.0 is not installed
did not find MKLROOT key, assuming MKL is not installed
WARNING: no Pardiso library managed to load

any suggestions?

Thanks in advance

Issues linking MKL pardiso on Linux

@EveTC noticed that the following code doesn't work, on a fresh install of Julia v1.6.1 on Ubuntu:

using Pardiso, SparseArrays

ps = MKLPardisoSolver()

A = sparse(rand(10, 10))
B = rand(10, 2)
X = zeros(10, 2)
solve!(ps, X, A, B)

Error:

ERROR: could not load library "libmkl_rt"
libmkl_rt.so: cannot open shared object file: No such file or directory
Stacktrace:
 [1] dlopen(s::String, flags::UInt32; throw_error::Bool)
   @ Base.Libc.Libdl ./libdl.jl:114
 [2] dlopen (repeats 2 times)
   @ ./libdl.jl:114 [inlined]
 [3] top-level scope
   @ REPL[19]:1

Julia info:

Julia Version 1.6.1
Commit 6aaedecc44 (2021-04-23 05:59 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: Intel(R) Xeon(R) CPU E7-8867 v3 @ 2.50GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-11.0.1 (ORCJIT, haswell)

From Circuitscape/Circuitscape.jl#302 (comment), it seems like Pardiso.MKL_jll.libmkl_rt is pointing to the right place and the library seems to be loading. It's just unclear why Pardiso doesn't seem to see that.

Question about "set_iparm!(ps, i, v)"

I learned the following in the README file:

  • The format of sparse matrices in Julia is CSC, while that of MKL Pardiso is CSR.
  • When I use MKL Pardiso, I can use IPARM to set it up.
iparm[1] input Description
0 iparm(2) - iparm(64) are filled with default values.
≠0 You must supply all values in components iparm(2) - iparm(64).
iparm[12] input Description
0* Solve a linear system AX = B.
1 Solve a conjugate transposed system A(H)X = B based on the factorization of the matrix A.
2 Solve a transposed system A(T)X = B based on the factorization of the matrix A.

So I think I should set the iparm [1] to ≠0 first.Then I should set iparm [12] to =2 ,that means transpose my sparse matrix (CSC - > CSR)

My code as follows:

using Pardiso
using LinearAlgebra
using SparseArrays

ps = MKLPardisoSolver()
set_iparm!(ps, 1, 1) #not use default values.
set_iparm!(ps, 12, 2) #Solve with transposed or conjugate transposed matrix A. [line 6]

A = sparse([2. 1 0 0; 1 0 1 3; 0 1 2 0; 0 0 1 1])

B = [4.; 4; 2; 1]

X1 = solve(ps, A, B)

After running the code, I type in the repl:

Julia > get_iparm (ps, 12)
2

Here seems to be a reasonable answer.But when I change the code to set_iparm!(ps, 12, 2) in [line 6],get_iparm (ps, 12) still is 2,

That is to say, this line of code doesn't work. Why?

Segfault when OMP_NUM_THREADS > 1

julia> ENV["OMP_NUM_THREADS"] = 2
2

julia> ps = PardisoSolver()
Pardiso.PardisoSolver:
    Solver: Direct
    Matrix type: Real nonsymmetric
    Phase: Analysis, numerical factorization, solve, iterative refinement
    Num processors: 2

julia> solve(ps, A, B)
*** Error in `/home/kristoffer/julia0.4/julia': double free or corruption (!prev): 0x0000000003b1c9a0 ***

signal (6): Aborted
gsignal at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
abort at /lib/x86_64-linux-gnu/libc.so.6 (unknown line)
unknown function (ip: 0x7f413b4a2394)
unknown function (ip: 0x7f413b4ae66e)
pardiso_ccc_ at /home/kristoffer/julia0.4/usr/bin/../lib/libpardiso.so (unknown line)
pardiso_f_ at /home/kristoffer/julia0.4/usr/bin/../lib/libpardiso.so (unknown line)
pardiso at /home/kristoffer/.julia/v0.4/Pardiso/src/Pardiso.jl:199
solve! at /home/kristoffer/.julia/v0.4/Pardiso/src/Pardiso.jl:171
solve at /home/kristoffer/.julia/v0.4/Pardiso/src/Pardiso.jl:106
julia: malloc.c:3695: _int_malloc: Assertion `(unsigned long) (size) >= (unsigned long) (nb)' failed.
Aborted (core dumped)

could not load library "libblas"

I sometimes get the following error after building Pardiso:

julia> using Pardiso
[ Info: Precompiling Pardiso [46dd5b70-b6fb-5a00-ae2d-e8fea33afaf2]
  Error: Pardiso did not manage to load, error thrown was: could not load library "libblas"
 , libblas.so: cannot open shared object file: No such file or directory
  @ Pardiso ~/.julia/packages/Pardiso/tmemE/src/Pardiso.jl:167

julia> versioninfo()
Julia Version 1.4.0-DEV.111
Commit 4c8f8faa2b (2019-09-11 09:34 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i7-2600 CPU @ 3.40GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, sandybridge)
Environment:
  JULIA_PARDISO = /home/hypatia/pardiso

I can sometimes get around it by deleting everything in .julia/compiled/1.4 and re-installing Pardiso

Julia crashing (possibly due to project Pardiso version)

I am seeing crashing/segfaults from Pardiso.jl with (project) Pardiso.
I'm not sure if this is related, but the version of Pardiso that I got with my academic license was labelled as 7.0, though I get output that includes headers with PARDISO 6.0.0 in them.
The crashing is stochastic, the following code copied from one of the examples seems to triggers it:

using Pardiso
using SparseArrays
using Random
using Printf
using Test
verbose = true
n       = 4  # The number of equations.
m       = 3  # The number of right-hand sides.
A = sparse([ 1. 0 -2  3
             0  5  1  2
            -2  1  4 -7
             3  2 -7  5 ])
B = rand(n,m)
ps = PardisoSolver()
if verbose
    set_msglvl!(ps, Pardiso.MESSAGE_LEVEL_ON)
end
set_matrixtype!(ps, Pardiso.REAL_SYM_INDEF)
pardisoinit(ps)
fix_iparm!(ps, :N)
A_pardiso = get_matrix(ps, A, :N)
set_phase!(ps, Pardiso.ANALYSIS)
set_perm!(ps, randperm(n))
pardiso(ps, A_pardiso, B)
@printf("The factors have %d nonzero entries.\n", get_iparm(ps, 18))
set_phase!(ps, Pardiso.NUM_FACT)
pardiso(ps, A_pardiso, B)
set_phase!(ps, Pardiso.SOLVE_ITERATIVE_REFINE)
julia> B
malloc(): invalid size (unsorted)
signal (6): Aborted
in expression starting at REPL[24]:1

I'm using Julia 1.6.0.

intel mkl seems to be upgraded

It seems that "intel MKL" is called "intel oneAPI MKL" now and I can't find any bat file called "mklvars.bat" when I have installed "intel oneAPI MKL" ,but there is a "setvars.bat" file in the “oneAPI” directory.I use "setvars.bat" instead of "mklvars.bat" .Then I add Pardiso , build Pardiso , using Pardiso,and here I crashed ,it logs like
log
The crashed codes are as follow:
image
i want to know if it is wrong to use "setvars.bat" instead of "mklvars.bat" .

Pkg.build("PARDISO") - PARDISO 5.0 is not installed

Hi, I'm having hard time to install PARDISO package on Julia.
It would be great if someone can give me some advice.

Here's where I am now.

julia> Pkg.build("Pardiso")
INFO: Building Pardiso
did not find libpardiso, assuming PARDISO 5.0 is not installed
found MKLROOT key, using it

My work environment:

- MacBook Pro (macOS Sierra 10.12.6)
- Processor 2.6 Ghz Intel Core i7
- Memory 16GB 2133 MHz LPDDR3
- Julia 0.6

Pkg.status:

 - Ipopt                         0.2.6
 - JuMP                          0.17.1
 - Pardiso                       0.2.0              7d9a7a35 (dirty)
 - Juno                          0.3.0

Files that I prepared:
1) PARDISO 5.0: libpardiso500-MACOS-X86-64.dylib (http://www.pardiso-project.org/download)
2) Intel Math Kernel Library for macOS: m_mkl_2017.3.181.dmg (https://software.intel.com/en-us/mkl)

Terminal Command Result(open -e ~/.bash_profile):

PATH="/Library/Frameworks/Python.framework/Versions/3.6/bin:${PATH}"
export PATH
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:"/Users/SingingKim/Applications/IBM/ILOG/CPLEX_Studio1271/cplex/bin/x86-64_osx/"
export MKLROOT=“/opt/intel/mkl/bin/“
export PARDISO_PATH=”/Users/SingingKim/.julia/v0.6/Pardiso/deps“
export PATH="/Users/SingingKim/anaconda/bin:$PATH"

I've read all the past issues but I couldn't get a right answer for me.
Here's what I want to know.

1. Where should I put "libpardiso500-MACOS-X86-64.dylib" file?
I currently located it in dir: "/Users/[Username]/.julia/v0.6/Pardiso/deps".

2. Where and how should I set MKLROOT / PARDISO_PATH environment variables?
For now, I've changed .bash_profile as below:

export MKLROOT=“/opt/intel/mkl/bin/“
export PARDISO_PATH=”/Users/SingingKim/.julia/v0.6/Pardiso/deps“

3. Should I edit "deps.jl" or "build.jl" in Pardiso directory?
-If so, where should I add the following expressions?

const PARDISO_PATH = ["/Users/SingingKim/.julia/v0.6/Pardiso/deps/"]
@static if is_apple() begin
  const LIBPARDISONAMES = [ "libpardiso500-MACOS-X86-64.dylib" ]

end

4. Where should I put MKL license file that I downloaded from Intel webpage?

5. Where should I put Pardiso license key that I obtained from the webpage?

No error for MKL's Pardiso when matrix type = 4 and giving it a non pos def complex matrix

The method used in Base to check for positive definiteness when solving is to try the Cholesky factorization and catch a thrown IsNotPosDef error and in that case run the indefinite solver.

We try to do the same thing here and in the Real case it works ok and both solvers reports that the cholesky factorization failed:

using Pardiso

A = sprand(100,100, 0.05) + eps(Float64) * speye(100)
b = x = rand(100)

ps_50 = PardisoSolver()
ps_mkl = MKLPardisoSolver()
# Set matrix type to real symm pos def 
set_mtype(ps_50, 2)
set_mtype(ps_mkl, 2)
# Matrix is not pos def so this should throw
pardiso(ps_50, x, tril(A), b) # Throws error
pardiso(ps_mkl, x, tril(A), b) # Throws error

However, in the Complex case MKL's Pardiso silently gives the wrong solution without giving an error.

using Pardiso

A = (sprand(100,100, 0.05) + im*sprand(100,100, 0.05)) + eps(Float64) * (speye(100) + im * speye(100))
b = x = rand(Complex128, 100)

ps_50 = PardisoSolver()
ps_mkl = MKLPardisoSolver()
# Set matrix type to complex hermitian pos def 
set_mtype(ps_50, 4)
set_mtype(ps_mkl, 4)
# Matrix is not pos def so this should throw
pardiso(ps_50, x, tril(A), b) # Errors
pardiso(ps_mkl, x, tril(A), b) # No error but give wrong results

For now, as a workaround, when the matrix is hermitian and complex we just call the indefinite solver for MKLPardiso.

Linking with libmkl_rt fails on macOS Sierra + MKL 18

The currently selected MKL library is not working for my system:

global const libmkl_core = Libdl.dlopen(string(MKLROOT, "/lib/libmkl_rt"), Libdl.RTLD_GLOBAL)

If using this library, I get an Input inconsistent error when running the tests. Changing this library to:

global const libmkl_core = Libdl.dlopen(string(MKLROOT, "/lib/libmkl_intel_lp64"), Libdl.RTLD_GLOBAL)

Manages to fix the problem (for me).

I'm no expert on Intel MKL linking, but from what I thought, libmkl_rt is the "catch all" link that loads all the correct layers (threading, compute, and interface). I'm surprised that just linking the interface layer (libmkl_intel_lp64) allows Pardiso to run nicely, but it does.

Input inconsistent with MKL Pardiso and example in README.md

I just tried to run the example in the README.md with MKLPardisoSolver.
I use MKLSparse v1.1.0 and Pardiso v0.5.1 in Julia 1.5.1. MKL is installed automatically by MKLSparse.
Does somebody have any idea what could be the issue? The input matrix sizes seem to be correct.

Thank you for this nice package!

Example script:

using MKLSparse                                                                                                                                                       
using Pardiso                                                                                                                                                         
using SparseArrays                                                                                                                                                    
using LinearAlgebra                                                                                                                                                   
                                                                                                                                                                      
ps = MKLPardisoSolver()                                                                                                                                               
                                                                                                                                                                      
A = sparse(rand(10, 10))                                                                                                                                              
B = rand(10, 2)                                                                                                                                                       
X = zeros(10, 2)                                                                                                                                                      
solve!(ps, X, A, B)                                                                                                                                                   
                                                                                                                                                                      
#same error with                                                                                                                                                      
#B = rand(10)                                                                                                                                                         
#X = solve(ps, A, B)                                                                                                                                                  

Error message:

julia> solve!(ps, X, A, B)                                                                                                                                            
ERROR: Input inconsistent.                                                                                                                                            
Stacktrace:                                                                                                                                                           
 [1] check_error at /home/abarth/.julia/packages/Pardiso/yZsYO/src/mkl_pardiso.jl:76 [inlined]                                                                        
 [2] ccall_pardiso(::MKLPardisoSolver, ::Int64, ::Array{Float64,1}, ::Array{Int64,1}, ::Array{Int64,1}, ::Int64, ::Array{Float64,2}, ::Array{Float64,2}) at /home/aba\
rth/.julia/packages/Pardiso/yZsYO/src/mkl_pardiso.jl:71                                                                                                               
 [3] pardiso(::MKLPardisoSolver, ::Array{Float64,2}, ::SparseMatrixCSC{Float64,Int64}, ::Array{Float64,2}) at /home/abarth/.julia/packages/Pardiso/yZsYO/src/Pardiso.\
jl:337                                                                                                                                                                
 [4] solve!(::MKLPardisoSolver, ::Array{Float64,2}, ::SparseMatrixCSC{Float64,Int64}, ::Array{Float64,2}, ::Symbol) at /home/abarth/.julia/packages/Pardiso/yZsYO/src\
/Pardiso.jl:273                                                                                                                                                       
 [5] solve!(::MKLPardisoSolver, ::Array{Float64,2}, ::SparseMatrixCSC{Float64,Int64}, ::Array{Float64,2}) at /home/abarth/.julia/packages/Pardiso/yZsYO/src/Pardiso.j\
l:238                                                                                                                                                                 
 [6] top-level scope at REPL[71]:1             

Environment:

julia> versioninfo()                                                                                                                                                  
Julia Version 1.5.1                                                                                                                                                   
Commit 697e782ab8 (2020-08-25 20:08 UTC)                                                                                                                              
Platform Info:                                                                                                                                                        
  OS: Linux (x86_64-pc-linux-gnu)                                                                                                                                     
  CPU: Intel(R) Core(TM) i7-7700 CPU @ 3.60GHz                                                                                                                        
  WORD_SIZE: 64                                                                                                                                                       
  LIBM: libopenlibm                                                                                                                                                   
  LLVM: libLLVM-9.0.1 (ORCJIT, skylake)              

Example for set_solver!(ps, Pardiso.ITERATIVE_SOLVER)

Section 1.6, "Direct-Iterative Preconditioning for Nonsymmetric Linear Systems", of the PARDISO User Guide says

Many applications of sparse solvers require solutions of systems with gradually changing values of the nonzero coefficient matrix, but the same identical sparsity pattern. In these applications, the analysis phase of the solvers has to be performed only once and the numerical factorizations are the important time-consuming steps during the simulation. PARDISO uses a numerical factorization A = LU for the first system and applies these exact factors L and U for the next steps in a preconditioned Krylov-Subspace iteration.

So, when the matrix changes slightly, PARDISO has the capability to perform matrix factorization only once and uses it over and over again until the accumulated changes in the matrix becomes too large.

The User Guide continues to say

If the iteration does not converge, the solver will automatically switch back to the numerical factorization.

So, along the evolution of the matrix, it seems that the users do not have to decide when to discard the old factorization result by themselves: PARDISO has the capability to recognize such a situation automatically and generate a new factorization result.

Pardiso.jl seems to support these capabilities via set_solver!(ps, Pardiso.ITERATIVE_SOLVER), but I am not sure how to use this properly. It will be great to have an example of using ITERATIVE_SOLVER in the example directory, because avoiding factorization as much as possible reduces the total solution time significantly, as factorization is the most expensive step in the solution procedure.

Error in loading libgfortran, from updating to gfortran 9

I had the same error as in #37, but incremented by one.

By seeding the main_ver variable with 8 in line 152, the search for the gfortran library fails, and therefore loading libgfortran does as well.

Changing the line to gfortran_v = PARDISO_VERSION == 6 ? 9 : 7 corrects the problem.

What triggered this for me was doing a brew upgrade. This updated gcc to 9.1, which is why line 152 breaks. Alternatively, pin brew gcc to version 8.

issues with installing Pardiso

Hi all,

I've tried to install Pardiso in Julia on my Linux notebook.

I've downloaded libpardiso600-GNUXXX-X86-64.so to "/Users/manuel/Pardiso" and set
ENV["JULIA_PARDISO"] = "/Users/manuel/Pardiso" in .julia/config/startup.jl.

I can run

Pkg.add("Pardiso")
Pkg.build("Pardiso")
using Pardiso

without any error message, but

Pardiso.show_build_log()
gives
"no log file found"

and
PardisoSolver()
gives
"pardiso library was not loaded"

Which step did I miss?
Thank you very much for your help!

Support for Pardiso 6.0

I see on pardiso-project.org that Pardiso 6.0 has been released and that the binaries for Pardiso 5.0 are no longer available for download (and apparently now require a license fee?). Should this library be expected to work if the 6.0 binary is dropped in and the appropriate references in the build script are updated?

Cannot build Pardiso on Windows 10. Perhaps because I have AMD chip?

Hi. I am a brand new Julia user. I am investigating it because I have a very large scale NLP problem that I want to solve (3.5e6 variables, 70e3 linear constraints, 30e6 nonzero constraint coefficients). I thought combination of Ipopt and Pardiso, in Julia, might let me solve it. (The Ipopt default linear solver, Mumps, seems to hang up when I scale my problem up to full size.) However, have not figured out if I can use Pardiso.

System: Windows 10 Professional 64-bit, with AMD 8-core chip, 32gb RAM. Have obtained libpardiso500-WIN-X86-64.dll and academic license. (Perhaps the problem is that Pardiso won't run on AMD chip?)

Have successfully installed Ipopt package in Julia. Installed Pardiso package. Tried to build Pardiso package but get error: "did not find libpardiso, assuming PARDISO 5.0 is not installed". Have verified that Julia can find the Pardiso dll, with isfile(path) where path is path of the dll. Tried to load it with Libdl.dlopen(path, Libdl.RTLD_GLOBAL) but get the error: "could not load library [my path] The operation completed successfully. in dlopen(::String, ::UInt32) at libdl.jl:90"

So I suspect that my problem is the dll itself, but I hold out hope that there might be a solution because the Julia Pardiso package documentation does not say that I must have an Intel chip.

With that as background, would you mind telling me:

  • do you believe this is correct - the Pardiso dll will not work on an AMD chip?
  • if so, do you know of any other options for running Pardiso in Julia on AMD chip?
  • any other advice?

Many thanks in advance!

Build on Mac (10.12.6)

I'm trying to use Pardiso on a Mac and was wondering if anyone could provide guidance.

I downloaded Pardiso 5, ran Pkg.add("Pardiso"), then moved the libpardiso500-MACOS-X86-64.dylib library into ~/.julia/v0.6/Pardiso/deps and tried Pkg.build("Pardiso"). However, I'm getting the following errors:

FO: Building Pardiso
found library but it failed to load due to:
could not load library "/Users/jakeroth/.julia/v0.6/Pardiso/deps/libpardiso500-MACOS-X86-64.dylib"
dlopen(/Users/jakeroth/.julia/v0.6/Pardiso/deps/libpardiso500-MACOS-X86-64.dylib, 9): Library not loaded: /usr/local/lib/libgfortran.3.dylib
  Referenced from: /Users/jakeroth/.julia/v0.6/Pardiso/deps/libpardiso500-MACOS-X86-64.dylib
  Reason: image not foundfound library but it failed to load due to:
could not load library "libpardiso500-MACOS-X86-64.dylib"
dlopen(libpardiso500-MACOS-X86-64.dylib, 9): Library not loaded: /usr/local/lib/libgfortran.3.dylib
  Referenced from: /Users/jakeroth/.julia/v0.6/Pardiso/deps/libpardiso500-MACOS-X86-64.dylib
  Reason: image not founddid not find libpardiso, assuming PARDISO 5.0 is not installed
did not find MKLROOT key, assuming MKL is not installed
WARNING: no Pardiso library managed to load

Any advice? Thanks!

Failure on Intel Mac

I've encountered this error while running Pardiso on an Intel Mac. (I observed this largely on Julia v1.7 but I could not get a chance to double check whether this happens on 1.6). It causes the test failure here

The error is like:

Raster Pairwise: Error During Test at /Users/runner/work/Circuitscape.jl/Circuitscape.jl/src/utils.jl:308
  Got exception outside of a @test
  Not enough memory.
  Stacktrace:
    [1] check_error(ps::Pardiso.MKLPardisoSolver, err::Int32)
      @ Pardiso ~/.julia/packages/Pardiso/3uj3F/src/mkl_pardiso.jl:79
    [2] ccall_pardiso(ps::Pardiso.MKLPardisoSolver, N::Int64, nzval::Vector{Float64}, colptr::Vector{Int64}, rowval::Vector{Int64}, NRHS::Int64, B::Vector{Float64}, X::Vector{Float64})
      @ Pardiso ~/.julia/packages/Pardiso/3uj3F/src/mkl_pardiso.jl:73
    [3] pardiso(ps::Pardiso.MKLPardisoSolver, X::Vector{Float64}, A::SparseArrays.SparseMatrixCSC{Float64, Int64}, B::Vector{Float64})
      @ Pardiso ~/.julia/packages/Pardiso/3uj3F/src/Pardiso.jl:346
    [4] #_#36
      @ ~/work/Circuitscape.jl/Circuitscape.jl/src/utils.jl:459 [inlined]

(Full error)[https://github.com/Circuitscape/Circuitscape.jl/runs/4644991065?check_suite_focus=true#step:6:180]

To reproduce:

using JLD2, FileIO
ps = MKLPardisoSolver()

A = load("mat2.jld2")["G"]
B = rand(size(A,1))
X = zeros(size(A,1))
solve!(ps, X, A, B)

I've attached the matrix JLD2 here.

mat2.zip

Uncommitted changes in src/Pardiso.jl ?

Hi,
when cloning your repo the file src/Pardiso.jl does not appear to get pulled. git status shows that that file is modified but not staged for commit.

Or I am missing something?

Thanks

P.S.

I am trying to get this package working under OSX

Setting the number of threads

I'm using Pardiso. jl to solve large sparse equations in the form of Ax = B,A is 420000X420000,B is 420000X1,x is 420000X1,The code is as follows:

function solve(A,B)
    ps = MKLPardisoSolver()
    set_nprocs!(ps,24)
    result = similar(B)
    result = solve(ps, A, B)
    return result
end

1.During the execution of the calculation, I saw that my CPU utilization was about 38%.
2.Time about 43s.
If I comment out set_nprocs!(ps,24),The CPU usage rate and the time spent solving remain unchanged. Why?(By the way, if it's set correctly, is it CP when encountering a large matrix?)

wrong solution for multiple rhs

Hello,

I wanted to report that I am getting a solution with large errors from Pardiso. I tried to simplify the code in case you want to replicate the result. I have two rhs. If I solve each system separate, I get the correct solution for both.

[Amatrix.txt](https://github.com/JuliaSparse/Pardiso.jl/files/3811826/Amatrix.txt)
[xx.txt](https://github.com/JuliaSparse/Pardiso.jl/files/3811827/xx.txt)
[yy.txt](https://github.com/JuliaSparse/Pardiso.jl/files/3811828/yy.txt)

using SparseArrays, LinearAlgebra, Pardiso, DelimitedFiles

# load the matrices of size [A is symmetric and positive definite -> 59x59] [xx -> 59x2] [yy -> 59x2] 
Amatrix = readdlm("Amatrix.txt");  xx = readdlm("xx.txt"); yy = readdlm("yy.txt");

# convert to sparse 
A = sparse(Amatrix)

# solve (basic usage way)
ps = PardisoSolver()
solve!(ps, xx, A, yy)

@show norm(A*xx-yy) # what I get: 0.6085402893836485 

I'm using Ubuntu 18.04/Pardiso 6.0/gcc version 7.4.0

MethodError: no method matching solve(::MKLPardisoSolver, ::SparseMatrixCSC{Complex{Float64},Int64}, ::SparseMatrixCSC{Complex{Float64},Int64})

using Pardiso
ps = MKLPardisoSolver()
solve(ps , A, b)

gives the following error

MethodError: no method matching solve(::MKLPardisoSolver, ::SparseMatrixCSC{Complex{Float64},Int64}, ::SparseMatrixCSC{Complex{Float64},Int64})
Closest candidates are:
solve(::Pardiso.AbstractPardisoSolver, ::SparseMatrixCSC{Tv,Ti}, !Matched::Union{DenseArray{Tv,1}, DenseArray{Tv,2}, Base.ReinterpretArray{Tv,1,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray}, Base.ReinterpretArray{Tv,2,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray}, Base.ReshapedArray{Tv,1,A,MI} where MI<:Tuple{Vararg{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64},N} where N} where A<:Union{Base.ReinterpretArray{T,N,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray} where N where T, SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray}, Base.ReshapedArray{Tv,2,A,MI} where MI<:Tuple{Vararg{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64},N} where N} where A<:Union{Base.ReinterpretArray{T,N,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray} where N where T, SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray}, SubArray{Tv,1,A,I,L} where L where I<:Tuple{Vararg{Union{Int64, AbstractRange{Int64}, Base.AbstractCartesianIndex},N} where N} where A<:Union{Base.ReinterpretArray{T,N,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray} where N where T, Base.ReshapedArray{T,N,A,MI} where MI<:Tuple{Vararg{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64},N} where N} where A<:Union{Base.ReinterpretArray{T,N,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray} where N where T, SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray} where N where T, DenseArray}, SubArray{Tv,2,A,I,L} where L where I<:Tuple{Vararg{Union{Int64, AbstractRange{Int64}, Base.AbstractCartesianIndex},N} where N} where A<:Union{Base.ReinterpretArray{T,N,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray} where N where T, Base.ReshapedArray{T,N,A,MI} where MI<:Tuple{Vararg{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64},N} where N} where A<:Union{Base.ReinterpretArray{T,N,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray} where N where T, SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray} where N where T, DenseArray}}) where {Ti, Tv<:Union{Complex{Float64}, Float64}} at /home/mohamed/.julia/packages/Pardiso/swIFG/src/Pardiso.jl:219
solve(::Pardiso.AbstractPardisoSolver, ::SparseMatrixCSC{Tv,Ti}, !Matched::Union{DenseArray{Tv,1}, DenseArray{Tv,2}, Base.ReinterpretArray{Tv,1,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray}, Base.ReinterpretArray{Tv,2,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray}, Base.ReshapedArray{Tv,1,A,MI} where MI<:Tuple{Vararg{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64},N} where N} where A<:Union{Base.ReinterpretArray{T,N,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray} where N where T, SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray}, Base.ReshapedArray{Tv,2,A,MI} where MI<:Tuple{Vararg{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64},N} where N} where A<:Union{Base.ReinterpretArray{T,N,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray} where N where T, SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray}, SubArray{Tv,1,A,I,L} where L where I<:Tuple{Vararg{Union{Int64, AbstractRange{Int64}, Base.AbstractCartesianIndex},N} where N} where A<:Union{Base.ReinterpretArray{T,N,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray} where N where T, Base.ReshapedArray{T,N,A,MI} where MI<:Tuple{Vararg{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64},N} where N} where A<:Union{Base.ReinterpretArray{T,N,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray} where N where T, SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray} where N where T, DenseArray}, SubArray{Tv,2,A,I,L} where L where I<:Tuple{Vararg{Union{Int64, AbstractRange{Int64}, Base.AbstractCartesianIndex},N} where N} where A<:Union{Base.ReinterpretArray{T,N,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray} where N where T, Base.ReshapedArray{T,N,A,MI} where MI<:Tuple{Vararg{Base.MultiplicativeInverses.SignedMultiplicativeInverse{Int64},N} where N} where A<:Union{Base.ReinterpretArray{T,N,S,A} where S where A<:Union{SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray} where N where T, SubArray{T,N,A,I,true} where I<:Union{Tuple{Vararg{Real,N} where N}, Tuple{AbstractUnitRange,Vararg{Any,N} where N}} where A<:DenseArray where N where T, DenseArray} where N where T, DenseArray}}, !Matched::Symbol) where {Ti, Tv<:Union{Complex{Float64}, Float64}} at /home/mohamed/.julia/packages/Pardiso/swIFG/src/Pardiso.jl:219

Stacktrace:
[1] top-level scope at In[308]:4

Pardiso 6 significantly slower than MKL Pardiso

Hi,

I just tried solving the 2D Laplacian on a 2,000 by 2,000 grid using Pardiso 6 and MKL Pardiso and MKL Pardiso is almost 2X faster. Based on the Pardiso website, it should be the opposite by a significant margin (they have reported ~10X faster factorization using Pardiso 6).

Have you also experienced the same issue and is that normal?

Thanks,
Amin

Schur complement calculation

I would like to get the Schur-complement of the system I am dealing with. It seems we can compute it by using the flag iparm(38). What would be a good way to do so in this package? Thank you.

MKL Pardiso with multiple threads

I am encountering a problem when trying to set the number of threads for the MKLPardisoSolver. In this example, I set the number of threads to 2:

using Pardiso, LinearAlgebra, SparseArrays
n = 4
m = 3

A = sparse([ 1. 0 -2  3
             0  5  1  2
            -2  1  4 -7
             3  2 -7  5 ])

B = rand(n,m)

ps = MKLPardisoSolver()

set_msglvl!(ps, Pardiso.MESSAGE_LEVEL_ON)
set_nprocs!(ps, 2)

X1 = solve(ps, A, B)
get_nprocs(ps)

However, the last line get_nprocs(ps) returns 1. Running the script, produces the following output:

=== PARDISO is running in In-Core mode, because iparam(60)=0 ===

Percentage of computed non-zeros for LL^T factorization
 25 %  100 % 
*** Error in PARDISO  ( numerical_factorization) error_num= -1
*** Error in PARDISO: zero or negative pivot, A is not SPD-matrix

=== PARDISO: solving a symmetric positive definite system ===
1-based array indexing is turned ON
PARDISO double precision computation is turned ON
METIS algorithm at reorder step is turned ON
Scaling is turned ON
Matching is turned ON
Single-level factorization algorithm is turned ON


Summary: ( starting phase is reordering, ending phase is solution )
================

Times:
======
Time spent in calculations of symmetric matrix portrait (fulladj): 0.000002 s
Time spent in reordering of the initial matrix (reorder)         : 0.000068 s
Time spent in symbolic factorization (symbfct)                   : 0.000015 s
Time spent in data preparations for factorization (parlist)      : 0.000000 s
Time spent in copying matrix to internal data structure (A to LU): 0.000000 s
Time spent in factorization step (numfct)                        : 0.000000 s
Time spent in allocation of internal data structures (malloc)    : 0.000083 s
Time spent in additional calculations                            : 0.000061 s
Total time spent                                                 : 0.000229 s

Statistics:
===========
Parallel Direct Factorization is running on 1 OpenMP

< Linear system Ax = b >
             number of equations:           4
             number of non-zeros in A:      9
             number of non-zeros in A (%): 56.250000

             number of right-hand sides:    3

< Factors L and U >
             number of columns for each panel: 128
             number of independent subgraphs:  0
< Preprocessing with state of the art partitioning metis>
             number of supernodes:                    2
             size of largest supernode:               3
             number of non-zeros in L:                12
             number of non-zeros in U:                1
             number of non-zeros in L+U:              13
             gflop   for the numerical factorization: 0.000000


Percentage of computed non-zeros for LL^T factorization
 25 %  100 % 

=== PARDISO: solving a symmetric indefinite system ===
1-based array indexing is turned ON
PARDISO double precision computation is turned ON
METIS algorithm at reorder step is turned ON
Scaling is turned ON
Matching is turned ON
Single-level factorization algorithm is turned ON


Summary: ( starting phase is reordering, ending phase is solution )
================

Times:
======
Time spent in calculations of symmetric matrix portrait (fulladj): 0.000002 s
Time spent in reordering of the initial matrix (reorder)         : 0.000000 s
Time spent in symbolic factorization (symbfct)                   : 0.000015 s
Time spent in data preparations for factorization (parlist)      : 0.000001 s
Time spent in copying matrix to internal data structure (A to LU): 0.000000 s
Time spent in factorization step (numfct)                        : 0.000056 s
Time spent in direct solver at solve step (solve)                : 0.000025 s
Time spent in allocation of internal data structures (malloc)    : 0.000297 s
Time spent in additional calculations                            : 0.000007 s
Total time spent                                                 : 0.000403 s

Statistics:
===========
Parallel Direct Factorization is running on 1 OpenMP

< Linear system Ax = b >
             number of equations:           4
             number of non-zeros in A:      9
             number of non-zeros in A (%): 56.250000

             number of right-hand sides:    3

< Factors L and U >
             number of columns for each panel: 128
             number of independent subgraphs:  0
< Preprocessing with state of the art partitioning metis>
             number of supernodes:                    2
             size of largest supernode:               3
             number of non-zeros in L:                12
             number of non-zeros in U:                1
             number of non-zeros in L+U:              13
             gflop   for the numerical factorization: 0.000000

             gflop/s for the numerical factorization: 0.000321

1

Again it seems like only one thread is used. I am using a Late 2013 MacBook Pro with Julia 1.1. Multicore Pardiso 6.0 works for me

issues when using Pardiso

I have installed the MKL and Pardiso 6.0 following the instruction. Pardiso.show_build_log() seems like give a right feedback, see

Pardiso library
===============
Looking for libraries with name: libpardiso600-WIN-X86-64.dll, libpardiso500-WIN-X86-64.dll.
Looking in "C:\Users\dell.juliapro\JuliaPro_v1.2.0-1\packages\Pardiso\swIFG\deps" for libraries
Looking in "G:\Program Files\Pardiso" for libraries
found "G:\Program Files\Pardiso\libpardiso600-WIN-X86-64.dll", attempting to load it...
loaded successfully!
MKL Pardiso
=============
found MKLROOT environment variable, using it

However, when type using Pardiso, I got the following errors

[ Info: Recompiling stale cache file C:\Users\dell.juliapro\JuliaPro_v1.2.0-1\compiled\v1.2\Pardiso\KlXnB.ji for Pardiso [46dd5b70-b6fb-5a00-ae2d-e8fea33afaf2]
┌ Error: MKL Pardiso did not manage to load, error thrown was: could not load library "C:\Program Files (x86)\Intel\oneAPI\mkl\2021.3.0..\redist\intel64\mkl\mkl_rt.dll"
│ The specified module could not be found.
└ @ Pardiso C:\Users\dell.juliapro\JuliaPro_v1.2.0-1\packages\Pardiso\swIFG\src\Pardiso.jl:134
┌ Error: Pardiso did not manage to load, error thrown was: could not load library "libgfortran.dll" l"
│ The specified module could not be found.
└ @ Pardiso C:\Users\dell.juliapro\JuliaPro_v1.2.0-1\packages\Pardiso\swIFG\src\Pardiso.jl:167

Did I miss something during the installation? How to fix it? Thank you so much.

ERROR: could not load library "libgfortran" on Ubuntu

I starting getting this error when calling Pardiso.

ERROR: could not load library "libgfortran"
libgfortran.so: cannot open shared object file: No such file or directory
Stacktrace:
 [1] dlopen(::String, ::UInt32) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.0/Libdl/src/Libdl.jl:97 (repeats 2 times)
 [2] top-level scope at none:0

I'm not sure what exactly caused this but I believe the logic on line 152 is incorrect. I changed it to

gfortran_v = PARDISO_VERSION == 6 ? 7 : 7

and the error went away.

`could not load library "libmkl_rt"` in linux with MKL_jll v2020.0.166+1

I've run into a problem using Pardiso.jl with the current MKL artifact under linux. Running:

using Pkg
Pkg.add("Pardiso")
Pkg.test("Pardiso")

results in

    Testing Pardiso
Status `/tmp/jl_E2Qv2h/Manifest.toml`
  [1d5cc7b8] IntelOpenMP_jll v2018.0.3+0
  [856f044c] MKL_jll v2020.0.166+1
  [46dd5b70] Pardiso v0.5.1
  [2a0f44e3] Base64 
  [ade2ca70] Dates 
  [8ba89e20] Distributed 
  [b77e0a4c] InteractiveUtils 
  [76f85450] LibGit2 
  [8f399da3] Libdl 
  [37e2e46d] LinearAlgebra 
  [56ddb016] Logging 
  [d6f4376e] Markdown 
  [44cfe95a] Pkg 
  [de0858da] Printf 
  [3fa0cd96] REPL 
  [9a3f8284] Random 
  [ea8e919c] SHA 
  [9e88b42a] Serialization 
  [6462fe0b] Sockets 
  [2f01184e] SparseArrays 
  [8dfed614] Test 
  [cf7118a7] UUIDs 
  [4ec0a83e] Unicode 
┌ Warning: Not testing project Pardiso solver
└ @ Main ~/.julia/packages/Pardiso/yZsYO/test/runtests.jl:15
Pardiso.MklInt = Int32
Testing DataType[MKLPardisoSolver]
solving: Error During Test at /home/parallels/.julia/packages/Pardiso/yZsYO/test/runtests.jl:23
  Got exception outside of a @test
  could not load library "libmkl_rt"
  libmkl_rt.so: cannot open shared object file: No such file or directory
  Stacktrace:
   [1] ccall_pardisoinit(::MKLPardisoSolver) at /home/parallels/.julia/packages/Pardiso/yZsYO/src/mkl_pardiso.jl:47
   [2] pardisoinit at /home/parallels/.julia/packages/Pardiso/yZsYO/src/Pardiso.jl:205 [inlined]
   [3] solve!(::MKLPardisoSolver, ::Array{Float64,2}, ::SparseMatrixCSC{Float64,Int64}, ::Array{Float64,2}, ::Symbol) at /home/parallels/.julia/packages/Pardiso/yZsYO/src/Pardiso.jl:271
   [4] solve!(::MKLPardisoSolver, ::Array{Float64,2}, ::SparseMatrixCSC{Float64,Int64}, ::Array{Float64,2}) at /home/parallels/.julia/packages/Pardiso/yZsYO/src/Pardiso.jl:238
   [5] macro expansion at /home/parallels/.julia/packages/Pardiso/yZsYO/test/runtests.jl:32 [inlined]
   [6] macro expansion at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/Test/src/Test.jl:1113 [inlined]
   [7] top-level scope at /home/parallels/.julia/packages/Pardiso/yZsYO/test/runtests.jl:24
   [8] include(::String) at ./client.jl:439
   [9] top-level scope at none:6
   [10] eval(::Module, ::Any) at ./boot.jl:331
   [11] exec_options(::Base.JLOptions) at ./client.jl:264
   [12] _start() at ./client.jl:484
  
Test Summary: | Error  Total
solving       |     1      1
ERROR: LoadError: Some tests did not pass: 0 passed, 0 failed, 1 errored, 0 broken.
in expression starting at /home/parallels/.julia/packages/Pardiso/yZsYO/test/runtests.jl:23
ERROR: Package Pardiso errored during testing
Stacktrace:
 [1] pkgerror(::String, ::Vararg{String,N} where N) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/Pkg/src/Types.jl:53
 [2] test(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}; coverage::Bool, julia_args::Cmd, test_args::Cmd, test_fn::Nothing) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/Pkg/src/Operations.jl:1503
 [3] test(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}; coverage::Bool, test_fn::Nothing, julia_args::Cmd, test_args::Cmd, kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:316
 [4] test(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:303
 [5] #test#68 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:297 [inlined]
 [6] test at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:297 [inlined]
 [7] #test#67 at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:296 [inlined]
 [8] test at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:296 [inlined]
 [9] test(::String; kwargs::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:295
 [10] test(::String) at /buildworker/worker/package_linux64/build/usr/share/julia/stdlib/v1.4/Pkg/src/API.jl:295
 [11] top-level scope at REPL[7]:1

Rolling back MKL_jll to the previous release seems to work fine:

using Pkg
Pkg.add(PackageSpec(name = "MKL_jll", rev = "d1c8bec"))
Pkg.add("Pardiso")
Pkg.test("Pardiso")
    Testing Pardiso
Status `/tmp/jl_iXoN27/Manifest.toml`
  [1d5cc7b8] IntelOpenMP_jll v2018.0.3+0
  [856f044c] MKL_jll v2020.0.166+0 #d1c8bec (https://github.com/JuliaBinaryWrappers/MKL_jll.jl.git)
  [46dd5b70] Pardiso v0.5.1
  [2a0f44e3] Base64 
  [ade2ca70] Dates 
  [8ba89e20] Distributed 
  [b77e0a4c] InteractiveUtils 
  [76f85450] LibGit2 
  [8f399da3] Libdl 
  [37e2e46d] LinearAlgebra 
  [56ddb016] Logging 
  [d6f4376e] Markdown 
  [44cfe95a] Pkg 
  [de0858da] Printf 
  [3fa0cd96] REPL 
  [9a3f8284] Random 
  [ea8e919c] SHA 
  [9e88b42a] Serialization 
  [6462fe0b] Sockets 
  [2f01184e] SparseArrays 
  [8dfed614] Test 
  [cf7118a7] UUIDs 
  [4ec0a83e] Unicode 
Downloading artifact: MKL
--2020-04-28 14:11:47--  https://github.com/JuliaBinaryWrappers/MKL_jll.jl/releases/download/MKL-v2020.0.166+0/MKL.v2020.0.166.x86_64-linux-gnu.tar.gz
Resolving github.com (github.com)... 140.82.114.3
Connecting to github.com (github.com)|140.82.114.3|:443... connected.
HTTP request sent, awaiting response... 302 Found
Location: https://github-production-release-asset-2e65be.s3.amazonaws.com/219038758/09b4d580-4d2b-11ea-924b-8a68026d81ae?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200428%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200428T211147Z&X-Amz-Expires=300&X-Amz-Signature=42a688580dffb4d49f5552aea5580c67446118b7d7c0f02d00e7301fddc57d9b&X-Amz-SignedHeaders=host&actor_id=0&repo_id=219038758&response-content-disposition=attachment%3B%20filename%3DMKL.v2020.0.166.x86_64-linux-gnu.tar.gz&response-content-type=application%2Foctet-stream [following]
--2020-04-28 14:11:47--  https://github-production-release-asset-2e65be.s3.amazonaws.com/219038758/09b4d580-4d2b-11ea-924b-8a68026d81ae?X-Amz-Algorithm=AWS4-HMAC-SHA256&X-Amz-Credential=AKIAIWNJYAX4CSVEH53A%2F20200428%2Fus-east-1%2Fs3%2Faws4_request&X-Amz-Date=20200428T211147Z&X-Amz-Expires=300&X-Amz-Signature=42a688580dffb4d49f5552aea5580c67446118b7d7c0f02d00e7301fddc57d9b&X-Amz-SignedHeaders=host&actor_id=0&repo_id=219038758&response-content-disposition=attachment%3B%20filename%3DMKL.v2020.0.166.x86_64-linux-gnu.tar.gz&response-content-type=application%2Foctet-stream
Resolving github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)... 52.217.42.84
Connecting to github-production-release-asset-2e65be.s3.amazonaws.com (github-production-release-asset-2e65be.s3.amazonaws.com)|52.217.42.84|:443... connected.
HTTP request sent, awaiting response... 200 OK
Length: 255917206 (244M) [application/octet-stream]
Saving to:/tmp/jl_vKXV8x-download.gz’

/tmp/jl_vKXV8x-download.gz         100%[=============================================================>] 244.06M  21.3MB/s    in 12s     

2020-04-28 14:12:00 (20.7 MB/s) -/tmp/jl_vKXV8x-download.gz’ saved [255917206/255917206]
┌ Warning: Not testing project Pardiso solver
└ @ Main ~/.julia/packages/Pardiso/yZsYO/test/runtests.jl:15
Pardiso.MklInt = Int32
Testing DataType[MKLPardisoSolver]
Test Summary: | Pass  Total
solving       |   96     96
The factors have 14 nonzero entries.
The matrix has 0 positive and 0 negative eigenvalues.
PARDISO performed 0 iterative refinement steps.
The maximum residual for the solution X is 1.33e-15.
The factors have 13 nonzero entries.
The matrix has 3 positive and 1 negative eigenvalues.
PARDISO performed 0 iterative refinement steps.
The maximum residual for the solution X is 1.98e-14.
The factors have 289 nonzero entries.
PARDISO performed 0 iterative refinement steps.
The maximum residual for the solution is 4.48e-16.
Test Summary: | Pass  Total
error checks  |    5      5
Test Summary:       | Pass  Total
getters and setters |    8      8
    Testing Pardiso tests passed 

Everything works as expected with the latest version on MaxOS and on Windows.

unable to create MKLPardisoSolver

Hi,
I have been trying to load Pardiso on a server (running julia 1.5.0), which already provides me with intel-mkl but I have been having issues creating the solver.

I fire up julia and immediately set ENV["MKLROOT"] to the right path. Then using Pardiso already gives me:

┌ Error: MKL Pardiso did not manage to load, error thrown was: could not load library "libgomp.so"
│ libgomp.so: cannot open shared object file: No such file or directory
└ @ Pardiso ~/.julia/packages/Pardiso/66TFF/src/Pardiso.jl:134

but the package seems to load just fine. In fact Pardiso.show_build_log() tells me

MKL Pardiso
=============
found MKLROOT environment variable, using it

However, when I try running ps = MKLPardisoSolver() I get:

ERROR: mkl library was not loaded, unable to create solver
Stacktrace:
 [1] error(::String) at ./error.jl:33
 [2] MKLPardisoSolver() at /home/rcioffi/.julia/packages/Pardiso/66TFF/src/mkl_pardiso.jl:17
 [3] top-level scope at REPL[4]:1

The problem seems related to #21 and #22 but I couldn't figure out a solution.

Note: I read in a different issue the latest version is somehow not compatible with julia < 1.6 so I have been working with Pardiso v0.4.2

Methods with SubArrays

It would be nice if the methods would work also for SubArrays. Would defining them for StridedVecOrMat instead of `VecOrMat work or there is a limitation on Pardiso side?

Large matrix solve: "julia-debug" received signal SIGSEGV, Segmentation fault.

When solving a large matrix (~9e7 unknowns) on my cluster I am getting a segmentation fault. However, smaller matrices generated by the same code base can be solved (~2e7 unknowns). I guess it's possible that I'm running out of memory, but I would think that an OutOfMemory error would be thrown in that case.

Just in case this is the output of running my code through a debug build of Julia:

Thread 23 "julia-debug" received signal SIGSEGV, Segmentation fault.
[Switching to Thread 0x2aaaf5203700 (LWP 50103)]
0x00002aaaabbb4864 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
(gdb) bt
#0  0x00002aaaabbb4864 in ?? () from /lib/x86_64-linux-gnu/libc.so.6
#1  0x00002aaad5130643 in ?? ()
   from /home/------/.julia/v0.6/Pardiso/deps/libpardiso500-GNU481-X86-64.so
#2  0x00002aaad555743e in ?? () from /usr/lib/x86_64-linux-gnu/libgomp.so.1
#3  0x00002aaaab9106fa in start_thread () from /lib/x86_64-linux-gnu/libpthread.so.0
#4  0x00002aaaabc2cb5d in clone () from /lib/x86_64-linux-gnu/libc.so.6

This is the output of versioninfo()

Julia Version 0.6.2
Commit d386e40c17 (2017-12-13 18:08 UTC)
Platform Info:
  OS: Linux (x86_64-pc-linux-gnu)
  CPU: AMD Opteron(tm) Processor 6386 SE
  WORD_SIZE: 64
  BLAS: libopenblas (USE64BITINT DYNAMIC_ARCH NO_AFFINITY Piledriver)
  LAPACK: libopenblas64_
  LIBM: libopenlibm
  LLVM: libLLVM-3.9.1 (ORCJIT, bdver1)

`libgomp` not loaded if using MKLPardiso in Linux

Simple problem with a simple fix. When I run Pkg.test("Pardiso"), I get a failure:

/opt/julia/bin/julia: symbol lookup error: /opt/intel/mkl/lib/intel64/libmkl_gnu_thread.so: undefined symbol: omp_get_num_procs

Looks like the line global const libgomp = Libdl.dlopen("libgomp", Libdl.RTLD_GLOBAL) is missing at around

global const libmkl_core = Libdl.dlopen(string(MKLROOT, "/lib/intel64/libmkl_core"), Libdl.RTLD_GLOBAL)
global const libmkl_threaded = Libdl.dlopen(string(MKLROOT, "/lib/intel64/libmkl_gnu_thread"), Libdl.RTLD_GLOBAL)
global const libmkl_gd = Libdl.dlopen(string(MKLROOT, "/lib/intel64/libmkl_gf_lp64"), Libdl.RTLD_GLOBAL)
global const mkl_init = Libdl.dlsym(libmkl_gd, "pardisoinit")
global const mkl_pardiso_f = Libdl.dlsym(libmkl_gd, "pardiso")
global const set_nthreads = Libdl.dlsym(libmkl_gd, "mkl_domain_set_num_threads")
global const get_nthreads = Libdl.dlsym(libmkl_gd, "mkl_domain_get_max_threads")

It was there in v0.2.0, and now it isn't. Adding that line back fixes the issue - Pkg.test("Pardiso") passes.

Error in building in version 1.0

Hello,

I was not able to install correctly Pardiso.jl in 1.0.

I got the following error:

add Pardiso#master
   Cloning git-repo `https://github.com/JuliaSparse/Pardiso.jl.git`
  Updating git-repo `https://github.com/JuliaSparse/Pardiso.jl.git`
 Resolving package versions...
  Updating `~/.julia/environments/v1.0/Project.toml`
  [46dd5b70] + Pardiso v0.3.2+ #master (https://github.com/JuliaSparse/Pardiso.jl.git)
  Updating `~/.julia/environments/v1.0/Manifest.toml`
  [46dd5b70] + Pardiso v0.3.2+ #master (https://github.com/JuliaSparse/Pardiso.jl.git)
  Building Pardiso → `~/.julia/packages/Pardiso/dKH0m/deps/build.log`
┌ Error: Error building `Pardiso`: 
│ ERROR: LoadError: UndefVarError: STDERR not defined
│ Stacktrace:
│  [1] eprintln(::String) at /home/carlo/.julia/packages/Pardiso/dKH0m/deps/build.jl:21
│  [2] find_paradisolib() at /home/carlo/.julia/packages/Pardiso/dKH0m/deps/build.jl:42
│  [3] top-level scope at none:0
│  [4] include at ./boot.jl:317 [inlined]
│  [5] include_relative(::Module, ::String) at ./loading.jl:1038
│  [6] include(::Module, ::String) at ./sysimg.jl:29
│  [7] include(::String) at ./client.jl:388
│  [8] top-level scope at none:0
│ in expression starting at /home/carlo/.julia/packages/Pardiso/dKH0m/deps/build.jl:55
└ @ Pkg.Operations ~/Software/julia/juliarepo/julia1.0mkl/julia/usr/share/julia/stdlib/v1.0/Pkg/src/Operations.jl:1068

Thank you!!

having error while running Pkg.build("Pardiso")

Hi,
I have the following error while I run Pkg.build("Pardiso")**, could you please tell me how to fix the problem.

julia> Pkg.update()
INFO: Updating METADATA...
INFO: Updating cache of FixedPointNumbers...
INFO: Computing changes...
INFO: Upgrading FixedPointNumbers: v0.1.5 => v0.1.6

julia> Pkg.add("Pardiso")
INFO: Nothing to be done

julia> Pkg.build("Pardiso")
INFO: Building Pardiso
WARNING: @unix_only is deprecated, use @static if is_unix() instead
in depwarn(::String, ::Symbol) at ./deprecated.jl:64
in depwarn(::String, ::Symbol) at /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib:?
in @unix_only(::Any) at ./deprecated.jl:493
in include_from_node1(::String) at ./loading.jl:426
in include_from_node1(::String) at /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib:?
in evalfile(::String, ::Array{String,1}) at ./loading.jl:442 (repeats 2 times)
in cd(::##2#4, ::String) at ./file.jl:59
in (::##1#3)(::IOStream) at ./none:13
in open(::##1#3, ::String, ::String) at ./iostream.jl:113
in eval(::Module, ::Any) at ./boot.jl:234
in eval(::Module, ::Any) at /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib:?
in process_options(::Base.JLOptions) at ./client.jl:239
in _start() at ./client.jl:318
in _start() at /Applications/Julia-0.5.app/Contents/Resources/julia/lib/julia/sys.dylib:?
while loading /Users/fatimachegini/.julia/v0.5/Pardiso/deps/build.jl, in expression starting on line 4
did not find libpardiso, assuming PARDISO 5.0 is not installed
did not find MKLROOT key, assuming MKL is not installed
WARNING: no Pardiso library managed to load

Pardiso library found but not?

julia> Pardiso.show_build_log()
could not load library "C:\Users\accou\.julia\external\libpardiso600-WIN-X86-64.dll"
The specified module could not be found.
Pardiso library
===============
Looking for libraries with name: libpardiso600-WIN-X86-64.dll.
Looking in "C:\Users\accou\.julia\packages\Pardiso\GDj1P\deps" for libraries
Looking in "C:\Users\accou\.julia\external" for libraries
    found "C:\Users\accou\.julia\external\libpardiso600-WIN-X86-64.dll", attempting to load it...
    failed to load due to:
did not find libpardiso, assuming PARDISO 5/6 is not installed

MKL Pardiso
=============
did not find MKLROOT environment variable, using provided MKL

Pardiso.jl v0.5.2 seems to only be compatible with julia >= 1.6

After installing Pardiso.jl v0.5.2 on julia 1.5.3 on linux and running using Pardiso, I get the following error

julia> using Pardiso
[ Info: Precompiling Pardiso [46dd5b70-b6fb-5a00-ae2d-e8fea33afaf2]
ERROR: InitError: TypeError: in ccall: first argument not a pointer or valid constant expression, expected Ptr, got a value of type Tuple{Symbol,String}
Stacktrace:
 [1] get_nprocs_mkl at /home/patrick/julia-dev/Pardiso/src/mkl_pardiso.jl:41 [inlined]
 [2] __init__() at /home/patrick/julia-dev/Pardiso/src/Pardiso.jl:137
 [3] _include_from_serialized(::String, ::Array{Any,1}) at ./loading.jl:697
 [4] _require_from_serialized(::String) at ./loading.jl:749
 [5] _require(::Base.PkgId) at ./loading.jl:1040
 [6] require(::Base.PkgId) at ./loading.jl:928
 [7] require(::Module, ::Symbol) at ./loading.jl:923
during initialization of module Pardiso

tested on two x86-64 Ubuntu systems

As far as I can tell, this was caused by the change of the libmkl_rt variable from a String to a Ref{String}. Replacing all the instances of libmkl_rt[] with `"libmkl_rt" fixed the problem on the linux machine I tried it on. I realize that's not a real solution to the problem.

Does the libmkl_rt[] approach work in 1.6 because of JuliaLang/julia#37123? In any event, unless I'm misunderstanding what's going on here, I think that going forward, either Pardiso.jl should be marked as only compatible with julia 1.6 and up or the next version should be changed to make it backward compatible.

"ERROR: Input inconsistent." and test not passing when using Julia together with MKL.jl

Hello, I am using Julia v1.3 compiled with MKL with latest Pardiso.jl v.0.5.0 and I cant pass the tests nor perform the examples in the Readme.

julia> versioninfo()
Julia Version 1.3.0
Commit 46ce4d7933 (2019-11-26 06:09 UTC)
Platform Info:
  OS: Linux (x86_64-linux-gnu)
  CPU: Intel(R) Core(TM) i7-6700K CPU @ 4.00GHz
  WORD_SIZE: 64
  LIBM: libopenlibm
  LLVM: libLLVM-6.0.1 (ORCJIT, skylake)
Environment:
  JULIA_NUM_THREADS = 4
julia> LinearAlgebra.versioninfo()
BLAS: libmkl_rt
LAPACK: libmkl_rt

with this output for the small example:


julia> solve!(ps, X, A, B)
ERROR: Input inconsistent.
Stacktrace:
 [1] check_error at /home/monjaraz/.julia/packages/Pardiso/GDj1P/src/mkl_pardiso.jl:70 [inlined]
 [2] ccall_pardiso(::MKLPardisoSolver, ::Int32, ::Array{Float64,1}, ::Array{Int32,1}, ::Array{Int32,1}, ::Int32, ::Array{Float64,2}, ::Array{Float64,2}) at /home/monjaraz/.julia/packages/Pardiso/GDj1P/src/mkl_pardiso.jl:66
 [3] pardiso(::MKLPardisoSolver, ::Array{Float64,2}, ::SparseMatrixCSC{Float64,Int64}, ::Array{Float64,2}) at /home/monjaraz/.julia/packages/Pardiso/GDj1P/src/Pardiso.jl:335
 [4] solve!(::MKLPardisoSolver, ::Array{Float64,2}, ::SparseMatrixCSC{Float64,Int64}, ::Array{Float64,2}, ::Symbol) at /home/monjaraz/.julia/packages/Pardiso/GDj1P/src/Pardiso.jl:271
 [5] solve!(::MKLPardisoSolver, ::Array{Float64,2}, ::SparseMatrixCSC{Float64,Int64}, ::Array{Float64,2}) at /home/monjaraz/.julia/packages/Pardiso/GDj1P/src/Pardiso.jl:228
 [6] top-level scope at REPL[31]:1

and this one for the test of Package:


┌ Warning: Not testing project Pardiso solver
└ @ Main ~/.julia/packages/Pardiso/GDj1P/test/runtests.jl:15
Testing DataType[MKLPardisoSolver]
solving: Error During Test at /home/monjaraz/.julia/packages/Pardiso/GDj1P/test/runtests.jl:21
  Got exception outside of a @test
  Input inconsistent.
  Stacktrace:
   [1] check_error at /home/monjaraz/.julia/packages/Pardiso/GDj1P/src/mkl_pardiso.jl:70 [inlined]
   [2] ccall_pardiso(::MKLPardisoSolver, ::Int32, ::Array{Float64,1}, ::Array{Int32,1}, ::Array{Int32,1}, ::Int32, ::Array{Float64,2}, ::Array{Float64,2}) at /home/monjaraz/.julia/packages/Pardiso/GDj1P/src/mkl_pardiso.jl:66
   [3] pardiso(::MKLPardisoSolver, ::Array{Float64,2}, ::SparseMatrixCSC{Float64,Int64}, ::Array{Float64,2}) at /home/monjaraz/.julia/packages/Pardiso/GDj1P/src/Pardiso.jl:335
   [4] solve!(::MKLPardisoSolver, ::Array{Float64,2}, ::SparseMatrixCSC{Float64,Int64}, ::Array{Float64,2}, ::Symbol) at /home/monjaraz/.julia/packages/Pardiso/GDj1P/src/Pardiso.jl:271
   [5] solve!(::MKLPardisoSolver, ::Array{Float64,2}, ::SparseMatrixCSC{Float64,Int64}, ::Array{Float64,2}) at /home/monjaraz/.julia/packages/Pardiso/GDj1P/src/Pardiso.jl:228
   [6] top-level scope at /home/monjaraz/.julia/packages/Pardiso/GDj1P/test/runtests.jl:30
   [7] top-level scope at /home/monjaraz/Software/julia/juliaMKL/usr/share/julia/stdlib/v1.3/Test/src/Test.jl:1107
   [8] top-level scope at /home/monjaraz/.julia/packages/Pardiso/GDj1P/test/runtests.jl:22
   [9] include at ./boot.jl:328 [inlined]
   [10] include_relative(::Module, ::String) at ./loading.jl:1105
   [11] include(::Module, ::String) at ./Base.jl:31
   [12] include(::String) at ./client.jl:424
   [13] top-level scope at none:6
   [14] eval(::Module, ::Any) at ./boot.jl:330
   [15] exec_options(::Base.JLOptions) at ./client.jl:263
   [16] _start() at ./client.jl:460

In the same computer with the same MKL Julia 1.2 official binary seems to be fine. Is this due to the use of a compiled version with MKL? Thank you very much.

TagBot trigger issue

This issue is used to trigger TagBot; feel free to unsubscribe.

If you haven't already, you should update your TagBot.yml to include issue comment triggers.
Please see this post on Discourse for instructions and more details.

If you'd like for me to do this for you, comment TagBot fix on this issue.
I'll open a PR within a few hours, please be patient!

Cannot install on macOS 10.15.1

I get the following error when I try to install on my macOS 10.15.1 system. I have Pardiso library installed with path set per README instruction. But it looks like it needs CUDA but modern MBP only has AMD GPUs...

julia> Pkg.add("Pardiso")
 Resolving package versions...
ERROR: Unsatisfiable requirements detected for package CuArrays [3a865a2d]:
 CuArrays [3a865a2d] log:
 ├─possible versions are: [0.2.1, 0.3.0, 0.4.0, 0.5.0, 0.6.0-0.6.2, 0.7.0-0.7.3, 0.8.0-0.8.1, 0.9.0-0.9.1, 1.0.0-1.0.2, 1.1.0, 1.2.0-1.2.1, 1.3.0, 1.4.0-1.4.7, 1.5.0] or uninstalled
 ├─restricted to versions 1.5.0 by an explicit requirement, leaving only versions 1.5.0
 └─restricted by compatibility requirements with CUDAnative [be33ccc6] to versions: [1.0.2, 1.1.0, 1.2.0-1.2.1, 1.3.0, 1.4.0-1.4.7] or uninstalled — no versions left
   └─CUDAnative [be33ccc6] log:
     ├─possible versions are: [0.7.0, 0.8.0-0.8.10, 0.9.0-0.9.1, 0.10.0-0.10.1, 1.0.0-1.0.1, 2.0.0-2.0.1, 2.1.0-2.1.3, 2.2.0-2.2.1, 2.3.0-2.3.1, 2.4.0, 2.5.0-2.5.5, 2.6.0] or uninstalled
     └─restricted to versions 2.5.5 by an explicit requirement, leaving only versions 2.5.5
Stacktrace:
 [1] #propagate_constraints!#61(::Bool, ::typeof(Pkg.GraphType.propagate_constraints!), ::Pkg.GraphType.Graph, ::Set{Int64}) at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/Pkg/src/GraphType.jl:1007
 [2] propagate_constraints! at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/Pkg/src/GraphType.jl:948 [inlined]
 [3] #simplify_graph!#121(::Bool, ::typeof(Pkg.GraphType.simplify_graph!), ::Pkg.GraphType.Graph, ::Set{Int64}) at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/Pkg/src/GraphType.jl:1462
 [4] simplify_graph! at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/Pkg/src/GraphType.jl:1462 [inlined] (repeats 2 times)
 [5] resolve_versions!(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/Pkg/src/Operations.jl:321
 [6] #add#112(::Bool, ::Pkg.BinaryPlatforms.MacOS, ::typeof(Pkg.Operations.add), ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}, ::Array{Base.UUID,1}) at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/Pkg/src/Operations.jl:1010
 [7] #add at ./none:0 [inlined]
 [8] #add#25(::Bool, ::Pkg.BinaryPlatforms.MacOS, ::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(Pkg.API.add), ::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/Pkg/src/API.jl:102
 [9] add(::Pkg.Types.Context, ::Array{Pkg.Types.PackageSpec,1}) at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/Pkg/src/API.jl:72
 [10] #add#24 at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/Pkg/src/API.jl:69 [inlined]
 [11] add at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/Pkg/src/API.jl:69 [inlined]
 [12] #add#21 at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/Pkg/src/API.jl:67 [inlined]
 [13] add at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/Pkg/src/API.jl:67 [inlined]
 [14] #add#20(::Base.Iterators.Pairs{Union{},Union{},Tuple{},NamedTuple{(),Tuple{}}}, ::typeof(Pkg.API.add), ::String) at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/Pkg/src/API.jl:66
 [15] add(::String) at /Users/sabae/buildbot/worker/package_macos64/build/usr/share/julia/stdlib/v1.3/Pkg/src/API.jl:66
 [16] top-level scope at REPL[358]:1

julia> 

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.