HP MLIB User's Guide Vol. 2 7th Ed.
Chapter 11 Introduction to Distributed SuperLU 753
Sample programs
exit (-1);
}
if ( !(ScalePermstruct.perm_c = (int_t *) malloc(n *
sizeof(int_t)) ) ) {
printf(“malloc fails for perm_c[].”);
exit (-1);
}
/* Initialize LUstruct. */
if ( !(LUstruct.etree =(int_t *) malloc(n * sizeof(int_t))) ) {
printf(“malloc fails for etree[].”);
exit (-1);
}
if ( !(LUstruct.Glu_persist = (Glu_persist_t *)
malloc(sizeof(Glu_persist_t))) ) {
printf(“malloc fails for Glu_persist_t.”);
exit (-1);
}
if ( !(LUstruct.Llu = (LocalLU_t *)
malloc(sizeof(LocalLU_t))) ) {
printf(“malloc fails for LocalLU_t.”);
exit (-1);
}
/* Initialize the statistics variables. */
if ( !(stat.utime = (double *) malloc(NPHASES*sizeof(double))) ) {
printf(“malloc fails for stat->utime[]”);
exit (-1);
}
if ( !(stat.ops = (flops_t *) malloc(NPHASES * sizeof(flops_t))) )
{
printf(“malloc fails for stat->ops[]”);
exit (-1);
}
for (i = 0; i < NPHASES; ++i) {
stat.utime[i] = 0.;
stat.ops[i] = 0.;
}
stat.TinyPivots = stat.RefineSteps = 0;
/* ------------------------------------------------------------
Call pdgssvx_ABglobal to solve the linear system.
------------------------------------------------------------*/
pdgssvx_ABglobal(&options, &A, &ScalePermstruct, b, ldb, nrhs,
&grid,
&LUstruct, berr, &stat, &info);
/* Print the solution. */
if (!iam) {