Quantcast
Channel: Intel® oneAPI Math Kernel Library & Intel® Math Kernel Library
Viewing all articles
Browse latest Browse all 2652

Guidance on integrating cluster_sparse_solver into my application

$
0
0

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

Note

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[i]=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 ));

 


Viewing all articles
Browse latest Browse all 2652

Trending Articles