SpM Handbook 1.2.4
|
#include "common.h"
Go to the source code of this file.
Macros | |
#define | TAG_SPM_SYMM 3483 |
Arbitrary tag for the symmetry exchange communications. | |
Functions | |
static void | spm_symm_add_missing_elt (spm_int_t *miss_sze, spm_int_t **miss_buf, spm_int_t *miss_nbr, spm_int_t jg, spm_int_t ig, int owner) |
Add a couple (ig, jg) in the list of missing entries of the owner. | |
static int | spm_symm_local_search (const spm_int_t *colptr, const spm_int_t *rowptr, spm_int_t jl, spm_int_t ig, spm_int_t baseval) |
Search locally if an element exists. | |
static void | spm_symm_check_local_pattern (spmatrix_t *spm, spm_int_t *miss_sze, spm_int_t **miss_buf, spm_int_t *miss_nbr) |
Check the local symmetry of the pattern. | |
static spm_int_t | spm_symm_values_newsize (const spmatrix_t *spm, spm_int_t miss_nbr, const spm_int_t *miss_buf) |
Compute the new size of the values array. | |
static spm_int_t | spm_symm_local_copy_column (const spmatrix_t *spm, size_t eltsize, spm_int_t jg, const spm_int_t *colptr, const spm_int_t **oldrow, spm_int_t **newrow, const char **oldval, char **newval) |
Copy the former column into the new one. | |
static spm_int_t | spm_symm_local_extend_column (spmatrix_t *spm, size_t eltsize, spm_int_t jl, spm_int_t jg, const spm_int_t *colptr, const spm_int_t **oldrowptr, spm_int_t **newrowptr, const char **oldvalptr, char **newvalptr, spm_int_t *miss_nbr, spm_int_t **miss_buf) |
Add the missing entries to the local spm. | |
static void | spm_symm_local_add (spmatrix_t *spm, spm_int_t miss_nbr, spm_int_t *miss_buf) |
Add the missing entries to the local spm. | |
spm_int_t | spmSymmetrize (spmatrix_t *spm) |
Symmetrize the pattern of the spm. | |
SParse Matrix package symmetrize routines.
Definition in file spm_symmetrize.c.
#define TAG_SPM_SYMM 3483 |
Arbitrary tag for the symmetry exchange communications.
Definition at line 26 of file spm_symmetrize.c.
|
static |
Add a couple (ig, jg) in the list of missing entries of the owner.
[in,out] | miss_sze | Array of size spm->clustnbr Contains the allocated sizes of the miss_buf arrays. |
[in,out] | miss_buf | Array of size spm->clustnbr. Contains the pointer to the allocated array of looked for elements. |
[in,out] | miss_nbr | Array of size spm->clustnbr. Contains the number of looked for entries per process. |
[in] | jg | Global column index of the looked for element. |
[in] | ig | Global row index of the looked for element. |
[in] | owner | Index of the owner of the looked for element. |
Definition at line 60 of file spm_symmetrize.c.
Referenced by spm_symm_check_local_pattern().
|
static |
Search locally if an element exists.
[in] | colptr | Colptr of the local spm. |
[in] | rowptr | Rowptr of the local spm. |
[in] | jl | Local column index of the looked for element. 0-based. |
[in] | ig | Global row index of the looked for element. O-based. |
[in] | baseval | Baseval of the spm. |
1 | if a symmetric element is found at (jl, ig); |
0 | otherwise. |
Definition at line 115 of file spm_symmetrize.c.
Referenced by spm_symm_check_local_pattern().
|
static |
Check the local symmetry of the pattern.
This function checks the local symmetry of the pattern, and for all missing elements stores them in the miss_xxx arrays for later checks. Local miss will need to be added. Remote miss will need to be first check for existence, and eventually be added to the remote structure.
[in,out] | spm | The spm for which the pattern symmetry must be checked. On exit, the glob2loc array is allocated if need for later checks. |
[in,out] | miss_sze | Array of size spm->clustnbr Contains the allocated sizes of the miss_buf arrays. |
[in,out] | miss_buf | Array of size spm->clustnbr. Contains the pointer to the allocated array of looked for elements. |
[in,out] | miss_nbr | Array of size spm->clustnbr. Contains the number of looked for entries per process. |
Definition at line 176 of file spm_symmetrize.c.
References spmatrix_s::baseval, spmatrix_s::clustnum, spmatrix_s::colptr, spmatrix_s::fmttype, spmatrix_s::loc2glob, spmatrix_s::n, spmatrix_s::replicated, spmatrix_s::rowptr, spm_getandset_glob2loc(), spm_symm_add_missing_elt(), spm_symm_local_search(), and SpmCSC.
Referenced by spmSymmetrize().
|
static |
Compute the new size of the values array.
[in] | spm | Pointer to the spm matrix |
[in] | miss_nbr | Number of local missing entries. |
[in] | miss_buf | Array of missing entries. |
Definition at line 463 of file spm_symmetrize.c.
References spmatrix_s::baseval, spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::loc2glob, spmatrix_s::nnzexp, and spmatrix_s::replicated.
Referenced by spm_symm_local_add().
|
static |
Copy the former column into the new one.
[in,out] | spm | On entry, the non symmetric local spm. On exit, the spm contains the symmetric elements with a value of 0. |
[in] | eltsize | The element size in byte |
[in] | jg | The global column index. |
[in] | colptr | Number of local missing entries. |
[in,out] | oldrow | Pointer to the current position in the former rowptr array. |
[in,out] | newrow | Pointer to the current position in the new rowptr array. |
[in,out] | oldval | Pointer to the current position in the former values array. |
[in,out] | newval | Pointer to the current position in the new values array. |
Definition at line 532 of file spm_symmetrize.c.
References spmatrix_s::baseval, spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::flttype, and SpmPattern.
Referenced by spm_symm_local_add().
|
static |
Add the missing entries to the local spm.
This function adds the entries that have been discovered missing in the previous checks. The spm arrays are realllocated to include these entries.
[in,out] | spm | On entry, the non symmetric local spm. On exit, the spm contains the symmetric elements with a value of 0. |
[in] | eltsize | The element size in byte |
[in] | jl | The local column index. |
[in] | jg | The global column index. |
[in] | colptr | Number of local missing entries. |
[in,out] | oldrowptr | Pointer to the current position in the former rowptr array. |
[in,out] | newrowptr | Pointer to the current position in the new rowptr array. |
[in,out] | oldvalptr | Pointer to the current position in the former values array. |
[in,out] | newvalptr | Pointer to the current position in the new values array. |
[in,out] | miss_nbr | The current remaining number of unnknowns to add. |
[in,out] | miss_buf | The point to the current missing entry to add. |
Definition at line 631 of file spm_symmetrize.c.
References spmatrix_s::baseval, spmatrix_s::dof, spmatrix_s::dofs, spmatrix_s::flttype, and SpmPattern.
Referenced by spm_symm_local_add().
|
static |
Add the missing entries to the local spm.
This function adds the entries that have been discovered missing in the previous checks. The spm arrays are realllocated to include these entries.
[in,out] | spm | On entry, the non symmetric local spm. On exit, the spm contains the symmetric elements with a value of 0. |
[in] | miss_nbr | Number of local missing entries. |
[in] | miss_buf | Array of missing entries. |
Definition at line 759 of file spm_symmetrize.c.
References spmatrix_s::baseval, spmatrix_s::colptr, spmatrix_s::flttype, spmatrix_s::fmttype, spmatrix_s::loc2glob, spmatrix_s::n, spmatrix_s::nnz, spmatrix_s::nnzexp, spmatrix_s::replicated, spmatrix_s::rowptr, spm_size_of(), spm_symm_local_copy_column(), spm_symm_local_extend_column(), spm_symm_values_newsize(), SpmCSC, SpmPattern, and spmatrix_s::values.
Referenced by spmSymmetrize().