HP MLIB User's Guide Vol. 2 7th Ed.

756 HP MLIB LAPACK User’s Guide
Sample programs
* 3. Generally, the distributing of rows in this example assumed that
* the number of processes, <proc rows>*<proc columns>, used to solve
* dimension n problems is roughly not larger than sqrt(n) (i.e. (<proc
* rows>*<proc columns>)**2<n.)
*/
{
superlu_options_t options;
SuperLUStat_t stat;
SuperMatrix A;
ScalePermstruct_t ScalePermstruct;
LUstruct_t LUstruct;
SOLVEstruct_t SOLVEstruct;
gridinfo_t grid;
double *berr;
double *b;
int_t m, n, nnz;
int_t nprow, npcol;
int_t iam, info, ldb, ldx, nrhs;
char **cpp, c;
SuperMatrix GA; /* global A */
NRformat_loc *Astore;
double *b_global; /* global b */
double *nzval; /* global */
int_t *rowind, *colptr; /* global */
double *nzval_loc; /* local */
int_t *colind, *rowptr; /* local */
int_t m_loc, fst_row, nnz_loc;
int_t m_loc_fst; /* Record m_loc of the first p-1 processors,
when mod(m, p) is not zero. */
int_t row, col, i, j, relpos;
int_t *marker;
NCformat *GAstore;
int_t *it;
double *dt;
int_t *sol_recvcounts, *sol_displs;
nprow = 1; /* Set default process rows. */
npcol = 1; /* Set default process columns. */
nrhs = 1; /* Number of right-hand side. */
/* Parse command line argv[]. */
for (cpp = argv+1; *cpp; ++cpp) {
if ( **cpp == '-' ) {
c = *(*cpp+1);
++cpp;
switch (c) {
case 'r': nprow = atoi(*cpp);
break;
case 'c': npcol = atoi(*cpp);
break
}
}
}