24 #ifndef DOXYGEN_SHOULD_SKIP_THIS
25 #define assert_graph( _graph_ ) \
27 assert( (_graph_)->fmttype == SpmCSC ); \
28 assert( (_graph_)->flttype == SpmPattern ); \
29 assert( (_graph_)->values == NULL ); \
51 spmInitDist( graph, comm );
53 graph->flttype = SpmPattern;
76 if ( graph == NULL ) {
77 pastix_print_error(
"graphExit: graph pointer is NULL" );
80 assert_graph( graph );
106 if ( graph == NULL ) {
107 pastix_print_error(
"graphBase: graph pointer is NULL" );
110 if ( (baseval != 0) &&
113 pastix_print_error(
"graphBase: baseval is incorrect, must be 0 or 1" );
117 assert_graph( graph );
119 spmBase( graph, baseval );
152 const pastix_graph_t *graphsrc )
155 if ( graphdst == NULL ) {
158 if ( graphsrc == NULL ) {
161 if ( graphsrc == graphdst ) {
164 assert_graph( graphsrc );
167 spmCopy( graphsrc, graphdst );
197 pastix_graph_t newgraph;
200 assert_graph( graph );
201 if ( graph->loc2glob != NULL ) {
206 rc = spmScatter( &newgraph, -1, graph, -1, NULL, 1, comm );
208 if ( rc == SPM_SUCCESS ) {
210 memcpy( graph, &newgraph,
sizeof( pastix_graph_t ) );
212 assert_graph( graph );
241 pastix_graph_t newgraph;
244 assert_graph( graph );
245 if ( graph->loc2glob == NULL ) {
249 rc = spmGather( graph, -1, &newgraph );
251 if ( rc == SPM_SUCCESS ) {
253 memcpy( graph, &newgraph,
sizeof( pastix_graph_t ) );
255 assert_graph( graph );
284 assert_graph( graph );
310 if ( graph == NULL ) {
313 assert_graph( graph );
315 spmSymmetrize( graph );
341 if ( graph == NULL ) {
344 assert_graph( graph );
346 spmUpdateComputedFields( graph );
380 const spmatrix_t *spm )
385 if ( graph == NULL ) {
399 memcpy( &spmtmp, spm,
sizeof(pastix_graph_t) );
402 spmtmp.flttype = SpmPattern;
403 spmtmp.values = NULL;
406 spmCopy( &spmtmp, graph );
409 spmConvert( SpmCSC, graph );
438 if ( graph->dof == 1 ) {
447 if ( graph->dof > 1 ) {
448 for ( i=0; i<n; i++, wptr++ ) {
455 if ( graph->loc2glob == NULL ) {
456 for ( i=0; i<n; i++, wptr++, dofptr++ ) {
457 *wptr = dofptr[1] - dofptr[0];
464 for ( i=0; i<n; i++, wptr++, loc2glob++ ) {
465 *wptr = dofptr[ *loc2glob + 1 ] - dofptr[ *loc2glob ];
BEGIN_C_DECLS typedef int pastix_int_t
@ PASTIX_ERR_BADPARAMETER
int graphUpdateComputedFields(pastix_graph_t *graph)
Update dofs, nnz, nnzexp, gnnz, n, nexp, gN of a given graph.
void graphExit(pastix_graph_t *graph)
Free the content of the graph structure.
int graphScatterInPlace(pastix_graph_t *graph, PASTIX_Comm comm)
This routine scatter a graph from node root to the other nodes.
int graphCopy(pastix_graph_t *graphdst, const pastix_graph_t *graphsrc)
This routine copy a given ordering in a new one.
int graphSpm2Graph(pastix_graph_t *graph, const spmatrix_t *spm)
This routine build a graph thanks to an spm;.
int graphSymmetrize(pastix_graph_t *graph)
Symmetrize a given graph.
void graphInitEmpty(pastix_graph_t *graph, PASTIX_Comm comm)
Initialize an empty graph.
int graphGatherInPlace(pastix_graph_t *graph)
This routine gather a distributed graph on each node in place.
void graphBase(pastix_graph_t *graph, pastix_int_t baseval)
Rebase the graph to the given value.
pastix_int_t * graphGetWeights(const pastix_graph_t *graph)
Build the vertex weight array out of the dof array.
void graphSort(pastix_graph_t *graph)
This routine sortes the subarray of edges of each vertex.