22 #ifdef _HAVE_CHACO_ //only works if Chaco library has been compiled in.
24 extern int Using_Main;
25 extern char *PARAMS_FILENAME;
26 extern double EIGEN_TOLERANCE;
27 extern int OUTPUT_ASSIGN;
28 extern int DEBUG_MEMORY;
29 extern int DEBUG_TRACE;
30 extern int DEBUG_PARAMS;
31 extern long RANDOM_SEED;
34 extern int PRINT_HEADERS;
35 extern int MATCH_TYPE;
36 extern double input_time;
37 extern double start_time;
49 char outassignname[NAME_LENGTH];
50 char outfilename[NAME_LENGTH];
64 if (DEBUG_TRACE > 0) {
70 _printf_(
" Sandia National Laboratories\n\n");
74 params_file = fopen(PARAMS_FILENAME,
"r");
75 if (params_file == NULL && DEBUG_PARAMS > 1) {
76 printf(
"Parameter file `%s' not found; using default parameters.\n",PARAMS_FILENAME);
81 read_params(params_file);
84 &architecture, &ndims_tot, mesh_dims,
85 &global_method, &local_method, &rqi_flag, &vmax, &ndims, &nprocs,
90 if (OUTPUT_ASSIGN > 0)
91 outassignptr = outassignname;
96 outfileptr = outfilename;
100 if ((
int)options[OPT_VWGTS] && vwgts) {
101 printf(
"%s -- Applying weights for %d vertices.\n",
__FUNCT__,nvtxs);
103 for (i=0; i<nvtxs; i++)
108 if ( (
int)options[OPT_VWGTS] && !vwgts)
109 printf(
"%s -- Vertex weight flag=%d, but no vertex weights specified.\n",
__FUNCT__,(
int)options[OPT_VWGTS]);
110 else if (!(
int)options[OPT_VWGTS] && vwgts)
111 printf(
"%s -- Vertex weight flag=%d, so specified vertex weights ignored.\n",
__FUNCT__,(
int)options[OPT_VWGTS]);
114 if ((
int)options[OPT_EWGTS] && ewgts) {
115 printf(
"%s -- Applying weights for %d edges.\n",
119 if ( (
int)options[OPT_EWGTS] && !ewgts)
120 printf(
"%s -- Edge weight flag=%d, but no edge weights specified.\n",
__FUNCT__,(
int)options[OPT_EWGTS]);
121 else if (!(
int)options[OPT_EWGTS] && ewgts)
122 printf(
"%s -- Edge weight flag=%d, so specified edge weights ignored.\n",
__FUNCT__,(
int)options[OPT_EWGTS]);
126 printf(
"%s -- Applying goals for %d sets.\n",
129 for (i=0; i<nprocs; i++)
131 for (i=0; i<nprocs; i++)
132 goal[i] *= (
double)tvwgt/tgoal;
137 if (options[OPT_EIGTOL] > 0)
138 eigtol = options[OPT_EIGTOL];
140 eigtol = EIGEN_TOLERANCE;
141 if ((
int)options[OPT_SEED] > 0)
142 seed = (int)options[OPT_SEED];
149 for (i=0; i<start[nvtxs]; adjacency[i++]++);
151 printf(
"\n%s -- Calling Chaco interface:\n\n",
__FUNCT__);
152 flag = interface(nvtxs, start, adjacency,
153 ((
int)options[OPT_VWGTS] && vwgts ? vwgts : NULL),
154 ((
int)options[OPT_EWGTS] && ewgts ? ewgts : NULL),
156 outassignptr, outfileptr,
158 architecture, ndims_tot, mesh_dims, goal,
159 global_method, local_method, rqi_flag, vmax, ndims,
161 printf(
"\n%s -- Chaco interface returning flag=%d.\n",
__FUNCT__,flag);
165 for (i=0; i<start[nvtxs]; adjacency[i++]--);
167 if (DEBUG_MEMORY > 0) {
172 if (params_file != NULL)
175 if (DEBUG_TRACE > 1) {
181 #else //ifdef _HAVE_CHACO_