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

Showing results for

- Intel Community
- Software
- Software Development SDKs and Libraries
- Intel® oneAPI Math Kernel Library
- Guidance on integrating cluster_sparse_solver into my application

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

Ferris_H_

Beginner

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

08-22-2016
11:13 AM

58 Views

Guidance on integrating cluster_sparse_solver into my application

I am trying to integrate cluster_sparse_solver into my application, however, I am confused by this in the documentation:

Most of the input parameters (except for the `pt`, `phase`, and `comm` parameters and, for the distributed format, the `a`, `ia`, and `ja` arrays) must be set on the master MPI process only, and ignored on other processes. Other MPI processes get all required data from the master MPI process using the MPI communicator, `comm`.

I interpret this as saying if rank=0, then all input parameters need to be defined. But if rank > 1, then you can input NULL values? I tried doing that as shown in this pseudo code below. But I keep getting "ERROR during symbolic factorization: -1" when I run with np > 1. With np 1 it runs correctly, but only on one host.

int main() { mpi_stat = MPI_Init( &argc, &argv ); mpi_stat = MPI_Comm_rank( MPI_COMM_WORLD, &rank ); comm = MPI_Comm_c2f( MPI_COMM_WORLD ); if ( rank < 1 ) { read_input_file(); assemble_i_ia_ja(); call_cluster_sparse_solver(); } else { int i; long long pt[64]; for(i=0;i<64;i++){pt=0;} double *aupardiso=NULL; ITG *icolpardiso=NULL,*pointers=NULL,iparm[64]; ITG maxfct=1,mnum=1,phase=12,nrhs=1,*perm=NULL,mtype, msglvl=0,error=0,*irowpardiso=NULL, neq; double *b=NULL,*x=NULL; FORTRAN ( cluster_sparse_solver, ( pt, &maxfct, &mnum, &mtype, &phase, neq, aupardiso , pointers , icolpardiso, perm, &nrhs, iparm, &msglvl, b, x, &comm, &error )); }

The function call_cluster_sparse_solver contains this code:

int mpi_stat = 0; int comm, rank; mpi_stat = MPI_Comm_rank( MPI_COMM_WORLD, &rank ); comm = MPI_Comm_c2f( MPI_COMM_WORLD ); FORTRAN ( cluster_sparse_solver, ( pt, &maxfct, &mnum, &mtype, &phase, neq, aupardiso , pointers , icolpardiso, perm, &nrhs, iparm, &msglvl, b, x, &comm, &error ));

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

08-22-2016
09:49 PM

58 Views

Hi,

You are correct, if you don't use distributed format then pointer can be set as null. Can you provide iparm data that you use on master process?

Thanks,

Alex

Ferris_H_

Beginner

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

08-23-2016
10:17 AM

58 Views

On master process ( rank = 0 ), iparm is set only as follows:

ITG iparm[64];

iparm[0]=0;

then cluster_parse_solver is called as follows:

FORTRAN ( cluster_sparse_solver, ( pt, &maxfct, &mnum, &mtype, &phase,

neq, aupardiso , pointers , icolpardiso, perm, &nrhs, iparm, &msglvl, b, x, &comm, &error ));

Is this correct, or should iparm be different ? I can try and create a simple example code that reproduces this issue .

Alexander_K_Intel2

Employee

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

08-23-2016
06:25 PM

58 Views

Hi,

yes, can you provide the example?

Thanks,

Alex

Ferris_H_

Beginner

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

08-24-2016
09:30 AM

58 Views

Ferris_H_

Beginner

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

09-06-2016
01:07 PM

58 Views

Ferris_H_

Beginner

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

09-23-2016
10:07 PM

58 Views

Unfortunately, I am still facing difficulty in how to call cluster_sparse_solver when rank > 0 . Can someone share some simple example so I can compare with my code? The documentation states:

Most of the input parameters (except for the `pt`, `phase`, and `comm` parameters and, for the distributed format, the `a`, `ia`, and `ja` arrays) must be set on the master MPI process only, and ignored on other processes.

How exactly do all the input parameters need to be initialized for the non-master process? Here is what I tried which seems to keep giving segmentation fault:

if ( rank > 0 ) { comm = MPI_Comm_c2f( MPI_COMM_WORLD ); /* Matrix data. */ MKL_INT n=NULL; MKL_INT *ia=NULL; MKL_INT *ja=NULL; float *a=NULL; MKL_INT mtype=NULL; MKL_INT nrhs=NULL; float *b=NULL, *x=NULL, *bs=NULL, res=0.0, res0=0.0; /* RHS and solution vectors. */ void *pt[64] = { 0 }; /* Cluster Sparse Solver control parameters. */ MKL_INT *iparm = NULL; MKL_INT maxfct=NULL, mnum=NULL, phase=NULL, msglvl=NULL, error=NULL; /* Auxiliary variables. */ float ddum=0.0; /* float dummy */ MKL_INT idum=NULL; /* Integer dummy. */ phase = 11; printf ("got here 11"); cluster_sparse_solver ( pt, &maxfct, &mnum, &mtype, &phase, &n, &a, ia, ja, &idum, &nrhs, iparm, &msglvl, &ddum, &ddum, &comm, &error ); phase = 22; printf ("got here 22"); cluster_sparse_solver ( pt, &maxfct, &mnum, &mtype, &phase, &n, a, ia, ja, &idum, &nrhs, iparm, &msglvl, &ddum, &ddum, &comm, &error ); phase = 33; cluster_sparse_solver ( pt, &maxfct, &mnum, &mtype, &phase, &n, a, ia, ja, &idum, &nrhs, iparm, &msglvl, &ddum, &ddum, &comm, &error ); phase = -1; cluster_sparse_solver ( pt, &maxfct, &mnum, &mtype, &phase, &n, a, ia, ja, &idum, &nrhs, iparm, &msglvl, &ddum, &ddum, &comm, &error ); }

Ferris_H_

Beginner

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

09-24-2016
12:26 PM

58 Views

I finally figured it out after isolating and testing each input individually. These have to be set to 1, not NULL:

`MKL_INT maxfct=NULL, mnum=NULL`

`I would suggest updating the documentation as this is not accurate:`

Most of the input parameters (except for the pt, phase, and comm parameters and, for the distributed format, the a, ia, and ja arrays) must be set on the master MPI process only, and ignored on other processes. Other MPI processes get all required data from the master MPI process using the MPI communicator, comm.

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

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