Auto-suggest helps you quickly narrow down your search results by suggesting possible matches as you type.

Showing results for

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Mute
- Printer Friendly Page

dogval

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-07-2012
10:53 AM

52 Views

A*c=b problem

I am trying to use MKL and have some problems.

If sparse matrix has only one diagonal,everything isOK, but if not I can't find a solution.

This sample was tested on Matlab and passed succefully.

Solvers SG andPARDISO

Can you help me please with this problem.

Pavel.

Link Copied

7 Replies

Alexander_K_Intel2

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-07-2012
08:41 PM

52 Views

It's seem that your matrix is dense but all non-diagonal elements are equal to zero. So it's not clear how you translate it CSR format: as diagonal matrix or as dense with many zero elements. Could your provide example that you used to check correctness of PARDISO on this matrix?

With best regards,

Alexander Kalinkin

dogval

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-08-2012
11:30 AM

52 Views

vector

vector

vector

iaV.push_back(1);

for( int y = 0; y < fileA.Rows(); y++ )

{

int numValues = 0;

bool isData = false;

for( int x = 0; x < fileA.Cols(); x++ )

{

double value = fileA.Get( y, x );

if( value != 0 )

{

numValues++;

jaV.push_back( x + 1 );

aV.push_back( value );

}

}

if( numValues != 0 )

{

iaV.push_back( iaV[ iaV.size() - 1 ] + numValues );

}

}

vector

for( int y = 0; y < fileB.Rows(); y++ )

{

double value = fileB.Get( y, 0 );

rhsV.push_back( value );

}

Solve( fileA.GetNumLines(), iaV, jaV, aV, rhsV );

bool Solve( int matrixSize, vector

{

int n = matrixSize, rci_request, itercount;

double* rhs = &rhsV[0];

int* ia = &iaV[0];

int* ja = &jaV[0];

double* a = &aV[0];

double* solution = new double[matrixSize];

int ipar[128];

double dpar[128];

double* tmp = new double[4 * matrixSize];

char tr = 'u';

for( int i = 0; i < n; i++ )

solution* = 1;*

dcg_init( &n, solution, rhs, &rci_request, ipar, dpar, tmp );

if( rci_request != 0 )

return false;

ipar[8] = 1;

ipar[9] = 0;

dpar[0] = 1.E-5;

dcg_check( &n, solution, rhs, &rci_request, ipar, dpar, tmp );

if (rci_request != 0)

return false;

while(true)

{

dcg( &n, solution, rhs, &rci_request, ipar, dpar, tmp );

if (rci_request == 0)

break;

if(rci_request == 1)

{

mkl_dcsrsymv( &tr, &n, a, ia, ja, tmp, &tmp

continue;

}

return false;

}

dcg_get( &n, solution, rhs, &rci_request, ipar, dpar, tmp, &itercount );

MKL_FreeBuffers();

return true;

}

Alexander_K_Intel2

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-09-2012
03:28 AM

52 Views

In topic below you wrote about problem with PARDISO but as I can see this example use CG routines from MKL. So problem appeared when you use CG or PARDISO?

With best regards,

Alexander Kalinkin

dogval

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-09-2012
10:34 AM

52 Views

I tried to solve this matrix with CG and PARDISO, but most of the work was done on CG. I used PARDISO only to check if it passes or not. If you can help me with CG, I would be very glad, but if you think I should work with PARDISO, i will write here a PARDISO sample - it is twice as big.

Thank you for the swift reply!

Alexander_K_Intel2

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-11-2012
11:59 PM

52 Views

I've try to reproduce your problem. You forgot to describe some classes, for example, could you describe fileA & fileB ?

With best regards,

Alexander Kalinkin

./source/test.c(20): error: identifier "fileA" is undefined for( int y = 0; y < fileA.Rows(); y++ )

^

./source/test.c(44): error: identifier "fileB" is undefined for( int y = 0; y < fileB.Rows(); y++ )

^

./source/test.c(50): error: identifier "fileA" is undefined Solve( fileA.GetNumLines(), iaV, jaV, aV, rhsV );

dogval

Beginner

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

01-19-2012
09:17 AM

52 Views

One double [][] fileA = {...}

and second double [] fileB = {...}

Pls help !!!!

Ying_H_Intel

Employee

- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Email to a Friend
- Report Inappropriate Content

02-02-2012
11:16 PM

52 Views

As withoutyour definition of the fileA, file B class, I haven'ttried to the exact code.

But according to your discription :

"If sparse matrix has only one diagonal,everything isOK, but if not I can't find a solution "

andread the input sparse matrix,

I thought, your problem should be in the CSR format of the matA, which issymmetric positive definite system and read by as full CSR format in your code, right?

But the function mkl_dcsrsymv() actually ask the upper or lower trianglein CSR format.

Please see MKL manuals.

The mkl_?csrsymv routine performs a matrix-vector operation defined as `y` := `A`*`x`

where:

`x` and `y` are vectors,

`A` is an upper or lower triangle of the symmetrical sparse matrix in the CSR format (3-array variation).

for example, upper triangle format,

for( int y = 0; y < fileA.Rows(); y++ )

{

int numValues = 0;

bool isData = false;

for( int x =

BestRegards,

Ying

For more complete information about compiler optimizations, see our Optimization Notice.