murge.c

This file implements Murge interface.

Summary
murge.cThis file implements Murge interface.
Authors
Structures
ijv_Structure to represente coefficients.
Variables
i
j
idx
owner
Types
ijv_tAlias to structure ijv_.
murge_data_tStructure used to store murge data
Variables
n
N
nrhs
tmpijv_size
tmpijv_size_node
mutex_tmpmatrix
cnt
cnt_zero
cnt_node
edgenbr
coefnbr
nodenbr
state
mode
op
op2
sym
dynamic
Types
murge_data_talias to structure <murge_data_>.
Global variables
Variables
Global variables
Functions
Auxilary functions
check_preprocessingChecks if preprocessing (blend) has been called.
cmp_ijvCompare to ijv_t structures on their column value (j) then, if equal, their row value (i).
Variables
MurgeTmpijvOwnSortSort ijv_t structure, sorting also associated values.
MurgeTmpijvSortSort ijv_t structure, sorting also associated values.
Solver setup functions
MURGE_GetSolverreturns MURGE_SOLVER_PASTIX
MURGE_InitializeAllocate the instance arrays which will keeps intern data for all solver instances.
MURGE_SetDefaultOptionsCreate a solver instance if not created yet.
MURGE_SetOptionINTSets integer option, indicated by number, to value for the solver instance number id.
MURGE_SetOptionREALSets real option, indicated by number, to value for the solver instance number id.
MURGE_SetCommunicatorSets MPI communicator for the given solver instance.
I/O functions
MURGE_SaveRuns preprocessing step, if not done yet, and save the result to disk, into directory, so that it can be resume using MURGE_Load.
MURGE_LoadLoads preprocessing result from disk, into directory, where it had been saved by MURGE_Save.
Getting solver’s distribution
MURGE_GetLocalNodeNbrComputes preprocessing step, if not done, and the number of Nodes in the new ditribution of the matrix.
MURGE_GetLocalNodeListComputes the local node list, corresponding to the new distribution, after preprocessing.
MURGE_GetLocalUnkownNbrComputes preprocessing step, if not done, and the number of Unkowns in the new ditribution of the matrix.
MURGE_GetLocalUnknownNbr
MURGE_GetLocalUnkownListComputes the local unkown list, corresponding to the new distribution, after preprocessing.
MURGE_GetLocalUnknownList
Graph setup functions
MURGE_GraphBegin
MURGE_GraphEdge
MURGE_GraphEnd
MURGE_GraphGlobalCSREnter the adjency graph in a Column Sparse Row form.
MURGE_GraphGlobalCSCDistribute the CSC on the processors and use it for PaStiX calls.
MURGE_GraphGlobalIJVDistribute the graph on the processors, compress the columns array and use the built CSCd to call PaStiX.
MURGE_SetOrdering
Matrix assembly functions
MURGE_AssemblyBeginCheck that preprocessing has been performed, if not performs it.
MURGE_AssemblySetValue
MURGE_AssemblySetNodeValues
MURGE_AssemblySetBlockValues
MURGE_AssemblyEndWe have on each proc a part of the matrix in two structure, one containing nodes to add to the CSCd the other containing simple values.
MURGE_MatrixReset
MURGE_MatrixGlobalCSR
MURGE_MatrixGlobalCSCGive a CSC on one processor to PaStiX.
MURGE_MatrixGlobalIJVAdd the given global Compress Sparse Column matrix to the matrix.
Filling the right-hand-side member
MURGE_SetGlobalRHS
MURGE_SetLocalRHS
MURGE_SetRHS
MURGE_RHSReset
Getting the solution
MURGE_GetGlobalSolution
MURGE_GetLocalSolution
MURGE_GetSolution
Cleaning up this mess
MURGE_Clean
MURGE_Finalize
MURGE_GetInfoINT
MURGE_GetInfoREAL
MURGE_PrintErrorPrint the error message corresponding to ierror Parameters: error_number - Error identification number.
MURGE_ExitOnErrorPrint the error message corresponding to ierror.
Scaling
MURGE_GetGlobalNormCompute the global norm array following a norm rule.
MURGE_GetLocalNormCompute the local norm array following a norm rule.
MURGE_GetNormCompute the indicated part of the norm array following a norm rule.
MURGE_ApplyGlobalScalingApply scaling to local unknowns.
MURGE_ApplyLocalScalingApply the local scaling array on the matrix.
MURGE_ApplyScalingApply the scaling array on the indicated part of the matrix
Specific PaStiX functions.
MURGE_Analyze
MURGE_FactorizePerform matrix factorization.
MURGE_ForceNoFactoPrevent Murge from running factorisation even if matrix has changed.
MURGE_ProductSetLocalNodeNbr
MURGE_ProductSetLocalNodeList
MURGE_GetLocalProductPerform the product A * X.
product_data_
Variables
thread_id
ret
MURGE_GetGlobalProductPerform the product A * X.
MURGE_SetLocalNodeList

Structures

ijv_

Structure to represente coefficients.

Contains

irow
jcolumn
vpointer to the value array (can be several degree of freedom)
ownerprocess which own the coefficient.
Summary

Variables

i

INT i

j

INT j

idx

INT idx

owner

int owner

Types

ijv_t

Alias to structure ijv_.

murge_data_t

Structure used to store murge data

Contians

pastix_dataPointer to the pastix_data_t associated to the solver instance
nNumber of local column indicated by murge user
NNumber of global column indicated by murge user
colptrColptr in murge’s user CSCd
rowsRows in murge’s user CSCd
valuesValues in murge’s user CSCd
l2gLocal 2 global column number in murge’s user CSCd
permPermtab for murge’s user
bRight-hand-side member(s) given by murge’s user
nrhsNumber of right-hand-side member(s) given by murge’s user
tmpvTemporary values array
tmpv_nodeTemporary values array (node entries)
tmpijvTemporary ijv structure array
cntIterator for number of entered edges
edgenbrNumber of edges
stateState of the solver
modeLocal entries or communicating mode
opOperation to perform when a coefficient appear twice
op2Operation to perform when a coefficient appear twice, given by two processors.
symIndicate if we have to check that the matrix is symmetric

Variables

n

INT n

N

INT N

nrhs

INT nrhs

tmpijv_size

INT tmpijv_size

tmpijv_size_node

INT tmpijv_size_node

mutex_tmpmatrix

pthread_mutex_t mutex_tmpmatrix

cnt

INT cnt

cnt_zero

INT cnt_zero

cnt_node

INT cnt_node

edgenbr

INT edgenbr

coefnbr

INT coefnbr

nodenbr

INT nodenbr

state

int state

mode

int mode

op

int op

op2

int op2

sym

int sym

dynamic

int dynamic

Types

murge_data_t

alias to structure <murge_data_>.

Global variables

Variables

Global variables

idnbrNumber of solvers instances.
solversMurge solver instances array (murge_data_t).

Functions

Auxilary functions

check_preprocessing

Checks if preprocessing (blend) has been called.

If it hasn’t, it will allocate permutation tabular and call preprocessing step.

After calling preprocessing, it will set local number of column and local to global column number tabular to their new values.

Colptr and rows will be destroyed because it is obsolete, and state will be set to indicate that preprocessing has been performed.

Parameters

idSolver instance ID we want to check

Returns

MURGE_ERR_ALLOCATEIf any allocation error occurs.

cmp_ijv

static int cmp_ijv(const void *p1,
const void *p2)

Compare to ijv_t structures on their column value (j) then, if equal, their row value (i).

Used for qsort.

Parameters

p1pointer to the first element.
p2pointer to the second element.

Returns

A positive numberif p1.j > p2.j or p1.j == p2.j and pi.i > pi.j
0if columns and rows are aquals.
A negative numberotherwise.
Summary
Variables
MurgeTmpijvOwnSortSort ijv_t structure, sorting also associated values.

Variables

MurgeTmpijvOwnSort

ijv_t t

Sort ijv_t structure, sorting also associated values.  Sort following owner, then j and then i.

Parameters

pbaseArray of two pointers, one to the first element of the array to sort, and the second to dofnbr.
total_elemsNumber of element in the array.

Returns

Nothing

MurgeTmpijvSort

Sort ijv_t structure, sorting also associated values.  Sort following j and then i.

Parameters

pbaseArray of two pointers, one to the first element of the array to sort, and the second to dofnbr.
total_elemsNumber of element in the array.

Returns

Nothing

Solver setup functions

MURGE_GetSolver

returns MURGE_SOLVER_PASTIX

MURGE_Initialize

INTS MURGE_Initialize(INTS id_nbr)

Allocate the instance arrays which will keeps intern data for all solver instances.

If user is creating several threads calling the solver, this function has to be called before creating threads to insure solver is thread safe.

Parameters

idnbrMaximum number of solver instances that will be launched.

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_ALLOCATEIf for some reason, allocation was not successfull.

MURGE_SetDefaultOptions

INTS MURGE_SetDefaultOptions(INTS id,
INTS stratnum)

Create a solver instance if not created yet.

Sets default options, for solver instance number id.

The default option set correspond to stratnum strategy ID, depending on the solver.

Needs MURGE_Initialize to be called before to allocate solver instances array.

Parameters

idSolver instance identification number.
stratnumStrategy for the default option Set.

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_ORDERIf MURGE_Initialize was not called before.
MURGE_ERR_PARAMETERIf id is not in solver arrays range or stratnum is not valid.
MURGE_ERR_ALLOCATEIf couldn’t create solver instance.

MURGE_SetOptionINT

INTS MURGE_SetOptionINT (INTS id,
INTS number,
INTS value)

Sets integer option, indicated by number, to value for the solver instance number id.

Needs <MURGE_SetDefaultOption> to be called before to initiate solver instance data.

Parameters

idSolver instance identification number.
numberIdentification of the integer parameter.
valuevalue to set the parameter to.

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_ORDERIf <MURGE_SetDefaultOption> was not called before.
MURGE_ERR_PARAMETERIf id is not in solver arrays range or number or value are not valid.

MURGE_SetOptionREAL

INTS MURGE_SetOptionREAL(INTS id,
INTS number,
REAL value)

Sets real option, indicated by number, to value for the solver instance number id.

Needs <MURGE_SetDefaultOption> to be called before to initiate solver instance data.

Parameters

idSolver instance identification number.
numberIdentification of the integer parameter.
valuevalue to set the parameter to.

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_ORDERIf <MURGE_SetDefaultOption> was not called before.
MURGE_ERR_PARAMETERIf id is not in solver arrays range or number or value are not valid.

MURGE_SetCommunicator

INTS MURGE_SetCommunicator(INTS id,
MPI_Comm mpicomm)

Sets MPI communicator for the given solver instance.

Needs <MURGE_SetDefaultOption> to be called before to initiate solver instance data.

Musn’t be called before <MURGE_SAVE>, <MURGE_LOAD>, MURGE_GetLocalNodeNbr nor MURGE_GetLocalUnknownNbr because the solver as to be runned with the same MPI communicator all along.

If this function is not called, MPI communicator will be MPI_COMM_WORLD.

This function may not exist if the solver has been compiled without MPI.

Parameters

idSolver instance identification number.
mpicommMPI communicator to affect the solver to.

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_ORDERIf <MURGE_SetDefaultOption> was not called before or if it is called after the solver starts its computing tasks.
MURGE_ERR_PARAMETERIf id is not in solver arrays range or number or value are not valid.

I/O functions

MURGE_Save

INTS MURGE_Save(INTS id,
char *directory)

Runs preprocessing step, if not done yet, and save the result to disk, into directory, so that it can be resume using MURGE_Load.

Needs <MURGE_SetDefaultOption> to be called before to initiate solver instance data.

Parameters

idSolver instance identification number.
directoryPath to the directory where to save the solver step.

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_ORDERIf <MURGE_SetDefaultOption> was not called before.
MURGE_ERR_PARAMETERIf id is not in solver arrays range.
MURGE_ERR_IOIf file(s) couldn’t be writen.

MURGE_Load

INTS MURGE_Load(INTS id,
char *directory)

Loads preprocessing result from disk, into directory, where it had been saved by MURGE_Save.

If preprocessing data was already computed or loaded, it will be overwriten.

Needs <MURGE_SetDefaultOption> to be called before to initiate solver instance data.

Parameters

idSolver instance identification number.
directoryPath to the directory where to load the solver preprocessing data.

In Fortran, STR_LEN is the length of the string directory.

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_ORDERIf <MURGE_SetDefaultOption> was not called before.
MURGE_ERR_PARAMETERIf id is not in solver arrays range.
MURGE_ERR_IOIf file(s) couldn’t be read.

Getting solver’s distribution

MURGE_GetLocalNodeNbr

INTS MURGE_GetLocalNodeNbr (INTS id,
INTS *nodenbr)

Computes preprocessing step, if not done, and the number of Nodes in the new ditribution of the matrix.

Parameters

idSolver instance identification number.
nodenbrINTS where to store number of nodes.

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_PARAMETERIf id is not in solver arrays range or nodenbr is NULL (can occur in C).

MURGE_GetLocalNodeList

INTS MURGE_GetLocalNodeList (INTS id,
INTS *nodelist)

Computes the local node list, corresponding to the new distribution, after preprocessing.

nodelist array has to be allocated before calling this function.

As it’s result determines the size of nodelist array, MURGE_GetLocalNodeNbr should be run before it.

Parameters

idSolver instance identification number.
nodelistArray where to store the list of local nodes.

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_ORDERif MURGE_GetLocalNodeNbr has not been called before.
MURGE_ERR_PARAMETERIf id is not in solver arrays range or nodelist is NULL (can occur in C).

MURGE_GetLocalUnkownNbr

Computes preprocessing step, if not done, and the number of Unkowns in the new ditribution of the matrix.

Parameters

idSolver instance identification number.
unkownnbrINTS where to store number of unkowns.

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_PARAMETERIf id is not in solver arrays range or unkownnbr is NULL (can occur in C).

MURGE_GetLocalUnknownNbr

INTS MURGE_GetLocalUnknownNbr (INTS id,
INTS *unkownnbr)

MURGE_GetLocalUnkownList

Computes the local unkown list, corresponding to the new distribution, after preprocessing.

unkownlist array has to be allocated before calling this function.

As it’s result determines the size of unkownlist array, MURGE_GetLocalUnkownNbr should be run before it.

Parameters

idSolver instance identification number.
unkownlistArray where to store the list of local unkowns.

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_ORDERif MURGE_GetLocalUnkownNbr has not been called before.
MURGE_ERR_PARAMETERIf id is not in solver arrays range or unkownlist is NULL (can occur in C).

MURGE_GetLocalUnknownList

INTS MURGE_GetLocalUnknownList(INTS id,
INTS *unkownlist)

Graph setup functions

MURGE_GraphBegin

INTS MURGE_GraphBegin(INTS id,
INTS N,
INTL edgenbr)
  • Allocate temporary structure which will contain graph entries.
  • Set number of unkowns in the graph.
  • Set the number of entries that are expected in this building session.
  • Reset the number of entries for this build session.
  • Set all states except MURGE_GRAPH_BUILD to FALSE (graph, values, blend, nodelst, nodenbr, facto)

Parameters

idSolver instance identification number.
NNumber of unkowns.
edgenbrNumber of edges in this building session.  If edgenbr is negative, PaStiX will perform dynamic reallocation of the array, with the first allocation of size -edgenbr.

Returns

MURGE_ERR_ORDERMURGE_GraphBegin has already been called, or if solvers or solvers[id] are not allocated, or if iparm or dparm are not allocated.
MURGE_ERR_PARAMETERIf id is not in correct range.
MURGE_SUCCESSOtherwise.

MURGE_GraphEdge

INTS MURGE_GraphEdge (INTS id,
INTS ROW,
INTS COL)
  • Check that the number of entries has not been reach for this session.
  • Increments ROW and COL if baseval is set to 0.
  • Checks that ROW and COL ranges are corrects.
  • Adds an entry to the temporary ijv structure.

Parameters

idSolver instance identification number.
ROWRow of the entry.
COLColumn of the entry.

Return

MURGE_ERR_ORDERif we are not in a graph building session, or if two many edges have been entered, or if solvers or solvers[id] are not allocated, or if iparm or dparm are not allocated.
MURGE_ERR_PARAMETERROW or COL are out of range or if id is not in correct range.
MURGE_SUCCESSOtherwise

MURGE_GraphEnd

INTS MURGE_GraphEnd (INTS id)
  • Sort temporary IJV structure with cols as key.
  • Distribute columns onto processors.  (first column on first proc and so on...)
  • Build a distributed CSC that will be given to PaStiX.

TODO

  • In the case of a triangular matrix, count each extra-diagonal twice.
  • Use initial distribution to compute column distribution, in order to reduce communications.

Parameters : id - Solver instance identification number.

Returns

MURGE_ERR_ORDERif we are not in a graph building session, or if all edges have not been entered, or if solvers or solvers[id] are not allocated, or if iparm or dparm are not allocated.
MURGE_ERR_PARAMETERROW or COL are out of range or if id is not in correct range.
MURGE_SUCCESSOtherwise

MURGE_GraphGlobalCSR

INTS MURGE_GraphGlobalCSR(INTS id,
INTS N,
INTL *rowptr,
INTS *COLS,
INTS root)

Enter the adjency graph in a Column Sparse Row form.

If the matrix is symmetric, calls MURGE_GraphGlobalCSC else uses MURGE_GraphBegin, MURGE_GraphEdge, MURGE_GraphEnd sequence.

Parameters

idSolver instance identification number.
NNumber of rows in the CSR.
rowptrIndexes of each row in COLS array.
rootRank of the processor owning the CSR (-1 for all processors)

MURGE_GraphGlobalCSC

INTS MURGE_GraphGlobalCSC(INTS id,
INTS N,
INTL *colptr,
INTS *ROWS,
INTS root)

Distribute the CSC on the processors and use it for PaStiX calls.

Parameters

idSolver instance identification number.
NNumber of columns in the CSR.
colptrIndexes of each columns in ROWS array.
rootRank of the processor owning the CSR (-1 for all processors)

MURGE_GraphGlobalIJV

INTS MURGE_GraphGlobalIJV(INTS id,
INTS N,
INTL NNZ,
INTS *ROWS,
INTS *COLS,
INTS root)

Distribute the graph on the processors, compress the columns array and use the built CSCd to call PaStiX.

Parameters

idSolver instance identification number.
NNumber of columns in the CSR.
NNZNumber of non-zeros in the matrix.
ROWSRows array.
COLSColumns array.
rootRank of the processor owning the CSR (-1 for all processors)

MURGE_SetOrdering

INTS MURGE_SetOrdering(INTS id,
INTS *permutation)

Matrix assembly functions

MURGE_AssemblyBegin

INTS MURGE_AssemblyBegin(INTS id,
INTL coefnbr,
INTS op,
INTS op2,
INTS mode,
INTS sym)

Check that preprocessing has been performed, if not performs it.

Allocate ijv structure which will be used to store I,J,v[dof*dof].

Parameters

opOperation to perform for coefficient which appear several tim (see MURGE_ASSEMBLY_OP).
op2Operation to perform when a coefficient is set by two different processors (see MURGE_ASSEMBLY_OP).
modeIndicates if user ensure he will respect solvers distribution (see MURGE_ASSEMBLY_MODE).
symIndicates if user will give coefficient in a symmetric way (ie: only triangullar part) or not.

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_ORDERIf graph hasn’t been built before.
MURGE_ERR_ALLOCATEIf Allocation didn’t worked.
MURGE_ERR_PARAMETERIf id is not in solver arrays range, or op, mode, sym, or coefnbr are not valid.

MURGE_AssemblySetValue

INTS MURGE_AssemblySetValue (INTS id,
INTS ROW,
INTS COL,
COEF value)

MURGE_AssemblySetNodeValues

INTS MURGE_AssemblySetNodeValues (INTS id,
INTS ROW,
INTS COL,
COEF *values)

MURGE_AssemblySetBlockValues

INTS MURGE_AssemblySetBlockValues(INTS id,
INTS nROW,
INTS *ROWlist,
INTS nCOL,
INTS *COLlist,
COEF *values)

MURGE_AssemblyEnd

INTS MURGE_AssemblyEnd(INTS id)

We have on each proc a part of the matrix in two structure, one containing nodes to add to the CSCd the other containing simple values.

We send all data to his owner

  • We build glob2local array to determine if a column is local.
  • We sort our data structures (IJV structures) using the “owner” attribute.
  • We send non local data to other processors.

We merge all data in the node structure.

  • We receive Data and merge node structure with simple values one.
  • We look for each coef in node structure, if present we modify the node, if not, we search in the CSCd and directly modify it.  Else we construct a new node and add it.

We Add this structure to the local CSCd.

MURGE_MatrixReset

INTS MURGE_MatrixReset(INTS id)

MURGE_MatrixGlobalCSR

INTS MURGE_MatrixGlobalCSR(INTS id,
INTS N,
INTL *rowptr,
INTS *COLS,
COEF *values,
INTS root,
INTS op,
INTS sym)

MURGE_MatrixGlobalCSC

INTS MURGE_MatrixGlobalCSC(INTS id,
INTS N,
INTL *COLPTR,
INTS *ROWS,
COEF *values,
INTS root,
INTS op,
INTS sym)

Give a CSC on one processor to PaStiX.

MURGE_MatrixGlobalIJV

INTS MURGE_MatrixGlobalIJV(INTS id,
INTS N,
INTL NNZ,
INTS *ROWS,
INTS *COLS,
COEF *values,
INTS root,
INTS op,
INTS sym)

Add the given global Compress Sparse Column matrix to the matrix.

Parameters

idSolver instance identification number.
NNumber of edges.
NNZNumber of non zeros.
ROWSGlobal row number array.
COLSGlobal column number array.
valuesvalues array.
rootRoot processor for MPI communications.
opOperation to perform if a coefficient appear twice (see MURGE_ASSEMBLY_OP).
symIndicates if user will give coefficient in a symmetric way (ie: only triangullar part) or not.

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_PARAMETERIf id is not in solver arrays range, if root, op, ROWS or COLS are not valid.

Fortran interface

SUBROUTINE MURGE_MATRIXGLOBALIJV(ID, N, NNZ, ROWS, COLS, VALUES, &
                               & ROOT, OP, SYM, IERROR)
  INTS,               INTENT(IN)  :: ID, ROOT, OP, SYM, N
  INTL,               INTENT(IN)  :: NNZ
  INTS, DIMENSION(0), INTENT(IN)  :: ROWS, COLS
  COEF, DIMENSION(0), INTENT(IN)  :: VALUES
  INTS,               INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_MATRIXGLOBALIJV

Filling the right-hand-side member

MURGE_SetGlobalRHS

INTS MURGE_SetGlobalRHS(INTS id,
COEF *b,
INTS root,
INTS op)

MURGE_SetLocalRHS

INTS MURGE_SetLocalRHS (INTS id,
COEF *b,
INTS op,
INTS op2)

MURGE_SetRHS

INTS MURGE_SetRHS (INTS id,
INTS n,
INTS *coefsidx,
COEF *b,
INTS op,
INTS op2,
INTS mode)

MURGE_RHSReset

INTS MURGE_RHSReset(INTS id)

Getting the solution

MURGE_GetGlobalSolution

INTS MURGE_GetGlobalSolution(INTS id,
COEF *x,
INTS root)

MURGE_GetLocalSolution

INTS MURGE_GetLocalSolution (INTS id,
COEF *x)

MURGE_GetSolution

INTS MURGE_GetSolution (INTS id,
INTS n,
INTS *coefsidx,
COEF *x,
INTS mode)

Cleaning up this mess

MURGE_Clean

INTS MURGE_Clean(INTS id)

MURGE_Finalize

INTS MURGE_Finalize()

MURGE_GetInfoINT

INTS MURGE_GetInfoINT(INTS id,
INTS metric,
INTL *value)

MURGE_GetInfoREAL

INTS MURGE_GetInfoREAL(INTS id,
INTS metric,
REAL *value)

MURGE_PrintError

INTS MURGE_PrintError(INTS error_number)

Print the error message corresponding to ierror Parameters: error_number - Error identification number.

Returns

MURGE_ERR_PARAMETERIf ierror does not match an error number
MURGE_SUCCESSIf function runned successfully.

Fortran interface

SUBROUTINE MURGE_PRINTERROR(ERROR_NUMBER, IERROR)
  INTS, INTENT(IN)  :: IERROR
  INTS, INTENT(OUT) :: ERROR_NUMBER
END SUBROUTINE MURGE_PRINTERROR

MURGE_ExitOnError

INTS MURGE_ExitOnError(INTS error_number)

Print the error message corresponding to ierror.  If the ierr is not MURGE_SUCCESS then the program is stopped.

Parameters

ierrorError identification number.

Returns

MURGE_SUCCESSIf function runned successfully, stop the program otherwise.

Fortran interface

SUBROUTINE MURGE_EXITONERROR(ERROR_NUMBER, IERROR)
  INTS, INTENT(IN)  :: IERROR
  INTS, INTENT(OUT) :: ERROR_NUMBER
END SUBROUTINE MURGE_EXITONERROR
Summary

Scaling

MURGE_GetGlobalNorm

INTS MURGE_GetGlobalNorm(INTS id,
REAL *norm,
INTS root,
INTS rule)

Compute the global norm array following a norm rule.

Must be performed after assembly step.

Parameters

idSolver instance identification number.
normArray of size global column number*dof which will contain the norm values
rootIndicates which processor will have the norm array at the end of the call, -1 for all.
ruleRule to follow to build norm array, see MURGE_NORM_RULES

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_PARAMETERIf id is not in solver arrays range.
MURGE_ERR_ORDERIf the assembly has not been performed.

Fortran interface

SUBROUTINE MURGE_GETGLOBALNORM(ID, NORM, ROOT, RULE, IERROR)
  INTS,               INTENT(IN)  :: ID, ROOT, RULE
  REAL, DIMENSION(0), INTENT(OUT) :: NORM
  INTS,               INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_GETGLOBALNORM

MURGE_GetLocalNorm

INTS MURGE_GetLocalNorm(INTS id,
REAL *norm,
INTS rule)

Compute the local norm array following a norm rule.

Must be performed after assembly step.

Parameters

idSolver instance identification number.
normArray of size local column number*dof which will contain the solution
ruleRule to follow to build norm array, see MURGE_NORM_RULES

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_PARAMETERIf id is not in solver arrays range.
MURGE_ERR_ORDERIf the assembly has not been performed.

Fortran interface

SUBROUTINE MURGE_GETLOCALNORM(ID, NORM, RULE, IERROR)
  INTS,               INTENT(IN)  :: ID, RULE
  REAL, DIMENSION(0), INTENT(OUT) :: NORM
  INTS,               INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_GETLOCALNORM

MURGE_GetNorm

INTS MURGE_GetNorm(INTS id,
INTS n,
INTS *coefsidx,
REAL *norm,
INTS rule,
INTS mode)

Compute the indicated part of the norm array following a norm rule.

Must be performed after assembly step.

Parameters

idSolver instance identification number.
nNumber of coefficients user wants to get norm of.
coefsidxList of the coefficients user wants to get norm of.
normArray of size dof*n which will contain the solution.
ruleRule to follow to build norm array, see MURGE_NORM_RULES
modeIndicates if the user is sure to respect the distribution.

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_PARAMETERIf id is not in solver arrays range.
MURGE_ERR_ORDERIf the assembly has not been performed.

Fortran interface

SUBROUTINE MURGE_GETNORM(ID, N, COEFSIDX, NORM, RULE, MODE, IERROR)
  INTS,               INTENT(IN)  :: ID, MODE, N, RULE
  INTS, DIMENSION(0), INTENT(IN)  :: COEFSIDX
  COEF, DIMENSION(0), INTENT(OUT) :: NORM
  INTS,               INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_GETNORM

MURGE_ApplyGlobalScaling

INTS MURGE_ApplyGlobalScaling(INTS id,
REAL *scal,
INTS root,
INTS sc_mode)

Apply scaling to local unknowns.

Must be performed after assembly step.

Parameters

idSolver instance identification number.
scalScaling user wants to apply.
sc_modeIndicate if the scaling is applied on rows or on columns.
rootIndicates which processor that posses the scaling array, -1 for all.

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_PARAMETERIf id is not in solver arrays range.
MURGE_ERR_ORDERIf the assembly has not been performed.

Fortran interface

SUBROUTINE MURGE_APPLYGLOBALSCALING(ID, SCAL, SC_MODE, ROOT, IERROR)
  INTS,               INTENT(IN)  :: ID, ROOT, SC_MODE
  REAL, DIMENSION(0), INTENT(OUT) :: SCAL
  INTS,               INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_APPLYGLOBALSCALING

MURGE_ApplyLocalScaling

INTS MURGE_ApplyLocalScaling(INTS id,
REAL *scal,
INTS sc_mode)

Apply the local scaling array on the matrix.

Must be performed after assembly step.

Parameters

idSolver instance identification number.
scalArray of size local column number*dof which will contain the solution.
sc_modeIndicate if the scaling is applied on rows or on columns.

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_PARAMETERIf id is not in solver arrays range.
MURGE_ERR_ORDERIf the assembly has not been performed.

Fortran interface

SUBROUTINE MURGE_APPLYLOCALSCALING(ID, SCAL, SC_MODE, IERROR)
  INTS,               INTENT(IN)  :: ID, SC_MODE
  REAL, DIMENSION(0), INTENT(OUT) :: SCAL
  INTS,               INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_APPLYLOCALSCALING

MURGE_ApplyScaling

INTS MURGE_ApplyScaling(INTS id,
INTS n,
INTS *coefsidx,
REAL *scal,
INTS sc_mode,
INTS mode)

Apply the scaling array on the indicated part of the matrix

Must be performed after assembly step.

Parameters

idSolver instance identification number.
nNumber of coefficients user wants to scale.
coefsidxList of the coefficients user wants to scale.
scalArray of size dof*n which will contain the solution.
sc_modeIndicate if the scaling is applied on rows or on columns.
modeIndicates if the user is sure to respect the distribution.

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_PARAMETERIf id is not in solver arrays range.
MURGE_ERR_ORDERIf the assembly has not been performed.

Fortran interface

SUBROUTINE MURGE_APPLYSCALING(ID, N, COEFSIDX, SCAL, SC_MODE, MODE, IERROR)
  INTS,               INTENT(IN)  :: ID, SC_MODE, MODE, N
  INTS, DIMENSION(0), INTENT(IN)  :: COEFSIDX
  COEF, DIMENSION(0), INTENT(OUT) :: SCAL
  INTS,               INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_APPLYSCALING

Specific PaStiX functions.

MURGE_Analyze

INTS MURGE_Analyze(INTS id)

Perform matrix analyze

  • Compute a new ordering of the unknows
  • Compute the symbolic factorisation of the matrix
  • Distribute column blocks and computation on processors

Parameters

idSolver instance identification number.

Returns

MURGE_SUCCESSIf function runned succesfuly.
MURGE_ERR_ORDERIf function the graph is not built.
MURGE_ERR_PARAMETERIf murge_id is not a valid ID.

MURGE_Factorize

INTS MURGE_Factorize(INTS id)

Perform matrix factorization.

Parameters

idSolver instance identification number.

Returns

MURGE_SUCCESSIf function runned succesfuly.
MURGE_ERR_ORDERIf function the graph is not built.
MURGE_ERR_PARAMETERIf murge_id is not a valid ID.

MURGE_ForceNoFacto

INTS MURGE_ForceNoFacto(INTS id)

Prevent Murge from running factorisation even if matrix has changed.

Parameters

idSolver instance identification number.  Returns: MURGE_SUCCESS

MURGE_ProductSetLocalNodeNbr

INTS MURGE_ProductSetLocalNodeNbr (INTS id,
INTS n)

Parameters

idSolver instance identification number.
nNumber of local nodes.

MURGE_ProductSetLocalNodeList

INTS MURGE_ProductSetLocalNodeList (INTS id,
INTS *l2g)

Parameters

idSolver instance identification number.
l2gLocal to global node numbers.

MURGE_GetLocalProduct

INTS MURGE_GetLocalProduct (INTS id,
COEF *x)

Perform the product A * X.

The vector must have been given trough MURGE_SetLocalRHS or MURGE_SetGlobalRHS.

Parameters

idSolver instance identification number.
xArray in which the local part of the product will be stored.  Returns:
MURGE_ERR_ORDERIf values have not been set.

product_data_

Variables

thread_id

INTS thread_id

ret

INTS ret

MURGE_GetGlobalProduct

INTS MURGE_GetGlobalProduct (INTS id,
COEF *x,
INTS root)

Perform the product A * X.

The vector must have been given trough MURGE_SetLocalRHS or MURGE_SetGlobalRHS.

Parameters

idSolver instance identification number.
xArray in which the product will be stored.
rootRank of the process which will own the product at end of call, use -1 for all processes.  Returns:
MURGE_ERR_ORDERIf values have not been set.

MURGE_SetLocalNodeList

INTS MURGE_SetLocalNodeList (INTS id,
INTS nodenbr,
INTS *nodelist)
Murge is close to the Merge.
INT i
INT j
INT idx
int owner
Structure to represente coefficients.
INT n
INT N
INT nrhs
INT tmpijv_size
INT tmpijv_size_node
pthread_mutex_t mutex_tmpmatrix
INT cnt
INT cnt_zero
INT cnt_node
INT edgenbr
INT coefnbr
INT nodenbr
int state
int mode
int op
int op2
int sym
int dynamic
static int cmp_ijv(const void *p1,
const void *p2)
Compare to ijv_t structures on their column value (j) then, if equal, their row value (i).
Alias to structure ijv_.
ijv_t t
Sort ijv_t structure, sorting also associated values.
INTS MURGE_Initialize(INTS id_nbr)
Allocate the instance arrays which will keeps intern data for all solver instances.
INTS MURGE_SetDefaultOptions(INTS id,
INTS stratnum)
Create a solver instance if not created yet.
INTS MURGE_SetOptionINT (INTS id,
INTS number,
INTS value)
Sets integer option, indicated by number, to value for the solver instance number id.
INTS MURGE_SetOptionREAL(INTS id,
INTS number,
REAL value)
Sets real option, indicated by number, to value for the solver instance number id.
INTS MURGE_SetCommunicator(INTS id,
MPI_Comm mpicomm)
Sets MPI communicator for the given solver instance.
INTS MURGE_Save(INTS id,
char *directory)
Runs preprocessing step, if not done yet, and save the result to disk, into directory, so that it can be resume using MURGE_Load.
INTS MURGE_Load(INTS id,
char *directory)
Loads preprocessing result from disk, into directory, where it had been saved by MURGE_Save.
INTS MURGE_GetLocalNodeNbr (INTS id,
INTS *nodenbr)
Computes preprocessing step, if not done, and the number of Nodes in the new ditribution of the matrix.
INTS MURGE_GetLocalNodeList (INTS id,
INTS *nodelist)
Computes the local node list, corresponding to the new distribution, after preprocessing.
INTS MURGE_GetLocalUnknownNbr (INTS id,
INTS *unkownnbr)
INTS MURGE_GetLocalUnknownList(INTS id,
INTS *unkownlist)
INTS MURGE_GraphBegin(INTS id,
INTS N,
INTL edgenbr)
INTS MURGE_GraphEdge (INTS id,
INTS ROW,
INTS COL)
INTS MURGE_GraphEnd (INTS id)
INTS MURGE_GraphGlobalCSR(INTS id,
INTS N,
INTL *rowptr,
INTS *COLS,
INTS root)
Enter the adjency graph in a Column Sparse Row form.
INTS MURGE_GraphGlobalCSC(INTS id,
INTS N,
INTL *colptr,
INTS *ROWS,
INTS root)
Distribute the CSC on the processors and use it for PaStiX calls.
INTS MURGE_GraphGlobalIJV(INTS id,
INTS N,
INTL NNZ,
INTS *ROWS,
INTS *COLS,
INTS root)
Distribute the graph on the processors, compress the columns array and use the built CSCd to call PaStiX.
INTS MURGE_SetOrdering(INTS id,
INTS *permutation)
INTS MURGE_AssemblyBegin(INTS id,
INTL coefnbr,
INTS op,
INTS op2,
INTS mode,
INTS sym)
Check that preprocessing has been performed, if not performs it.
INTS MURGE_AssemblySetValue (INTS id,
INTS ROW,
INTS COL,
COEF value)
INTS MURGE_AssemblySetNodeValues (INTS id,
INTS ROW,
INTS COL,
COEF *values)
INTS MURGE_AssemblySetBlockValues(INTS id,
INTS nROW,
INTS *ROWlist,
INTS nCOL,
INTS *COLlist,
COEF *values)
INTS MURGE_AssemblyEnd(INTS id)
We have on each proc a part of the matrix in two structure, one containing nodes to add to the CSCd the other containing simple values.
INTS MURGE_MatrixReset(INTS id)
INTS MURGE_MatrixGlobalCSR(INTS id,
INTS N,
INTL *rowptr,
INTS *COLS,
COEF *values,
INTS root,
INTS op,
INTS sym)
INTS MURGE_MatrixGlobalCSC(INTS id,
INTS N,
INTL *COLPTR,
INTS *ROWS,
COEF *values,
INTS root,
INTS op,
INTS sym)
Give a CSC on one processor to PaStiX.
INTS MURGE_MatrixGlobalIJV(INTS id,
INTS N,
INTL NNZ,
INTS *ROWS,
INTS *COLS,
COEF *values,
INTS root,
INTS op,
INTS sym)
Add the given global Compress Sparse Column matrix to the matrix.
INTS MURGE_SetGlobalRHS(INTS id,
COEF *b,
INTS root,
INTS op)
INTS MURGE_SetLocalRHS (INTS id,
COEF *b,
INTS op,
INTS op2)
INTS MURGE_SetRHS (INTS id,
INTS n,
INTS *coefsidx,
COEF *b,
INTS op,
INTS op2,
INTS mode)
INTS MURGE_RHSReset(INTS id)
INTS MURGE_GetGlobalSolution(INTS id,
COEF *x,
INTS root)
INTS MURGE_GetLocalSolution (INTS id,
COEF *x)
INTS MURGE_GetSolution (INTS id,
INTS n,
INTS *coefsidx,
COEF *x,
INTS mode)
INTS MURGE_Clean(INTS id)
INTS MURGE_Finalize()
INTS MURGE_GetInfoINT(INTS id,
INTS metric,
INTL *value)
INTS MURGE_GetInfoREAL(INTS id,
INTS metric,
REAL *value)
INTS MURGE_PrintError(INTS error_number)
Print the error message corresponding to ierror Parameters: error_number - Error identification number.
INTS MURGE_ExitOnError(INTS error_number)
Print the error message corresponding to ierror.
INTS MURGE_GetGlobalNorm(INTS id,
REAL *norm,
INTS root,
INTS rule)
Compute the global norm array following a norm rule.
INTS MURGE_GetLocalNorm(INTS id,
REAL *norm,
INTS rule)
Compute the local norm array following a norm rule.
INTS MURGE_GetNorm(INTS id,
INTS n,
INTS *coefsidx,
REAL *norm,
INTS rule,
INTS mode)
Compute the indicated part of the norm array following a norm rule.
INTS MURGE_ApplyGlobalScaling(INTS id,
REAL *scal,
INTS root,
INTS sc_mode)
Apply scaling to local unknowns.
INTS MURGE_ApplyLocalScaling(INTS id,
REAL *scal,
INTS sc_mode)
Apply the local scaling array on the matrix.
INTS MURGE_ApplyScaling(INTS id,
INTS n,
INTS *coefsidx,
REAL *scal,
INTS sc_mode,
INTS mode)
Apply the scaling array on the indicated part of the matrix
INTS MURGE_Analyze(INTS id)
INTS MURGE_Factorize(INTS id)
Perform matrix factorization.
INTS MURGE_ForceNoFacto(INTS id)
Prevent Murge from running factorisation even if matrix has changed.
INTS MURGE_ProductSetLocalNodeNbr (INTS id,
INTS n)
INTS MURGE_ProductSetLocalNodeList (INTS id,
INTS *l2g)
INTS MURGE_GetLocalProduct (INTS id,
COEF *x)
Perform the product A * X.
INTS thread_id
INTS ret
INTS MURGE_GetGlobalProduct (INTS id,
COEF *x,
INTS root)
Perform the product A * X.
INTS MURGE_SetLocalNodeList (INTS id,
INTS nodenbr,
INTS *nodelist)
Structure used to store datas for a step by step execution.
alias to structure murge_data_.
Computes preprocessing step, if not done, and the number of Unkowns in the new ditribution of the matrix.
enum MURGE_ASSEMBLY_OP
Operations possible when a coefficient appear twice.
enum MURGE_ASSEMBLY_MODE
Indicates if user can ensure that the information he is giving respects the solver distribution.
enum MURGE_NORM_RULES
Flags for Murge’s norm rules
Close