Murge

Murge is close to the Merge.

Description

Murge is a common interface definition to multiple solver.

It has been initiated by HIPS and PaStiX solvers developpers in january 2009.

Integers

Depending of your compilation options, INTS and INTL can be 32 or 64 bits.

In C user will be abble to use INTS types.  In Fortran user will have to use the correct type, corresponding to the compilation options.

If user doesn’t define any compilation option, INTS and INTL will both be int.

If user defines -DINTSIZE32, INTS and INTL will both be 32 bits integers.

If user defines -DINTSIZE64, INTS will be 32 bits integers whereas INTL will be INT64 integers.

If user defines -DINTSSIZE64, both INTS and INTL will be 64 bit integers.

We recommand not to use -DINTSSIZE64, as INTS integers are supposed to keep being small integers, and there is no need to make them longs.

Coefficients

The coefficients of the matrices and vectors is of type COEF.

COEF can be simple or double precision and real or complex depending on compilation options.

If user defines nothing, COEF will be real simple precision.

If user defines -DPREC_DOUBLE, COEF will be double precision.

Defining nothing or -DPREC_SIMPLE will result in setting COEF precision to simple.

If user defines -DTYPE_COMPLEX, COEF will be complex, otherwise, if user defines nothing or -DTYPE_REAL it will be REAL.

Floating parameters

Floating parameters are of type REAL which can be simple or double precision.

As for Coefficients, REAL precision also depends on -DPREC_DOUBLE compilation option.

Defining nothing or -DPREC_SIMPLE will result in setting REAL precision to simple.

Nodes and Unknowns

In murge exists node and unknown, a node correspond to a node in the physical problem, which can be composed of multiple degrees of freedom.

Thus, the number of unknowns correspond to the number of node times the degree of freedom.

Authors

HIPS and PaStiX developpers teams :

Mathieu Favergefav.nosp@m.erge@labr.nosp@m.i.fr
Jérémie Gaidamourgaid.nosp@m.amou@labr.nosp@m.i.fr
Pascal Hénonhe.nosp@m.non@labr.nosp@m.i.fr
Xavier Lacostelac.nosp@m.oste@labr.nosp@m.i.fr
Pierre Rametra.nosp@m.met@labr.nosp@m.i.fr
Summary
MurgeMurge is close to the Merge.
Solver setup functions
MURGE_InitializeAllocate the instance arrays which will keeps intern data for all solver instances.
MURGE_SetDefaultOptionsSets default options, for solver instance number id.
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.
Graph setup function
MURGE_GraphBeginBegin building the adjency graph for renumbering and all preprocessing.
MURGE_GraphEdgeAdds an edge to the graph user is currently building.
MURGE_GraphEndEnd the graph building.
MURGE_GraphGlobalCSRBuild an adjency graph from a Compress Sparse Row matrix pattern.
MURGE_GraphGlobalCSCBuild an adjency graph from a Compress Sparse Column matrix pattern.
MURGE_GraphGlobalIJVBuild an adjency graph from a Compress Sparse Column matrix pattern.
IO functionsAllows to save and load solver state after preprocessing.
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 new 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_GetLocalUnknownNbrComputes preprocessing step, if not done, and the number of Unkowns in the new ditribution of the matrix.
MURGE_GetLocalUnknownListComputes the local unkown list, corresponding to the new distribution, after preprocessing.
Filling the matrix
MURGE_AssemblyBeginBegin Filling up sequence for the matrix, will allocate temporary structures used to build the matrix.
MURGE_AssemblySetValueSet a coefficient value in the matrix.
MURGE_AssemblySetNodeValuesSet coefficients value for a node in the matrix.
MURGE_AssemblySetBlockValuesSet coefficients value for a dens block in the matrix.
MURGE_AssemblyEndEnd Filling up sequence for the matrix.
MURGE_MatrixResetReset the matrix structure.
MURGE_MatrixGlobalCSRAdd the given global Compress Sparse Row matrix to the matrix.
MURGE_MatrixGlobalCSCAdd the given global Compress Sparse Column matrix to the matrix.
MURGE_MatrixGlobalIJVAdd the given global Compress Sparse Column matrix to the matrix.
Filling the right-hand-side member
MURGE_SetGlobalRHSSet the right-hand-side member in global mode.
MURGE_SetLocalRHSSet the right-hand-side member in local mode.
MURGE_SetRHSSet the right-hand-side member, giving the list of coefficient that we set.
MURGE_RHSResetReset the right-hand-side.
Getting the solution
MURGE_GetGlobalSolutionPerform Factorization and Solve, if needed, and then fill the global solution in x.
MURGE_GetLocalSolutionPerform Factorization and Solve, if needed, and then fill the local solution in x.
MURGE_GetSolutionPerform Factorization and Solve, if needed, and then fill the solution in x followin the given index list.
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
Cleaning up this mess
MURGE_CleanClean the given instance of the solver structure’s.
MURGE_FinalizeClean all not cleaned instances and instances ID array.
MURGE_GetSolverReturn the solver ID Murge was compiled with.
Getting Murge’s metrics
MURGE_GetMetricINTGet an integer metric from MURGE.
MURGE_GetInfoINT
MURGE_GetInfoREALGet a real metric value from MURGE.
MURGE_PrintErrorPrint the error message corresponding to ierror Parameters: error_number - Error identification number.
MURGE_ExitOnErrorPrint the error message corresponding to ierror.
Murge’s constants
MURGE_RETURNSMurge error return values.
MURGE_IPARAMMurge integer parameters identifiers.
MURGE_RPARAMMurge real parameters identifiers.
MURGE_IINFOMurge integer metrics identifiers.
MURGE_RINFOMurge real metrics identifiers.
MURGE_ASSEMBLY_MODEIndicates if user can ensure that the information he is giving respects the solver distribution.
MURGE_ASSEMBLY_OPOperations possible when a coefficient appear twice.
MURGE_SOLVERSolver ID for murge compliant solvers.
MURGE_BOOLEANBoolean for murge parameters
MURGE_NORM_RULESFlags for Murge’s norm rules
MURGE_SCAL_MODESFlags for Murge’s scaling rules

Solver setup functions

MURGE_Initialize

INTS MURGE_Initialize(INTS idnbr)

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 that the execution 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.

Fortran interface

SUBROUTINE MURGE_INITIALIZE(IDNBR, IERROR)
  INTS, INTENT(IN)  :: IDNBR
  INTS, INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_INITIALIZE

MURGE_SetDefaultOptions

INTS MURGE_SetDefaultOptions(INTS id,
INTS stratnum)

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.

Fortran interface

SUBROUTINE MURGE_SETDEFAULTOPTIONS(ID, STRATNUM, IERROR)
  INTS, INTENT(IN)  :: ID, STRATNUM
  INTS, INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_SETDEFAULTOPTIONS

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_SetDefaultOptions 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_SetDefaultOptions was not called before.
MURGE_ERR_PARAMETERIf id is not in solver arrays range or number or value are not valid.

Fortran interface

SUBROUTINE MURGE_SETOPTIONINT(ID, NUMBER, VALUE, IERROR)
  INTS, INTENT(IN)    :: ID, NUMBER, VALUE
  INTS, INTENT(OUT)   :: IERROR
END SUBROUTINE MURGE_SETOPTIONINT

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_SetDefaultOptions 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_SetDefaultOptions was not called before.
MURGE_ERR_PARAMETERIf id is not in solver arrays range or number or value are not valid.

Fortran interface

SUBROUTINE MURGE_SETOPTIONREAL(ID, NUMBER, VALUE, IERROR)
  INTS, INTENT(IN)    :: ID, NUMBER
  REAL, INTENT(IN)    :: VALUE
  INTS, INTENT(OUT)   :: IERROR
END SUBROUTINE MURGE_SETOPTIONREAL

MURGE_SetCommunicator

INTS MURGE_SetCommunicator(INTS id,
MPI_Comm mpicom)

Sets MPI communicator for the given solver instance.

Needs MURGE_SetDefaultOptions 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_SetDefaultOptions 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.

Fortran interface

SUBROUTINE MURGE_SETCOMMUNICATOR(ID, MPICOMM, IERROR)
  INTS,            INTENT(IN)  :: ID
  INTEGER,         INTENT(IN)  :: MPICOMM
  INTS,            INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_SETCOMMUNICATOR

Graph setup function

MURGE_GraphBegin

INTS MURGE_GraphBegin(INTS id,
INTS N,
INTL edgenbr)

Begin building the adjency graph for renumbering and all preprocessing.

Needs MURGE_SetDefaultOptions to be called before to initiate solver instance data.

Allocate temporary structures needed to build the graph.

Parameters

idSolver instance identification number.
NGlobal number of nodes in the graph.
edgenbrNumber of edges which will be added in the graph by proc.

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_ORDERIf MURGE_SetDefaultOptions was not called before.
MURGE_ERR_ALLOCATEIf Allocate didn’t worked.
MURGE_ERR_PARAMETERIf id is not in solver arrays range or N or edgenbr are not valid.

Fortran interface

SUBROUTINE MURGE_GRAPHBEGIN(ID, N, EDGENBR, IERROR)
  INTS,      INTENT(IN)  :: ID, N
  INTL,      INTENT(IN)  :: EDGENBR
  INTS,      INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_GRAPHBEGIN

MURGE_GraphEdge

INTS MURGE_GraphEdge(INTS id,
INTS COL,
INTS ROW)

Adds an edge to the graph user is currently building.

Needs MURGE_GraphBegin to be called before to initiate building sequence.

This function depends on integer parameter MURGE_BASEVAL.

Parameters

idSolver instance identification number.
ROWFirst vertex of the edge.
COLSecond vertex of the edge.

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_ORDERIf MURGE_GraphBegin was not called before.
MURGE_ERR_PARAMETERIf id is not in solver arrays range or I or J are not valid.

Fortran interface

SUBROUTINE MURGE_GRAPHEDGE(ID, ROW, COL, IERROR)
  INTS,      INTENT(IN)  :: ID, ROW, COL
  INTS,      INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_GRAPHEDGE

MURGE_GraphEnd

INTS MURGE_GraphEnd(INTS id)

End the graph building.

Needs MURGE_GraphBegin to be called before.

Parameters

idSolver instance identification number.

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_ORDERIf MURGE_GraphBegin was not called before or there are missing edges.
MURGE_ERR_PARAMETERIf id is not in solver arrays range.

Fortran interface

SUBROUTINE MURGE_GRAPHEND(ID, IERROR)
  INTS,      INTENT(IN)  :: ID
  INTS,      INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_GRAPHEND

MURGE_GraphGlobalCSR

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

Build an adjency graph from a Compress Sparse Row matrix pattern.

Needs MURGE_SetDefaultOptions to be called before.

This function depends on integer parameter MURGE_BASEVAL.

Parameters

idSolver instance identification number.
NGlobal number of columns
rowptrIndex of the first element of each row in COLS array.
COLSGlobal column numbers array.
rootRoot processor : this processor enter the global data (-1 for all processors).

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_ORDERIf MURGE_SetDefaultOptions was not called before.
MURGE_ERR_PARAMETERIf id is not in solver arrays range or CSR is not correct.

Fortran interface

SUBROUTINE MURGE_GRAPHGLOBALCSR(ID, N, ROWPTR, COLS, ROOT, IERROR)
  INTS, DIMENSION(0), INTENT(IN)  :: ID, N, ROOT
  INTL, DIMENSION(0), INTENT(IN)  :: ROWPTR
  INTS, DIMENSION(0), INTENT(IN)  :: COLS
  INTS, DIMENSION(0), INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_GRAPHGLOBALCSR

MURGE_GraphGlobalCSC

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

Build an adjency graph from a Compress Sparse Column matrix pattern.

Needs MURGE_SetDefaultOptions to be called before.

This function depends on integer parameter MURGE_BASEVAL.

Parameters

idSolver instance identification number.
NGlobal number of columns
COLPTRIndex of the first element of each column in ROWS array.
ROWSGlobal row number array.
rootRoot processor : this processor enter the global data (-1 for all processors).

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_ORDERIf MURGE_SetDefaultOptions was not called before.
MURGE_ERR_PARAMETERIf id is not in solver arrays range or CSC is not correct.

Fortran interface

SUBROUTINE MURGE_GRAPHGLOBALCSC(ID, N, COLPTR, ROWS, ROOT, IERROR)
  INTS,               INTENT(IN)  :: ID, N, ROOT
  INTL, DIMENSION(0), INTENT(IN)  :: COLPTR
  INTL, DIMENSION(0), INTENT(IN)  :: ROWS
  INTS,               INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_GRAPHGLOBALCSC

MURGE_GraphGlobalIJV

INTS MURGE_GraphGlobalIJV(INTS id,
INTS N,
INTL NNZ,
INTS *ROW,
INTS *COL,
INTS root)

Build an adjency graph from a Compress Sparse Column matrix pattern.

Needs MURGE_SetDefaultOptions to be called before.

This function depends on integer parameter MURGE_BASEVAL.

Parameters

idSolver instance identification number.
NGlobal number of unknowns.
NNZGlobal number of non zeros.
ROWGlobal column number array. edges.
COLGlobal row number array.
rootRoot processor : this processor enter the global data (-1 for all processors).

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_ORDERIf MURGE_SetDefaultOptions was not called before.
MURGE_ERR_PARAMETERIf id is not in solver arrays range or graph IJ is not correct.

Fortran interface

SUBROUTINE MURGE_GRAPHGLOBALIJV(ID, N, NNZ, ROW, COL, ROOT, IERROR)
  INTS,               INTENT(IN)  :: ID, N, ROOT
  INTL,               INTENT(IN)  :: NNZ
  INTS, DIMENSION(0), INTENT(IN)  :: ROW
  INTS, DIMENSION(0), INTENT(IN)  :: COL
  INTS,               INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_GRAPHGLOBALIJV
Summary
IO functionsAllows to save and load solver state after preprocessing.

IO functions

Allows to save and load solver state after preprocessing.

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 the graph to be built.

Parameters

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

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

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_ORDERIf graph hasn’t been built.
MURGE_ERR_PARAMETERIf id is not in solver arrays range.
MURGE_ERR_IOIf file(s) couldn’t be writen.

Fortran interface

SUBROUTINE MURGE_SAVE(ID, DIRECTORY, STR_LEN, IERROR)
  INTS,             INTENT(IN)  :: ID, STR_LEN
  CHARACTER(len=*), INTENT(IN)  :: DIRECTORY
  INTS,             INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_SAVE

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_SetDefaultOptions 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_SetDefaultOptions was not called before.
MURGE_ERR_PARAMETERIf id is not in solver arrays range.
MURGE_ERR_IOIf file(s) couldn’t be read.

Fortran interface

SUBROUTINE MURGE_LOAD(ID, DIRECTORY, STR_LEN, IERROR)
  INTS,             INTENT(IN)  :: ID, STR_LEN
  CHARACTER(len=*), INTENT(IN)  :: DIRECTORY
  INTS,             INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_LOAD

Getting new 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.

Needs the graph to be built.

Parameters

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

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_ORDERIf graph hasn’t been built.
MURGE_ERR_PARAMETERIf id is not in solver arrays range or nodenbr is NULL (can occur in C).

Fortran interface

SUBROUTINE MURGE_GETLOCALNODENBR(ID, NODENBR, IERROR)
  INTS, INTENT(IN)  :: ID
  INTS, INTENT(OUT) :: NODENBR
  INTS, INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_GETLOCALNODENBR

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).

Fortran interface

SUBROUTINE MURGE_GETLOCALNODELIST(ID, NODELIST, IERROR)
  INTS,               INTENT(IN)  :: ID
  ! Warning : 0 is not the size of the array.
  ! Writing DIMENSION(:) does not work with
  ! the C function call (fortran send the array size?)
  INTS, DIMENSION(0), INTENT(OUT) :: NODELIST
  INTS,               INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_GETLOCALNODELIST

MURGE_GetLocalUnknownNbr

INTS MURGE_GetLocalUnknownNbr(INTS id,
INTS *unkownnbr)

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

Needs the graph to be built.

Parameters

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

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_ORDERIf graph hasn’t been built.
MURGE_ERR_PARAMETERIf id is not in solver arrays range or unkownnbr is NULL (can occur in C).

Fortran interface

SUBROUTINE MURGE_GETLOCALUNKOWNNBR(ID, UNKOWNNBR, IERROR)
  INTS, INTENT(IN)  :: ID
  INTS, INTENT(OUT) :: UNKOWNNBR
  INTS, INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_GETLOCALUNKOWNNBR

MURGE_GetLocalUnknownList

INTS MURGE_GetLocalUnknownList(INTS id,
INTS *unkownlist)

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).

Fortran interface

SUBROUTINE MURGE_GETLOCALUNKOWNLIST(ID, UNKOWNLIST, IERROR)
  INTS,               INTENT(IN)  :: ID
  INTS, DIMENSION(0), INTENT(OUT) :: UNKOWNLIST
  INTS,               INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_GETLOCALUNKOWNLIST

Filling the matrix

MURGE_AssemblyBegin

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

Begin Filling up sequence for the matrix, will allocate temporary structures used to build the matrix.

It will perform preprocessing if it has not been done yet.

It needs graph to be built.

Several assembly sequences can be performed on the same matrix.

mode shouldn’t be MURGE_ASSEMBLY_RESPECT if neither MURGE_GetLocalNodeList nor MURGE_GetLocalUnknownList has been called.

Parameters

idSolver instance identification number.
coefnbrNumber of coeficients he will had.
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.

Fortran interface

SUBROUTINE MURGE_ASSEMBLYBEGIN(ID, COEFNBR, OP, OP2, MODE, SYM, IERROR)
  INTS,      INTENT(IN)  :: ID, OP, OP2, MODE, SYM
  INTL,      INTENT(IN)  :: COEFNBR
  INTS,      INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_ASSEMBLYBEGIN

MURGE_AssemblySetValue

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

Set a coefficient value in the matrix.

Needs MURGE_AssemblyBegin to be called before.

Parameters

idSolver instance identification number.
ROWGlobal row number of the coefficient.
COLGlobal column number of the coefficient.
valuevalue of the coefficient.

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_ORDERIf we are not in an assembly section.
MURGE_ERR_PARAMETERIf id is not in solver arrays range, or ROW or COL are not valid.

Fortran interface

SUBROUTINE MURGE_ASSEMBLYSETVALUE(ID, ROW, COL, VALUE, IERROR)
  INTS,      INTENT(IN)  :: ID, ROW, COL
  COEF,      INTENT(IN)  :: VALUE
  INTS,      INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_ASSEMBLYSETVALUE

MURGE_AssemblySetNodeValues

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

Set coefficients value for a node in the matrix.

Needs MURGE_AssemblyBegin to be called before.

Parameters

idSolver instance identification number.
ROWGlobal row number of the coefficient.
COLGlobal column number of the coefficient.
valuesvalue of the coefficient.

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_ORDERIf we are not in an assembly section.
MURGE_ERR_PARAMETERIf id is not in solver arrays range, or ROW or COL are not valid, or, in C, if values is NULL.

Fortran interface

SUBROUTINE MURGE_ASSEMBLYSETNODEVALUES(ID, ROW, COL, VALUES, IERROR)
  INTS,               INTENT(IN)  :: ID, ROW, COL
  COEF, DIMENSION(0), INTENT(IN)  :: VALUES
  INTS,               INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_ASSEMBLYSETNODEVALUES

MURGE_AssemblySetBlockValues

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

Set coefficients value for a dens block in the matrix.

Needs MURGE_AssemblyBegin to be called before.

Parameters

idSolver instance identification number.
nROWNumber of rows in the dense matrix.
ROWlistList of global row numbers.
nCOLNumber of columns in the dense matrix.
COLlistList of global column numbers.
valuesValues array, by column (Fortran style)

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_ORDERIf we are not in an assembly section.
MURGE_ERR_PARAMETERIf id is not in solver arrays range, or nI or nJ are not valid, or, in C, if Ilist, Jlist or values is NULL.

Fortran interface

SUBROUTINE MURGE_ASSEMBLYSETBLOCKVALUES(ID, NROW, ROWLIST, &
                                & NCOL, COLLIST, VALUES, IERROR)
  INTS,               INTENT(IN)  :: ID, NROW, NCOL
  INTS, DIMENSION(0), INTENT(IN)  :: ROWLIST
  INTL, DIMENSION(0), INTENT(IN)  :: COLLIST
  COEF, DIMENSION(0), INTENT(IN)  :: VALUES
  INTS,               INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_ASSEMBLYSETBLOCKVALUES

MURGE_AssemblyEnd

INTS MURGE_AssemblyEnd(INTS id)

End Filling up sequence for the matrix.

Needs MURGE_AssemblyBegin to be called before.

Parameters

idSolver instance identification number.

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_ORDERIf we are not in an assembly section.
MURGE_ERR_PARAMETERIf id is not in solver arrays range.

Fortran interface

SUBROUTINE MURGE_ASSEMBLYEND(ID, IERROR)
  INTS,      INTENT(IN)  :: ID
  INTS,      INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_ASSEMBLYEND

MURGE_MatrixReset

INTS MURGE_MatrixReset(INTS id)

Reset the matrix structure.

Parameters

idSolver instance identification number.

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_PARAMETERIf id is not in solver arrays range.

Fortran interface

SUBROUTINE MURGE_MATRIXRESET(ID, IERROR)
  INTS,      INTENT(IN)  :: ID
  INTS,      INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_MATRIXRESET

MURGE_MatrixGlobalCSR

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

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

Parameters

idSolver instance identification number.
NNumber of columns.
rowptrIndex of the first element of each row in COLS and values array.
COLSColumn 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 or the CSR are not valid.

Fortran interface

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

MURGE_MatrixGlobalCSC

INTS MURGE_MatrixGlobalCSC(INTS id,
INTS N,
INTL *COLPTR,
INTS *ROWS,
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 columns.
colptrIndex of the first element of each column in ROWS and values array.
ROWSRow 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 or the CSC are not valid.

Fortran interface

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

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)

Set the right-hand-side member in global mode.

Parameters

idSolver instance identification number.
bArray of size global column number which correspond to the right-hand-side member.
opOperation to perform if a coefficient appear twice (see MURGE_ASSEMBLY_OP).
rootIndicates which processor has the right-hand-side member, -1 for all.

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_PARAMETERIf id is not in solver arrays range.

Fortran interface

SUBROUTINE MURGE_SETGLOBALRHS(ID, B, OP, ROOT, IERROR)
  INTS,               INTENT(IN)  :: ID, OP, ROOT
  COEF, DIMENSION(0), INTENT(IN)  :: B
  INTS,               INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_SETGLOBALRHS

MURGE_SetLocalRHS

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

Set the right-hand-side member in local mode.

Parameters

idSolver instance identification number.
bArray of size local column number which correspond to the right-hand-side member.
opOperation to perform if a coefficient appear twice (see MURGE_ASSEMBLY_OP).
op2Operation to perform when a coefficient is set by two different processors (see MURGE_ASSEMBLY_OP).

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_PARAMETERIf id is not in solver arrays range.

Fortran interface

SUBROUTINE MURGE_SETLOCALRHS(ID, B, OP, OP2, IERROR)
  INTS,               INTENT(IN)  :: ID, OP, OP2
  COEF, DIMENSION(0), INTENT(IN)  :: B
  INTS,               INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_SETLOCALRHS

MURGE_SetRHS

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

Set the right-hand-side member, giving the list of coefficient that we set.

mode shouldn’t be MURGE_ASSEMBLY_RESPECT if neither MURGE_GetLocalNodeList nor MURGE_GetLocalUnknownList has been called.

Parameters

idSolver instance identification number.
nNumber of coefficients to set.
coefsidxList of global index of the coefficients to set.
BArray of coefficients values.
opOperation to perform if a coefficient appear twice (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).

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_PARAMETERIf id is not in solver arrays range or if mode or op are not valid, or, in C, if coeflist or b are NULL.

Fortran interface

SUBROUTINE MURGE_SETRHS(ID, N, COEFSIDX, B, OP, OP2, MODE, IERROR)
  INTS,               INTENT(IN)  :: ID, N, OP, OP2, MODE
  INTS, DIMENSION(0), INTENT(IN)  :: COEFSIDX
  COEF, DIMENSION(0), INTENT(IN)  :: B
  INTS,               INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_SETRHS

MURGE_RHSReset

INTS MURGE_RHSReset(INTS id)

Reset the right-hand-side.

Parameters

idSolver instance identification number.

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_PARAMETERIf id is not in solver arrays range.

Fortran interface

SUBROUTINE MURGE_RHSRESET(ID, IERROR)
  INTS,      INTENT(IN)  :: ID
  INTS,      INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_RHSRESET

Getting the solution

MURGE_GetGlobalSolution

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

Perform Factorization and Solve, if needed, and then fill the global solution in x.

Parameters

idSolver instance identification number.
xArray of size global column number*dof which will contain the solution
rootIndicates which processor will have the solution at the end of the call, -1 for all.

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_PARAMETERIf id is not in solver arrays range.

Fortran interface

SUBROUTINE MURGE_GETGLOBALSOLUTION(ID, X, ROOT, IERROR)
  INTS,               INTENT(IN)  :: ID, ROOT
  COEF, DIMENSION(0), INTENT(OUT) :: X
  INTS,               INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_GETGLOBALSOLUTION

MURGE_GetLocalSolution

INTS MURGE_GetLocalSolution(INTS id,
COEF *x)

Perform Factorization and Solve, if needed, and then fill the local solution in x.

Parameters

idSolver instance identification number.
xArray of size local column number*dof which will contain the solution

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_PARAMETERIf id is not in solver arrays range.

Fortran interface

SUBROUTINE MURGE_GETLOCALSOLUTION(ID, X, IERROR)
  INTS,               INTENT(IN)  :: ID
  COEF, DIMENSION(0), INTENT(OUT) :: X
  INTS,               INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_GETLOCALSOLUTION

MURGE_GetSolution

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

Perform Factorization and Solve, if needed, and then fill the solution in x followin the given index list.

Parameters

idSolver instance identification number.
nNumber of coefficients user wants to get.
coefsidxList of the coefficients user wants to get.
xArray of size dof*n which will contain the solution.
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.

Fortran interface

SUBROUTINE MURGE_GETSOLUTION(ID, N, COEFSIDX, X, MODE, IERROR)
  INTS,               INTENT(IN)  :: ID, MODE, N
  INTS, DIMENSION(0), INTENT(IN)  :: COEFSIDX
  COEF, DIMENSION(0), INTENT(OUT) :: X
  INTS,               INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_GETSOLUTION
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.
rootIndicates which processor that posses the scaling array, -1 for all.
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_APPLYGLOBALSCALING(ID, SCAL, ROOT, SC_MODE, 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

Cleaning up this mess

MURGE_Clean

INTS MURGE_Clean(INTS id)

Clean the given instance of the solver structure’s.

Parameters

idSolver instance identification number.

Returns

MURGE_SUCCESSIf function runned successfully.
MURGE_ERR_PARAMETERIf id is not in solver arrays range.

Fortran interface

SUBROUTINE MURGE_CLEAN(ID, IERROR)
  INTS, INTENT(IN)  :: ID
  INTS, INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_CLEAN

MURGE_Finalize

INTS MURGE_Finalize()

Clean all not cleaned instances and instances ID array.

Returns

MURGE_SUCCESSIf function runned successfully.

Fortran interface

SUBROUTINE MURGE_FINALIZE(IERROR)
  INTS, INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_FINALIZE

MURGE_GetSolver

INTS MURGE_GetSolver(INTS *solver)

Return the solver ID Murge was compiled with.

Parameters

solverInteger to store solver ID.

Returns

MURGE_SUCCESSIf execution ended normaly.

Fortran interface

SUBROUTINE MURGE_GETSOLVER(SOLVER, IERROR)
  INTS,  INTENT(OUT) :: SOLVER
  INTS,  INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_GETSOLVER

Getting Murge’s metrics

MURGE_GetMetricINT

Get an integer metric from MURGE.

See MURGE_IINFOS and the solver documentation to get available metric list.

Parameters

idSolver instance identification number.
metricWanted metric identification number.
valueInteger which will contain the value of the metric.

Returns

MURGE_SUCCESSIf execution ended normaly.
MURGE_ERR_ORDERIf metric is not available in the current solver state.
MURGE_ERR_PARAMETERIf id is not in solver arrays range or metric or value are not valid.

Fortran interface

SUBROUTINE MURGE_GETINFOINT(ID, INFO, VALUE, IERROR)
 INTS, INTENT(IN)  :: ID, INFO
 INTL, INTENT(OUT) :: VALUE
 INTS, INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_GETINFOINT

MURGE_GetInfoINT

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

MURGE_GetInfoREAL

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

Get a real metric value from MURGE.

See MURGE_RINFOS and the solver documentation to get available metric list.

Parameters

idSolver instance identification number.
metricWanted metric identification number.
valueReal which will contain the value of the metric.

Returns

MURGE_SUCCESSIf execution ended normaly.
MURGE_ERR_ORDERIf metric is not available in the current solver state.
MURGE_ERR_PARAMETERIf id is not in solver arrays range or metric or value are not valid.

Fortran interface

SUBROUTINE MURGE_GETINFOREAL(ID, INFO, VALUE, IERROR)
 INTS, INTENT(IN)  :: ID, INFO
 REAL, INTENT(OUT) :: VALUE
 INTS, INTENT(OUT) :: IERROR
END SUBROUTINE MURGE_GETINFOREAL

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
Murge’s constants
MURGE_RETURNSMurge error return values.
MURGE_IPARAMMurge integer parameters identifiers.
MURGE_RPARAMMurge real parameters identifiers.
MURGE_IINFOMurge integer metrics identifiers.
MURGE_RINFOMurge real metrics identifiers.
MURGE_ASSEMBLY_MODEIndicates if user can ensure that the information he is giving respects the solver distribution.
MURGE_ASSEMBLY_OPOperations possible when a coefficient appear twice.
MURGE_SOLVERSolver ID for murge compliant solvers.
MURGE_BOOLEANBoolean for murge parameters
MURGE_NORM_RULESFlags for Murge’s norm rules
MURGE_SCAL_MODESFlags for Murge’s scaling rules

Murge’s constants

MURGE_RETURNS

enum MURGE_RETURNS

Murge error return values.

Contains

MURGE_SUCCESSIf function runs correctly.
MURGE_ERR_ALLOCATEIf couldn’t allocate.
MURGE_ERR_IOIf there was an input or output error.
MURGE_ERR_PARAMETERIf one parameter is not correct.
MURGE_ERR_ORDERIf function were run in wrong order.
MURGE_ERR_SOLVERInternal solver error.
MURGE_ERR_NOT_IMPLEMENTEDNot yet implemented.

MURGE_IPARAM

enum MURGE_IPARAM

Murge integer parameters identifiers.

Solvers may implement is own list of parameters.

MURGE_IPARAM_BASEVALNumbering style , 0 for C, 1 for fortran.
MURGE_IPARAM_DOFNumber of degrees of freedom.

MURGE_RPARAM

enum MURGE_RPARAM

Murge real parameters identifiers.

Solvers may implement is own list of parameters.

Contains

MURGE_RPARAM_EPSILON_ERRORWanted norm error at the end of solve.

MURGE_IINFO

enum MURGE_IINFO

Murge integer metrics identifiers.

Solvers may implement is own list of parameters.

Contains

MURGE_IINFOS_NNZNumber of non zeros in factorized matrix.

MURGE_RINFO

enum MURGE_RINFO

Murge real metrics identifiers.

Solvers may implement is own list of parameters.

Contains

MURGE_RINFO_FACT_TIMEFactorization time.
MURGE_RINFO_SOLVE_TIMESolving time.

MURGE_ASSEMBLY_MODE

enum MURGE_ASSEMBLY_MODE

Indicates if user can ensure that the information he is giving respects the solver distribution.

MURGE_ASSEMBLY_RESPECTUser ensure he respects distribution during assembly.  See solver documentation.
MURGE_ASSEMBLY_FOOLUser is not sure he will respect ditribution during assembly

MURGE_ASSEMBLY_OP

enum MURGE_ASSEMBLY_OP

Operations possible when a coefficient appear twice.

MURGE_ASSEMBLY_ADDCoefficients will be added during assembly.
MURGE_ASSEMBLY_OVWCoefficients will be overwriten during assembly.
MURGE_ASSEMBLY_MAXMaximum value will be used for assembly.
MURGE_ASSEMBLY_MINMinimum value will be used for assembly.

MURGE_SOLVER

enum MURGE_SOLVER

Solver ID for murge compliant solvers.

Contains

MURGE_SOLVER_HIPSHIPS hybrid solver.
MURGE_SOLVER_PASTIXPaStiX direct solver.

MURGE_BOOLEAN

enum MURGE_BOOLEAN

Boolean for murge parameters

Contains

MURGE_BOOLEAN_FALSEFalse value
MURGE_BOOLEAN_TRUETrue value

MURGE_NORM_RULES

enum MURGE_NORM_RULES

Flags for Murge’s norm rules

Contains

MURGE_NORM_MAX_COLGet maximum column value (absolute value).
MURGE_NORM_MAX_ROWGet maximum row value (absolute value).
MURGE_NORM_2_COLGet the norm 2 of columns.
MURGE_NORM_2_ROWGet the norm 2 of rows.

MURGE_SCAL_MODES

enum MURGE_SCAL_MODES

Flags for Murge’s scaling rules

Contains

MURGE_SCAL_COLPerform scaling on columns
MURGE_SCAL_ROWPerform scaling on rows.
INTS MURGE_Initialize(INTS idnbr)
Allocate the instance arrays which will keeps intern data for all solver instances.
INTS MURGE_SetDefaultOptions(INTS id,
INTS stratnum)
Sets default options, for solver instance number id.
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 mpicom)
Sets MPI communicator for the given solver instance.
INTS MURGE_GraphBegin(INTS id,
INTS N,
INTL edgenbr)
Begin building the adjency graph for renumbering and all preprocessing.
INTS MURGE_GraphEdge(INTS id,
INTS COL,
INTS ROW)
Adds an edge to the graph user is currently building.
INTS MURGE_GraphEnd(INTS id)
End the graph building.
INTS MURGE_GraphGlobalCSR(INTS id,
INTS N,
INTL *rowptr,
INTS *COLS,
INTS root)
Build an adjency graph from a Compress Sparse Row matrix pattern.
INTS MURGE_GraphGlobalCSC(INTS id,
INTS N,
INTL *colptr,
INTS *ROWS,
INTS root)
Build an adjency graph from a Compress Sparse Column matrix pattern.
INTS MURGE_GraphGlobalIJV(INTS id,
INTS N,
INTL NNZ,
INTS *ROW,
INTS *COL,
INTS root)
Build an adjency graph from a Compress Sparse Column matrix pattern.
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)
Computes preprocessing step, if not done, and the number of Unkowns in the new ditribution of the matrix.
INTS MURGE_GetLocalUnknownList(INTS id,
INTS *unkownlist)
Computes the local unkown list, corresponding to the new distribution, after preprocessing.
INTS MURGE_AssemblyBegin(INTS id,
INTL coefnbr,
INTS op,
INTS op2,
INTS mode,
INTS sym)
Begin Filling up sequence for the matrix, will allocate temporary structures used to build the matrix.
INTS MURGE_AssemblySetValue(INTS id,
INTS ROW,
INTS COL,
COEF value)
Set a coefficient value in the matrix.
INTS MURGE_AssemblySetNodeValues(INTS id,
INTS ROW,
INTS COL,
COEF *values)
Set coefficients value for a node in the matrix.
INTS MURGE_AssemblySetBlockValues(INTS id,
INTS nROW,
INTS *ROWlist,
INTS nCOL,
INTS *COLlist,
COEF *values)
Set coefficients value for a dens block in the matrix.
INTS MURGE_AssemblyEnd(INTS id)
End Filling up sequence for the matrix.
INTS MURGE_MatrixReset(INTS id)
Reset the matrix structure.
INTS MURGE_MatrixGlobalCSR(INTS id,
INTS N,
INTL *rowptr,
INTS *COLS,
COEF *values,
INTS root,
INTS op,
INTS sym)
Add the given global Compress Sparse Row matrix to the matrix.
INTS MURGE_MatrixGlobalCSC(INTS id,
INTS N,
INTL *COLPTR,
INTS *ROWS,
COEF *values,
INTS root,
INTS op,
INTS sym)
Add the given global Compress Sparse Column matrix to the matrix.
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)
Set the right-hand-side member in global mode.
INTS MURGE_SetLocalRHS(INTS id,
COEF *b,
INTS op,
INTS op2)
Set the right-hand-side member in local mode.
INTS MURGE_SetRHS(INTS id,
INTS n,
INTS *coefsidx,
COEF *b,
INTS op,
INTS op2,
INTS mode)
Set the right-hand-side member, giving the list of coefficient that we set.
INTS MURGE_RHSReset(INTS id)
Reset the right-hand-side.
INTS MURGE_GetGlobalSolution(INTS id,
COEF *x,
INTS root)
Perform Factorization and Solve, if needed, and then fill the global solution in x.
INTS MURGE_GetLocalSolution(INTS id,
COEF *x)
Perform Factorization and Solve, if needed, and then fill the local solution in x.
INTS MURGE_GetSolution(INTS id,
INTS n,
INTS *coefsidx,
COEF *x,
INTS mode)
Perform Factorization and Solve, if needed, and then fill the solution in x followin the given index list.
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_Clean(INTS id)
Clean the given instance of the solver structure’s.
INTS MURGE_Finalize()
Clean all not cleaned instances and instances ID array.
INTS MURGE_GetSolver(INTS *solver)
Return the solver ID Murge was compiled with.
INTS MURGE_GetInfoINT(INTS id,
INTS metric,
INTL *value)
INTS MURGE_GetInfoREAL(INTS id,
INTS metric,
REAL *value)
Get a real metric value from MURGE.
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.
enum MURGE_RETURNS
Murge error return values.
enum MURGE_IPARAM
Murge integer parameters identifiers.
enum MURGE_RPARAM
Murge real parameters identifiers.
enum MURGE_IINFO
Murge integer metrics identifiers.
enum MURGE_RINFO
Murge real metrics identifiers.
enum MURGE_ASSEMBLY_MODE
Indicates if user can ensure that the information he is giving respects the solver distribution.
enum MURGE_ASSEMBLY_OP
Operations possible when a coefficient appear twice.
enum MURGE_SOLVER
Solver ID for murge compliant solvers.
enum MURGE_BOOLEAN
Boolean for murge parameters
enum MURGE_NORM_RULES
Flags for Murge’s norm rules
enum MURGE_SCAL_MODES
Flags for Murge’s scaling rules
Computes preprocessing step, if not done, and the number of Unkowns in the new ditribution of the matrix.
Close