20 #include "order/order_internal.h"
21 #if defined(PASTIX_ORDERING_PTSCOTCH)
45 #if defined(PASTIX_DEBUG_ORDERING)
48 if ( SCOTCH_dgraphCheck( graph ) ) {
49 pastix_print_error(
"pastix: dgraphCheck" );
52 pastix_print( procnum, 0,
"SCOTCH_dgraphCheck done in %lf second\n", clockVal(timer) );
81 pastix_graph_t *graph,
93 colptr = graph->colptr;
94 rowptr = graph->rowptr;
95 baseval = graph->baseval;
98 assert( baseval == colptr[0] );
99 assert( nnz == colptr[n] - colptr[0] );
101 SCOTCH_dgraphInit( scotchgraph, comm );
108 if ( SCOTCH_dgraphBuild( scotchgraph,
122 pastix_print_error(
"pastix : SCOTCH_dgraphBuild\n" );
175 if ( weights != NULL ) {
176 memFree_null( weights );
205 SCOTCH_Dgraph *scotchgraph )
208 SCOTCH_Strat stratdat;
209 SCOTCH_Dordering ordedat;
210 SCOTCH_Ordering ordering;
213 SCOTCH_stratInit( &stratdat );
216 if ( SCOTCH_dgraphOrderInit(scotchgraph, &ordedat) )
218 pastix_print_error(
"pastix : SCOTCH_dgraphOrderInit\n");
222 if ( SCOTCH_dgraphOrderCompute( scotchgraph, &ordedat, &stratdat ) )
224 pastix_print_error(
"pastix : SCOTCH_dgraphOrderCompute" );
227 SCOTCH_stratExit( &stratdat );
230 if ( SCOTCH_dgraphCorderInit( scotchgraph,
232 (SCOTCH_Num *) ordemesh->
permtab,
233 (SCOTCH_Num *) ordemesh->
peritab,
234 (SCOTCH_Num *)&ordemesh->
cblknbr,
235 (SCOTCH_Num *) ordemesh->
rangtab,
236 (SCOTCH_Num *) ordemesh->
treetab) )
238 pastix_print_error(
"pastix : SCOTCH_dgraphCorderInit" );
242 if ( pastix_data->
procnum == 0 ) {
243 SCOTCH_dgraphOrderGather( scotchgraph, &ordedat, &ordering );
246 SCOTCH_dgraphOrderGather( scotchgraph, &ordedat, NULL );
251 int rangnbr, permnbr;
255 MPI_Bcast( ordemesh->
rangtab, rangnbr+1, PASTIX_MPI_INT, 0, pastix_data->
pastix_comm );
258 permnbr = pastix_data->
graph->gN;
264 SCOTCH_dgraphCorderExit( scotchgraph, &ordering );
265 SCOTCH_dgraphOrderExit( scotchgraph, &ordedat );
305 pastix_graph_t *graph )
307 SCOTCH_Dgraph scotchdgraph;
314 pastix_print_error(
"orderComputePTScotch: Inconsistent integer type between Pastix and PT-Scotch\n" );
319 #if defined(PASTIX_ORDERING_FIX_SEED)
320 SCOTCH_randomSeed( (SCOTCH_Num)(pastix_data->
id) );
321 SCOTCH_randomReset();
BEGIN_C_DECLS typedef int pastix_int_t
@ PASTIX_ERR_INTEGER_TYPE
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.
int pastixOrderAlloc(pastix_order_t *ordeptr, pastix_int_t vertnbr, pastix_int_t cblknbr)
Allocate the order structure.
static void ocpts_graph_init(SCOTCH_Dgraph *scotchgraph, pastix_graph_t *graph, PASTIX_Comm comm)
Build the PT-Scotch distributed graph.
static void ocpts_graph_exit(SCOTCH_Dgraph *scotchgraph, PASTIX_Comm comm)
Cleanup the PT-Scotch graph structure and free the associated data.
void order_scotch_reallocate_ordemesh(pastix_order_t *ordemesh)
Reallocate the ordering structure.
int orderComputePTScotch(pastix_data_t *pastix_data, pastix_graph_t *graph)
Compute the ordering of the graph given as parameter with PT-Scotch library.
static int ocpts_compute_graph_ordering(pastix_data_t *pastix_data, SCOTCH_Dgraph *scotchgraph)
Compute the graph ordering.
static void ocpts_graph_check(const SCOTCH_Dgraph *graph, int procnum)
Check the PT-Scotch distributed graph.
void pastixOrderExit(pastix_order_t *ordeptr)
Free the arrays initialized in the order structure.
pastix_order_t * ordemesh
Main PaStiX data structure.