QR_MUMPS
Data Types | Functions/Subroutines
_qrm_spmat_mod Module Reference

This module contains the definition of the basic sparse matrix type and of the associated methods. More...

Data Types

type  _qrm_spmat_type
 This type defines the data structure used to store a matrix. More...
 
interface  qrm_cntl_init
 Generif interface for the ::_qrm_cntl_init routine. More...
 
interface  qrm_get
 Generif interface for the ::_qrm_pgeti, ::_qrm_pgetr and. More...
 
interface  qrm_get_r
 Generif interface for the ::_qrm_spmat_alloc routine. More...
 
interface  qrm_set
 Generif interface for the ::_qrm_pseti, ::_qrm_psetr and. More...
 
interface  qrm_spmat_alloc
 Generif interface for the ::_qrm_spmat_alloc routine. More...
 
interface  qrm_spmat_convert
 Generif interface for the ::_qrm_spmat_convert routine. More...
 
interface  qrm_spmat_copy
 Generif interface for the ::_qrm_spmat_copy routine. More...
 
interface  qrm_spmat_destroy
 Generif interface for the ::_qrm_spmat_destroy routine. More...
 
interface  qrm_spmat_init
 Generif interface for the ::_qrm_spmat_init routine. More...
 

Functions/Subroutines

subroutine _qrm_spmat_alloc (qrm_spmat, nz, m, n, fmt)
 This subroutine allocates memory for a sparse matrix. More...
 
subroutine _qrm_spmat_init (qrm_spmat)
 This subroutine initializes a qrm_spmat_type instance setting default values into the control parameters. More...
 
subroutine _qrm_cntl_init (qrm_spmat)
 This subroutine initializes a qrm_spmat_type instance setting default values into the control parameters. More...
 
subroutine _qrm_spmat_convert (in_mat, out_mat, fmt, values)
 This subroutine converts an input matrix into a different storage format. Optionally the values may be ignored (this comes handy during the analysis) More...
 
subroutine _qrm_coo_to_csc (in_mat, out_mat, values)
 This subroutine converts a COO matrix into a CSC matrix. Optionally the values may be ignored (this comes handy during the analysis) More...
 
subroutine _qrm_csc_to_csr (in_mat, out_mat, values)
 This subroutine converts a CSC matrix into a CSR matrix. Optionally the values may be ignored (this comes handy during the analysis) More...
 
subroutine _qrm_spmat_copy (in_mat, out_mat, values)
 This subroutine makes a copy of a matrix. Optionally the values may be ignored (this comes handy during the analysis) More...
 
subroutine _qrm_spmat_destroy (qrm_spmat, all)
 This subroutine destroyes a qrm_spmat instance. More...
 
subroutine _qrm_pseti (qrm_spmat, string, ival)
 This subroutine is meant to set the integer control parameters. More...
 
subroutine _qrm_psetr (qrm_spmat, string, rval)
 This subroutine is meant to set the real control parameters. More...
 
subroutine _qrm_pgeti (qrm_spmat, string, ival)
 Gets the values of an integer control parameter. This is the dual of the ::_qrm_pseti routine; the parameters and accepted values are the same. More...
 
subroutine _qrm_pgetii (qrm_spmat, string, ival)
 Gets the values of an integer control parameter. This is the dual of the ::_qrm_pseti routine; the parameters and accepted values are the same. More...
 
subroutine _qrm_pgetr (qrm_spmat, string, rval)
 Gets the values of a real control parameter. This is the dual of the ::_qrm_psetr routine; the parameters and accepted values are the same. More...
 
subroutine _qrm_check_spmat (qrm_spmat, op)
 Check the compatibility and correctness of icntl and rcntl parameters. More...
 
subroutine _qrm_get_r (qrm_mat, r)
 

Detailed Description

This module contains the definition of the basic sparse matrix type and of the associated methods.

Function/Subroutine Documentation

subroutine _qrm_spmat_mod::_qrm_check_spmat ( type(_qrm_spmat_type qrm_spmat,
integer, optional  op 
)
subroutine _qrm_spmat_mod::_qrm_cntl_init ( type(_qrm_spmat_type), intent(inout)  qrm_spmat)

This subroutine initializes a qrm_spmat_type instance setting default values into the control parameters.

Parameters
[in,out]qrm_spmatThe matrix to be initialized

Definition at line 303 of file qrm_spmat_mod.F90.

References qrm_ib_, qrm_keeph_, qrm_minamalg_, qrm_nb_, qrm_no_, qrm_ordering_, qrm_rhsnb_, qrm_rhsnthreads_, qrm_sing_, and qrm_yes_.

Referenced by _qrm_spmat_init().

subroutine _qrm_spmat_mod::_qrm_coo_to_csc ( type(_qrm_spmat_type), intent(in)  in_mat,
type(_qrm_spmat_type out_mat,
logical, optional  values 
)

This subroutine converts a COO matrix into a CSC matrix. Optionally the values may be ignored (this comes handy during the analysis)

Parameters
[in]in_matthe input matrix
[in,out]out_matthe output matrix in fmt format
[in]values(optional) if values=.true. the output matrix will include numerical values, otherwise only the structure

Definition at line 418 of file qrm_spmat_mod.F90.

References qrm_error_mod::qrm_abort_, qrm_error_mod::qrm_err_act_restore(), qrm_error_mod::qrm_err_act_save(), and qrm_error_mod::qrm_err_check().

Referenced by _qrm_spmat_convert().

subroutine _qrm_spmat_mod::_qrm_csc_to_csr ( type(_qrm_spmat_type), intent(in)  in_mat,
type(_qrm_spmat_type out_mat,
logical, optional  values 
)

This subroutine converts a CSC matrix into a CSR matrix. Optionally the values may be ignored (this comes handy during the analysis)

Parameters
[in]in_matthe input matrix
[in,out]out_matthe output matrix in fmt format
[in]values(optional) if values=.true. the output matrix will include numerical values, otherwise only the structure

Definition at line 533 of file qrm_spmat_mod.F90.

References qrm_error_mod::qrm_abort_, qrm_error_mod::qrm_err_act_restore(), qrm_error_mod::qrm_err_act_save(), and qrm_error_mod::qrm_err_check().

Referenced by _qrm_spmat_convert().

subroutine _qrm_spmat_mod::_qrm_get_r ( type(_qrm_spmat_type), target  qrm_mat,
type(_qrm_spmat_type r 
)

Definition at line 1290 of file qrm_spmat_mod.F90.

References qrm_nnz_r_.

subroutine _qrm_spmat_mod::_qrm_pgeti ( type(_qrm_spmat_type qrm_spmat,
character(len=*)  string,
integer  ival 
)

Gets the values of an integer control parameter. This is the dual of the ::_qrm_pseti routine; the parameters and accepted values are the same.

Definition at line 1008 of file qrm_spmat_mod.F90.

References _qrm_pgetii(), qrm_error_mod::qrm_abort_, qrm_error_mod::qrm_err_act_restore(), qrm_error_mod::qrm_err_act_save(), and qrm_error_mod::qrm_err_check().

Referenced by _qrm_c_interface::_qrm_pgeti_c().

subroutine _qrm_spmat_mod::_qrm_pgetii ( type(_qrm_spmat_type qrm_spmat,
character(len=* )  string,
integer(kind=8)  ival 
)
subroutine _qrm_spmat_mod::_qrm_pgetr ( type(_qrm_spmat_type qrm_spmat,
character(len=*)  string,
real(kind(1.d0))  rval 
)

Gets the values of a real control parameter. This is the dual of the ::_qrm_psetr routine; the parameters and accepted values are the same.

Definition at line 1120 of file qrm_spmat_mod.F90.

References qrm_error_mod::qrm_abort_, qrm_error_mod::qrm_err_act_restore(), qrm_error_mod::qrm_err_act_save(), qrm_error_mod::qrm_err_check(), and qrm_error_mod::qrm_err_push().

subroutine _qrm_spmat_mod::_qrm_pseti ( type(_qrm_spmat_type qrm_spmat,
character(len=*)  string,
integer  ival 
)

This subroutine is meant to set the integer control parameters.

Parameters
[in,out]qrm_spmatThe qrm_spmat instance concerned by the setting
[in]stringa string describing the parameter to be set. Accepted values are:
  • "qrm_ordering" : to set a method for the fill-reducing column permutation. Accepted values are:
    • qrm_auto_=0 for automatic choice
    • qrm_natural_=1 for natural ordering
    • qrm_given_=2 for given ordering (through the qrm_spmatcperm_in pointer)
    • qrm_colamd_=3 for COLAMD
    • qrm_metis_=4 for METIS
    • qrm_scotch_=5 for SCOTCH
  • "qrm_minamalg" : fronts whose size is smaller than this will be systematically amalgamated to their father
  • "qrm_nb" : the block-size that defines the granularity of parallel tasks
  • "qrm_ib" : the block-size for computations
  • "qrm_rhsnb" : the block-size for grouping RHSs
  • "qrm_nthreads" : the number of threads to be used in the factorization (this can also be controlled through the QRM_NUM_THREADS environment variable)
  • "qrm_rhsnthreads" : the number of threads for the solve phase
  • "qrm_keeph" : whether to store or not the Householder vectors. Accepted values are qrm_yes_ and qrm_no_
  • "qrm_sing" : whether or not to detect the presence of singletons. Accepted values are qrm_yes_ and qrm_no_
  • "qrm_nlz" : the number of subtrees in L0 will be at least this times the number of threads
  • "qrm_cnode" : the number of cores per node
[in]ivalAny of the accepted values described above

Definition at line 824 of file qrm_spmat_mod.F90.

References qrm_error_mod::qrm_abort_, qrm_error_mod::qrm_err_act_restore(), qrm_error_mod::qrm_err_act_save(), qrm_error_mod::qrm_err_check(), qrm_error_mod::qrm_err_push(), qrm_ib_, qrm_keeph_, qrm_minamalg_, qrm_nb_, qrm_no_, qrm_ordering_, qrm_rhsnb_, qrm_rhsnthreads_, qrm_sing_, and qrm_yes_.

Referenced by _qrm_c_interface::_qrm_pseti_c().

subroutine _qrm_spmat_mod::_qrm_psetr ( type(_qrm_spmat_type qrm_spmat,
character(len=*)  string,
real(kind(1.d0))  rval 
)

This subroutine is meant to set the real control parameters.

Parameters
[in,out]qrm_spmatThe qrm_spmat instance concerned by the setting
[in]stringa string describing the parameter to be set. Accepted values are:
  • "qrm_amalgth" : the threshold that controls the amalgamation. A higher threshold means more fill-in but also more BLAS-3. Any real value is accepted
[in]rvalAny of the accepted values described above

Definition at line 911 of file qrm_spmat_mod.F90.

References qrm_error_mod::qrm_abort_, qrm_error_mod::qrm_err_act_restore(), qrm_error_mod::qrm_err_act_save(), qrm_error_mod::qrm_err_check(), and qrm_error_mod::qrm_err_push().

subroutine _qrm_spmat_mod::_qrm_spmat_alloc ( type(_qrm_spmat_type), intent(inout)  qrm_spmat,
integer, intent(in)  nz,
integer, intent(in)  m,
integer, intent(in)  n,
character, dimension(*), intent(in)  fmt 
)

This subroutine allocates memory for a sparse matrix.

Parameters
[in,out]qrm_spmatA _qrm_spmat_mod::_qrm_spmat_type data structure. The memory for storing the matrix is allocated according to the storage format. Also qrm_spmatnz, qrm_spmatm and qrm_spmatn are set to nz, m and n respectively. These are the sizes of the arrays in output
  • coo: irn(nz), jcn(nz), val(nz)
  • csr: iptr(m+1), jcn(nz), val(nz)
  • csc: irn(nz), jptr(n+1), val(nz)
[in]nzThe number of nonzeroes contained in the matrix
[in]mThe number of rows in the matrix
[in]nThe number of columns in the matrix
[in]fmtThe matrix storage format. Can be either "coo" or "csr" or "csc"

Definition at line 217 of file qrm_spmat_mod.F90.

References qrm_error_mod::qrm_abort_, qrm_error_mod::qrm_err_act_restore(), qrm_error_mod::qrm_err_act_save(), qrm_error_mod::qrm_err_check(), and qrm_error_mod::qrm_err_push().

subroutine _qrm_spmat_mod::_qrm_spmat_convert ( type(_qrm_spmat_type), intent(in)  in_mat,
type(_qrm_spmat_type out_mat,
character, dimension(*), intent(in)  fmt,
logical, optional  values 
)

This subroutine converts an input matrix into a different storage format. Optionally the values may be ignored (this comes handy during the analysis)

Parameters
[in]in_matthe input matrix
[in,out]out_matthe output matrix in fmt format
[in]fmtthe format of the output matrix
[in]values(optional) if values=.true. the output matrix will include numerical values, otherwise only the structure

Definition at line 356 of file qrm_spmat_mod.F90.

References _qrm_coo_to_csc(), _qrm_csc_to_csr(), qrm_error_mod::qrm_abort_, qrm_error_mod::qrm_err_act_restore(), qrm_error_mod::qrm_err_act_save(), qrm_error_mod::qrm_err_check(), and qrm_error_mod::qrm_err_push().

Referenced by _qrm_ata_graph(), _qrm_compute_graph(), _qrm_detect_singletons(), and _qrm_symbolic().

subroutine _qrm_spmat_mod::_qrm_spmat_copy ( type(_qrm_spmat_type), intent(in)  in_mat,
type(_qrm_spmat_type out_mat,
logical, optional  values 
)

This subroutine makes a copy of a matrix. Optionally the values may be ignored (this comes handy during the analysis)

Parameters
[in]in_matthe input matrix
[in,out]out_matthe output matrix in fmt format
[in]values(optional) if values=.true. the output matrix will include numerical values, otherwise only the structure

Definition at line 653 of file qrm_spmat_mod.F90.

References i, qrm_error_mod::qrm_abort_, qrm_error_mod::qrm_err_act_restore(), qrm_error_mod::qrm_err_act_save(), qrm_error_mod::qrm_err_check(), and qrm_error_mod::qrm_err_push().

Referenced by _qrm_do_colamd().

subroutine _qrm_spmat_mod::_qrm_spmat_destroy ( type(_qrm_spmat_type qrm_spmat,
logical, optional  all 
)

This subroutine destroyes a qrm_spmat instance.

Parameters
[in,out]qrm_spmatthe matrix to be destroyed
[in]allwhether to deallocate all the memory or not

Definition at line 730 of file qrm_spmat_mod.F90.

References _qrm_fdata_mod::_qrm_fdata_destroy(), qrm_error_mod::qrm_abort_, qrm_adata_mod::qrm_adata_destroy(), qrm_error_mod::qrm_err_act_restore(), qrm_error_mod::qrm_err_act_save(), and qrm_error_mod::qrm_err_check().

Referenced by _qrm_ata_graph(), _qrm_detect_singletons(), _qrm_do_colamd(), _qrm_do_metis(), _qrm_do_scotch(), _qrm_c_interface::_qrm_spmat_destroy_c(), and _qrm_symbolic().

subroutine _qrm_spmat_mod::_qrm_spmat_init ( type(_qrm_spmat_type), intent(inout)  qrm_spmat)

This subroutine initializes a qrm_spmat_type instance setting default values into the control parameters.

Parameters
[in,out]qrm_spmatThe matrix to be initialized

Definition at line 279 of file qrm_spmat_mod.F90.

References _qrm_cntl_init().

Referenced by _qrm_c_interface::_qrm_spmat_init_c().