Page 1 of 1

PDGESV - Programmatically accessing results? (ScaLAPACK)

PostPosted: Mon Jul 09, 2018 4:24 pm
by anne101
Hi, I am solving a system of equations using ScaLAPACK's routine PDGESV using a C wrapper:

Function declaration in the header file:
Code: Select all
    void  pdgesv_( int * n, int * nrhs, double * A, int * ia, int * ja, int * desca, int * ipiv,
                   double * b, int * ib, int * jb, int * descb, int * info );

Most examples use PDLAPRNT to access the results. Everything prints out fine when I have the following code:

Code: Select all
pdgesv_( &N, &uno, A, &uno, &uno, desca, ipiv, b, &uno, &uno, descb, &info );
Cpdlaprnt( &N, &uno, b, &uno, &uno, descb, &zero, &zero, "x", &sei, work );   

However, I am unable to figure out how to programmatically access the resulting vector saved to b. When I simply run through the elements of b as shown in the code below, I get half the result vector appearing correct, and the other half a mixture of zeros or NaNs.

Code: Select all
for(int i=1;i<=N;i++)   fprintf(fp_scalapack,"%d %f \n",i,b[i]);

Is there an established way of accessing the results, beyond PDLAPRNT?