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;
92 memset( &sn_pgraph, 0,
sizeof(pastix_graph_t) );
96 fprintf( stderr,
"Failed to isolate graph\n" );
100 sn_colptr = sn_pgraph.colptr;
101 sn_rows = sn_pgraph.rowptr;
103 if ( !SCOTCH_graphInit(&sn_sgraph) )
105 SCOTCH_graphBuild( &sn_sgraph,
112 sn_colptr[ size ] - order->
baseval,
118 fprintf( stderr,
"Failed to build graph\n" );
123 rc = asprintf( &fname,
"part.%ld.grf", (
long)sndeidx);
127 SCOTCH_graphSave( &sn_sgraph, file );
131 fprintf(stderr,
"Check: %d\n", SCOTCH_graphCheck( &sn_sgraph ));
132 SCOTCH_graphExit( &sn_sgraph );
139 if ( dump & orderDrawCoordinates )
144 filein = fopen(
"before.xyz",
"r" );
145 if ( filein == NULL ) {
146 fprintf( stderr,
"Please give before.xyz file\n" );
151 rc = fscanf( filein,
"%ld %ld", &dim, &n );
153 fprintf(stderr,
"Cannot proceed part.xyz and part.map files: invalid number of vertices in before.xyz\n");
158 rc = asprintf( &fname,
"part.%ld.xyz", (
long)sndeidx);
163 fprintf( file,
"%ld %ld\n", (
long)dim, (
long)size );
164 for(i=0; i<order->
vertnbr; i++) {
168 rc = fscanf(filein,
"%ld %lf %lf %lf", &v, &x, &y, &z );
173 if ( (iv >= ibeg) && (iv < iend) ) {
174 fprintf( file,
"%ld %lf %lf %lf\n",
175 (
long)(iv - ibeg), x, y, z );
186 if ( dump & orderDrawMapping )
191 rc = asprintf( &fname,
"part.%ld.%s.map",
192 (
long)sndeidx, extname );
195 rc = asprintf( &fname,
"part.%ld.map",
202 fprintf( file,
"%ld\n", (
long)size );
211 while ( (i > 0) && (order->
rangtab[i] > iend) ) {
220 if ( fnode < ibeg ) {
221 assert( lnode <= ibeg );
225 for (j=fnode; j<lnode; j++) {
226 fprintf( file,
"%ld %ld\n",
227 (
long)(j - ibeg), (
long)color );
FILE * pastix_fopenw(const char *dirname, const char *filename, const char *mode)
Open a file in the unique directory of the pastix instance.
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.