17 #ifndef DOXYGEN_SHOULD_SKIP_THIS
21 #include "order_internal.h"
59 pastix_graph_t *graph = pastix_data->
graph;
65 assert( graph != NULL );
66 assert( order != NULL );
67 assert( order->
sndetab != NULL );
70 iend = order->
sndetab[sndeidx+1];
80 if ( dump & orderDrawGraph ) {
81 SCOTCH_Graph sn_sgraph;
82 pastix_graph_t sn_pgraph;
95 sn_colptr = sn_pgraph.colptr;
96 sn_rows = sn_pgraph.rowptr;
98 if ( !SCOTCH_graphInit(&sn_sgraph) )
100 SCOTCH_graphBuild( &sn_sgraph,
107 sn_colptr[ size ] - order->
baseval,
113 fprintf( stderr,
"Failed to build graph\n" );
117 rc = asprintf( &fname,
"part.%ld.grf", (
long)sndeidx);
121 SCOTCH_graphSave( &sn_sgraph, file );
125 fprintf(stderr,
"Check: %d\n", SCOTCH_graphCheck( &sn_sgraph ));
133 if ( dump & orderDrawCoordinates )
138 filein = fopen(
"before.xyz",
"r" );
139 if ( filein == NULL ) {
140 fprintf( stderr,
"Please give before.xyz file\n" );
145 rc = fscanf( filein,
"%ld %ld", &dim, &n );
147 fprintf(stderr,
"Cannot proceed part.xyz and part.map files: invalid number of vertices in before.xyz\n");
152 rc = asprintf( &fname,
"part.%ld.xyz", (
long)sndeidx);
157 fprintf( file,
"%ld %ld\n", (
long)dim, (
long)size );
158 for(i=0; i<order->
vertnbr; i++) {
162 rc = fscanf(filein,
"%ld %lf %lf %lf", &v, &x, &y, &z );
167 if ( (iv >= ibeg) && (iv < iend) ) {
168 fprintf( file,
"%ld %lf %lf %lf\n",
169 (
long)(iv - ibeg), x, y, z );
180 if ( dump & orderDrawMapping )
185 rc = asprintf( &fname,
"part.%ld.%s.map",
186 (
long)sndeidx, extname );
189 rc = asprintf( &fname,
"part.%ld.map",
196 fprintf( file,
"%ld\n", (
long)size );
205 while ( (i > 0) && (order->
rangtab[i] > iend) ) {
214 if ( fnode < ibeg ) {
215 assert( lnode <= ibeg );
219 for (j=fnode; j<lnode; j++) {
220 fprintf( file,
"%ld %ld\n",
221 (
long)(j - ibeg), (
long)color );
BEGIN_C_DECLS typedef int pastix_int_t
FILE * pastix_fopenw(const char *dirname, const char *filename, const char *mode)
Open a file in the unique directory of the pastix instance.
void pastix_gendirectories(pastix_data_t *pastix_data)
Generate a unique temporary directory to store output files.
int graphIsolateRange(const pastix_graph_t *graphIn, const pastix_order_t *order, pastix_graph_t *graphOut, pastix_int_t fnode, pastix_int_t lnode, pastix_int_t distance)
Isolate the subgraph associated to a range of unknowns in the permuted graph.
void orderDraw(pastix_data_t *pastix_data, const char *extname, pastix_int_t sndeidx, int dump)
Dump the last separator into an ivview file.
pastix_order_t * ordemesh
Main PaStiX data structure.