Community
cancel
Showing results for 
Search instead for 
Did you mean: 
mamey4
Beginner
97 Views

VisualStudio08/Pardiso Beginner Question

Hi,

I'm a beginner to Visual Studio and Pardiso, and >I'm trying to get the coding example C-6 of the MKL Reference Manual working in a Visual Studio 2008 Fortran project. I copied the code, set the include directory to ...\\mkl\\include\\ and the lib directory to mkl\\em64t\\lib. Then I added mkl_core_dll.lib as an additional dependency to the project.
Now, when I try to build the project, the pardiso-call in the source code can't be executed, I'm getting a linker error LNK2019 about an "unresolved symbol _PARDISO". I'm using Intel Fortran 11.0 Compiler.
Do you know how I can make this work? Thanks in advance for your comments.

Martin
0 Kudos
9 Replies
Gennady_F_Intel
Moderator
97 Views

Martin,
you have to link withmkl_intel_lp64_dll.lib mkl_intel_thread_dll.lib mkl_core_dll.lib libiomp5md.lib.

but actually, I have anothersuggestionfor beginner user - I would recomend you to start with the PARDISO examples which are ready to use. You can find "C" and "Fortran" examples in the \examples\solvers directory ( version of MKL 10.3.2).
--Gennady
mecej4
Black Belt
97 Views

From the leading underscore in _PARDISO I suspect that you may be mixing 32 and 64 bit objects and/or libraries in your project. The symbol should be simply PARDISO in a 64-bit build.

Cleaning and rebuilding may get rid of the 32-bit objects.
TimP
Black Belt
97 Views

Quoting mecej4
From the leading underscore in _PARDISO I suspect that you may be mixing 32 and 64 bit objects and/or libraries in your project. The symbol should be simply PARDISO in a 64-bit build.

Cleaning and rebuilding may get rid of the 32-bit objects.

If the project has been designated as X64
mamey4
Beginner
97 Views

First of all thanks, I got the example program working by linking to the above mentioned files.
However, the solution of some sample equation systems doesn't quite work correct, I think I may have some of the iparm() values wrong. I entered a system with a banded matrix A and a RHS b, where b contains only of zeros. I would expect the solution to contain only zeros itself, however, the solution vector consists only of NaN's (but I don't receive errors).

Here's my set of parameters:

do i = 1, 64
pt(i) = 0
iparm(i) = 0
end do
do i = 1, NumNP !(=number of unknowns)
x(i) = 0
end do
iparm(1) = 1 ! no solver default
iparm(2) = 0 ! fill-in reordering NOT from METIS
iparm(3) = 1 ! numbers of processors
iparm(4) = 0 ! no iterative-direct algorithm
iparm(5) = 0 ! no user fill-in reducing permutation
iparm(6) = 0 ! =0 solution on the first n compoments of x
iparm(7) = 0 ! not in use
iparm(8) = 9 ! numbers of iterative refinement steps
iparm(9) = 0 ! not in use
iparm(10) = 13 ! perturbe the pivot elements with 1E-13
iparm(11) = 1 ! use nonsymmetric permutation and scaling MPS
iparm(12) = 0 ! not in use
iparm(13) = 0 ! maximum weighted matching algorithm is switched-off (default for symmetric). Try
iparm(14) = 0 ! Output: number of perturbed pivots
iparm(15) = 0 ! not in use
iparm(16) = 0 ! not in use
iparm(17) = 0 ! not in use
iparm(18) = -1 ! Output: number of nonzeros in the factor LU
iparm(19) = -1 ! Output: Mflops for LU factorization
iparm(20) = 0 ! Output: Numbers of CG Iterations
iparm(27)=1 !matrix struktur test
iparm(33)=1 !determinante berechnen
iparm(51) = 1
iparm(52) = 4 !!!size

maxfct=1
mnum=1
nrhs=1
error = 0 ! initialize error flag
msglvl = 1 ! print statistical information
mtype = -2 ! symmetric matrix
phase=13 ! complete

Is this a problem with PARDISO, or could it be with FORTRAN datatypes? x is of type REAL(DP).
Sergey_P_Intel2
Employee
97 Views

Hi, Martin!

First of all your example looks something strange because it uses some iparm() values that are not supported by Intel MKL now. For example iparm(33), iparm(51) and iparm(52) are used in PARDISO 4.1 from University Basel. But iparm(27) is used for matrix checking in Intel MKL. So could you clarify what kind of PARDISO you are trying to use?
Also you mentioned that RHS vector b is set to zero in your example but in your sources above vector x (solution vector?) is set to zero. Could you provide us with the way how PARDISO is called in your program?

Regards,

Sergey

mamey4
Beginner
97 Views

I used an example from the University Basel as a basis for my program, so the mentioned iparm() values could be fragments from that original file. I am trying to use the PARDISO included in the Intel MKL, that came with my Intel FORTRAN Compiler 11.
The part of the code that I sent you only contained the initialization of the iparm() values, the initialization of the soluition vector x, and that of the other input parameters needed for the PARDISO function call. The call looks like this:

CALL pardiso (pt, maxfct, mnum, mtype, phase, NumNP, myvalues, myia, myja, idum, nrhs, iparm, msglvl, B2, x, error)

myvalues, myja and myia contain the matrix in the sparse matrix format described in the MKL reference manual. B2 is the RHS of the system of equations, and I set the value of all B2 entries to zero, expecting to get a solution x where all the values contained are zero as well.
mamey4
Beginner
97 Views

I used an example from the University Basel as a basis for my program, so the mentioned iparm() values could be fragments from that original file. I am trying to use the PARDISO included in the Intel MKL, that came with my Intel FORTRAN Compiler 11.
The part of the code that I sent you only contained the initialization of the iparm() values, the initialization of the soluition vector x, and that of the other input parameters needed for the PARDISO function call. The call looks like this:

CALL pardiso (pt, maxfct, mnum, mtype, phase, NumNP, myvalues, myia, myja, idum, nrhs, iparm, msglvl, B2, x, error)

myvalues, myja and myia contain the matrix in the sparse matrix format described in the MKL reference manual. B2 is the RHS of the system of equations, and I set the value of all B2 entries to zero, expecting to get a solution x where all the values contained are zero as well.

Gennady_F_Intel
Moderator
97 Views

Martin,
I checked how it works with our examples (pardiso_unsym_c.c) with setting all b == 0.0;
This is the output:
================ PARDISO: solving a real nonsymmetric system ================
The local (internal) PARDISO version is : 103000115

..........................................
Solve completed ...
The solution of the system is:
x [0] = 0.000000
x [1] = 0.000000
x [2] = 0.000000
x [3] = 0.000000
x [4] = -0.000000
iparm[63] = 103000115
Press any key to continue . . .
As you can see this is the version 10.3.
Win32.
mamey4
Beginner
97 Views

I found the problem now - I used the wrong FORTRAN variable types for the input parameters of the pardiso call; when I stick to ones in the the example, it works.
Thanks anyway for taking the time to take a look at this :-)
Reply