10 #ifdef HECMW_WITH_METIS
19 int *num_graph1,
int *num_graph2,
int *num_separator) {
20 #ifdef HECMW_WITH_METIS
22 int num_of_row, num_of_col, num_of_nzero;
28 num_of_nzero = *nttbr;
33 fprintf(stderr,
"Start transforming matrix to graph\n");
34 matrix2graph(num_of_row, num_of_col, num_of_nzero, irow, jcol, graph);
37 "---------------------------------------------------\n");
38 fprintf(stderr,
"#Vertices: %d, #Edges: %d\n\n", graph->
nvtxs,
40 perm = (
int *)calloc(num_of_col,
sizeof(
int));
41 iperm = (
int *)calloc(num_of_col,
sizeof(
int));
42 if ((perm ==
NULL) || (iperm ==
NULL))
45 #if defined(METIS_VER_MAJOR) && (METIS_VER_MAJOR == 5)
51 idx_t *xadj_metis, *adjncy_metis, *perm_metis, *iperm_metis;
54 xadj_metis = (
idx_t *)calloc(num_of_col + 1,
sizeof(
idx_t));
56 perm_metis = (
idx_t *)calloc(num_of_col,
sizeof(
idx_t));
57 iperm_metis = (
idx_t *)calloc(num_of_col,
sizeof(
idx_t));
58 if ((xadj_metis ==
NULL) || (adjncy_metis ==
NULL) ||
59 (perm_metis ==
NULL) || (iperm_metis ==
NULL))
62 for (i = 0; i <= num_of_col; i++) xadj_metis[i] = graph->
xadj[i];
63 for (i = 0; i < graph->
nedges; i++) adjncy_metis[i] = graph->
adjncy[i];
65 METIS_SetDefaultOptions(
options);
66 options[METIS_OPTION_COMPRESS] = 0;
67 METIS_NodeND(&nvtxs_metis, xadj_metis, adjncy_metis,
NULL,
options,
68 perm_metis, iperm_metis);
70 for (i = 0; i < num_of_col; i++) {
71 perm[i] = (int)perm_metis[i];
72 iperm[i] = (int)iperm_metis[i];
114 "Error: Direct Parallel Solver not available. Please install Metis.\n");
122 int *num_graph1,
int *num_graph2,
int *num_separator) {
128 int *num_graph1,
int *num_graph2,
int *num_separator) {
134 int *num_graph1,
int *num_graph2,
int *num_separator) {
HECMW_Comm HECMW_comm_get_comm(void)
void HECMW_abort(HECMW_Comm comm)
struct option_rec options[]
specify command line option name and executing function name.
void matrix2graph(int num_of_row, int num_of_col, int num_of_nzero, int *irow, int *jcol, graph_type *graph)
Separator_result * separator
void bi_part_directive__(int *neqns, int *nttbr, int *irow, int *jcol, int *num_graph1, int *num_graph2, int *num_separator)
void bi_part_directive(int *neqns, int *nttbr, int *irow, int *jcol, int *num_graph1, int *num_graph2, int *num_separator)
void bi_part_directive_(int *neqns, int *nttbr, int *irow, int *jcol, int *num_graph1, int *num_graph2, int *num_separator)
void BI_PART_DIRECTIVE(int *neqns, int *nttbr, int *irow, int *jcol, int *num_graph1, int *num_graph2, int *num_separator)
void separator_memory_exit(char *var)