SuperLU Distributed 8.2.1
Distributed memory sparse direct solver
pzutil.c File Reference

Several matrix utilities. More...

#include <math.h>
#include "superlu_zdefs.h"
Include dependency graph for pzutil.c:

Functions

int pzCompRow_loc_to_CompCol_global (int_t need_value, SuperMatrix *A, gridinfo_t *grid, SuperMatrix *GA)
 Gather A from the distributed compressed row format to global A in compressed column format. More...
 
int pzPermute_Dense_Matrix (int_t fst_row, int_t m_loc, int_t row_to_proc[], int_t perm[], doublecomplex X[], int ldx, doublecomplex B[], int ldb, int nrhs, gridinfo_t *grid)
 Permute the distributed dense matrix: B <= perm(X). perm[i] = j means the i-th row of X is in the j-th row of B. More...
 
void zLUstructInit (const int_t n, zLUstruct_t *LUstruct)
 Allocate storage in LUstruct. More...
 
void zLUstructFree (zLUstruct_t *LUstruct)
 Deallocate LUstruct. More...
 
void zDestroy_Tree (int_t n, gridinfo_t *grid, zLUstruct_t *LUstruct)
 
void zDestroy_LU (int_t n, gridinfo_t *grid, zLUstruct_t *LUstruct)
 Destroy distributed L & U matrices. More...
 
int_t pzgstrs_init (int_t n, int_t m_loc, int_t nrhs, int_t fst_row, int_t perm_r[], int_t perm_c[], gridinfo_t *grid, Glu_persist_t *Glu_persist, zSOLVEstruct_t *SOLVEstruct)
 Destroy distributed L & U matrices. *‍/ void zDestroy_LU(int_t n, gridinfo_t *grid, zLUstruct_t *LUstruct) { int_t i, nb, nsupers; Glu_persist_t *Glu_persist = LUstruct->Glu_persist; zLocalLU_t *Llu = LUstruct->Llu;. More...
 
int zSolveInit (superlu_dist_options_t *options, SuperMatrix *A, int_t perm_r[], int_t perm_c[], int_t nrhs, zLUstruct_t *LUstruct, gridinfo_t *grid, zSOLVEstruct_t *SOLVEstruct)
 Initialize the data structure for the solution phase. More...
 
void zSolveFinalize (superlu_dist_options_t *options, zSOLVEstruct_t *SOLVEstruct)
 Release the resources used for the solution phase. More...
 
void zDestroy_A3d_gathered_on_2d (zSOLVEstruct_t *SOLVEstruct, gridinfo3d_t *grid3d)
 
void pzinf_norm_error (int iam, int_t n, int_t nrhs, doublecomplex x[], int_t ldx, doublecomplex xtrue[], int_t ldxtrue, MPI_Comm slucomm)
 Check the inf-norm of the error vector. More...
 

Detailed Description

Several matrix utilities.

Copyright (c) 2003, The Regents of the University of California, through Lawrence Berkeley National Laboratory (subject to receipt of any required approvals from U.S. Dept. of Energy)

All rights reserved.

The source code is distributed under BSD license, see the file License.txt at the top-level directory.

-- Distributed SuperLU routine (version 2.0) --
Lawrence Berkeley National Lab, Univ. of California Berkeley.
March 15, 2003

Function Documentation

◆ pzCompRow_loc_to_CompCol_global()

int pzCompRow_loc_to_CompCol_global ( int_t  need_value,
SuperMatrix A,
gridinfo_t grid,
SuperMatrix GA 
)

Gather A from the distributed compressed row format to global A in compressed column format.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pzgstrs_init()

int_t pzgstrs_init ( int_t  n,
int_t  m_loc,
int_t  nrhs,
int_t  fst_row,
int_t  perm_r[],
int_t  perm_c[],
gridinfo_t grid,
Glu_persist_t Glu_persist,
zSOLVEstruct_t SOLVEstruct 
)

Destroy distributed L & U matrices. *‍/ void zDestroy_LU(int_t n, gridinfo_t *grid, zLUstruct_t *LUstruct) { int_t i, nb, nsupers; Glu_persist_t *Glu_persist = LUstruct->Glu_persist; zLocalLU_t *Llu = LUstruct->Llu;.

if ( DEBUGlevel>=1 ) int iam; MPI_Comm_rank( MPI_COMM_WORLD, &iam ); CHECK_MALLOC(iam, "Enter zDestroy_LU()"); #endif

zDestroy_Tree(n, grid, LUstruct);

nsupers = Glu_persist->supno[n-1] + 1;

nb = CEILING(nsupers, grid->npcol); // for (i = 0; i < nb; ++i) // if ( Llu->Lrowind_bc_ptr[i] ) { // SUPERLU_FREE (Llu->Lrowind_bc_ptr[i]); // SUPERLU_FREE (Llu->Lnzval_bc_ptr[i]); // } SUPERLU_FREE (Llu->Lrowind_bc_ptr); SUPERLU_FREE (Llu->Lrowind_bc_dat); SUPERLU_FREE (Llu->Lrowind_bc_offset);
SUPERLU_FREE (Llu->Lnzval_bc_ptr); SUPERLU_FREE (Llu->Lnzval_bc_dat); SUPERLU_FREE (Llu->Lnzval_bc_offset);

nb = CEILING(nsupers, grid->nprow); for (i = 0; i < nb; ++i) if ( Llu->Ufstnz_br_ptr[i] ) { SUPERLU_FREE (Llu->Ufstnz_br_ptr[i]); SUPERLU_FREE (Llu->Unzval_br_ptr[i]); } SUPERLU_FREE (Llu->Ufstnz_br_ptr); SUPERLU_FREE (Llu->Unzval_br_ptr);

/* The following can be freed after factorization. *‍/ SUPERLU_FREE(Llu->ToRecv); SUPERLU_FREE(Llu->ToSendD); SUPERLU_FREE(Llu->ToSendR[0]); SUPERLU_FREE(Llu->ToSendR);

/* The following can be freed only after iterative refinement. *‍/ SUPERLU_FREE(Llu->ilsum); SUPERLU_FREE(Llu->fmod); SUPERLU_FREE(Llu->fsendx_plist[0]); SUPERLU_FREE(Llu->fsendx_plist); SUPERLU_FREE(Llu->bmod); SUPERLU_FREE(Llu->bsendx_plist[0]); SUPERLU_FREE(Llu->bsendx_plist); SUPERLU_FREE(Llu->mod_bit);

// nb = CEILING(nsupers, grid->npcol); // for (i = 0; i < nb; ++i) // if ( Llu->Lindval_loc_bc_ptr[i]!=NULL) { // SUPERLU_FREE (Llu->Lindval_loc_bc_ptr[i]); // }
SUPERLU_FREE(Llu->Lindval_loc_bc_ptr); SUPERLU_FREE(Llu->Lindval_loc_bc_dat); SUPERLU_FREE(Llu->Lindval_loc_bc_offset);

nb = CEILING(nsupers, grid->npcol); for (i=0; i<nb; ++i) { // if(Llu->Linv_bc_ptr[i]!=NULL) { // SUPERLU_FREE(Llu->Linv_bc_ptr[i]); // }

if(Llu->Uinv_bc_ptr[i]!=NULL){ SUPERLU_FREE(Llu->Uinv_bc_ptr[i]); }
} SUPERLU_FREE(Llu->Linv_bc_ptr); SUPERLU_FREE(Llu->Linv_bc_dat); SUPERLU_FREE(Llu->Linv_bc_offset); SUPERLU_FREE(Llu->Uinv_bc_ptr); SUPERLU_FREE(Llu->Unnz);

nb = CEILING(nsupers, grid->npcol); for (i = 0; i < nb; ++i) if ( Llu->Urbs[i] ) { SUPERLU_FREE(Llu->Ucb_indptr[i]); SUPERLU_FREE(Llu->Ucb_valptr[i]); } SUPERLU_FREE(Llu->Ucb_indptr); SUPERLU_FREE(Llu->Ucb_valptr);
SUPERLU_FREE(Llu->Urbs);

SUPERLU_FREE(Glu_persist->xsup); SUPERLU_FREE(Glu_persist->supno);

#ifdef GPU_ACC checkGPU (gpuFree (Llu->d_xsup)); checkGPU (gpuFree (Llu->d_LRtree_ptr)); checkGPU (gpuFree (Llu->d_LBtree_ptr)); checkGPU (gpuFree (Llu->d_ilsum)); checkGPU (gpuFree (Llu->d_Lrowind_bc_dat)); checkGPU (gpuFree (Llu->d_Lrowind_bc_offset)); checkGPU (gpuFree (Llu->d_Lnzval_bc_dat)); checkGPU (gpuFree (Llu->d_Lnzval_bc_offset)); checkGPU (gpuFree (Llu->d_Linv_bc_dat)); checkGPU (gpuFree (Llu->d_Linv_bc_offset)); checkGPU (gpuFree (Llu->d_Lindval_loc_bc_dat)); checkGPU (gpuFree (Llu->d_Lindval_loc_bc_offset)); #endif

if ( DEBUGlevel>=1 ) CHECK_MALLOC(iam, "Exit zDestroy_LU()"); #endif }

/*!

   Purpose
   =======
     Set up the communication pattern for redistribution between B and X
     in the triangular solution.

   Arguments
   =========

   n      (input) int (global)
          The dimension of the linear system.

   m_loc  (input) int (local)
          The local row dimension of the distributed input matrix.

   nrhs   (input) int (global)
          Number of right-hand sides.

   fst_row (input) int (global)
          The row number of matrix B's first row in the global matrix.

   perm_r (input) int* (global)
          The row permutation vector.

   perm_c (input) int* (global)
          The column permutation vector.

   grid   (input) gridinfo_t*
          The 2D process mesh.
   
Here is the caller graph for this function:

◆ pzinf_norm_error()

void pzinf_norm_error ( int  iam,
int_t  n,
int_t  nrhs,
doublecomplex  x[],
int_t  ldx,
doublecomplex  xtrue[],
int_t  ldxtrue,
MPI_Comm  slucomm 
)

Check the inf-norm of the error vector.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ pzPermute_Dense_Matrix()

int pzPermute_Dense_Matrix ( int_t  fst_row,
int_t  m_loc,
int_t  row_to_proc[],
int_t  perm[],
doublecomplex  X[],
int  ldx,
doublecomplex  B[],
int  ldb,
int  nrhs,
gridinfo_t grid 
)

Permute the distributed dense matrix: B <= perm(X). perm[i] = j means the i-th row of X is in the j-th row of B.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ zDestroy_A3d_gathered_on_2d()

void zDestroy_A3d_gathered_on_2d ( zSOLVEstruct_t SOLVEstruct,
gridinfo3d_t grid3d 
)
Here is the caller graph for this function:

◆ zDestroy_LU()

void zDestroy_LU ( int_t  n,
gridinfo_t grid,
zLUstruct_t LUstruct 
)

Destroy distributed L & U matrices.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ zDestroy_Tree()

void zDestroy_Tree ( int_t  n,
gridinfo_t grid,
zLUstruct_t LUstruct 
)
Here is the call graph for this function:
Here is the caller graph for this function:

◆ zLUstructFree()

void zLUstructFree ( zLUstruct_t LUstruct)

Deallocate LUstruct.

Here is the caller graph for this function:

◆ zLUstructInit()

void zLUstructInit ( const int_t  n,
zLUstruct_t LUstruct 
)

Allocate storage in LUstruct.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ zSolveFinalize()

void zSolveFinalize ( superlu_dist_options_t options,
zSOLVEstruct_t SOLVEstruct 
)

Release the resources used for the solution phase.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ zSolveInit()

int zSolveInit ( superlu_dist_options_t options,
SuperMatrix A,
int_t  perm_r[],
int_t  perm_c[],
int_t  nrhs,
zLUstruct_t LUstruct,
gridinfo_t grid,
zSOLVEstruct_t SOLVEstruct 
)

Initialize the data structure for the solution phase.

Here is the call graph for this function:
Here is the caller graph for this function: