27 #ifdef _HAVE_CHACO_ //only works if Chaco library has been compiled in.
30 extern int ARCHITECTURE;
31 extern int OUTPUT_ASSIGN;
33 extern int DEBUG_TRACE;
35 extern int MATCH_TYPE;
38 if (DEBUG_TRACE > 0) {
39 _printf_(
"<Entering input_parse>\n");
43 _printf_(
"Parallel machine architecture:\n");
45 _printf_(
" (1) One-dimensional mesh\n");
46 _printf_(
" (2) Two-dimensional mesh\n");
47 _printf_(
" (3) Three-dimensional mesh\n");
49 *architecture = (int)options[OPT_ARCH];
50 if (*architecture < 0 || *architecture > 3) {
51 printf(
"%s -- Architecture %d must be between 0 and 3.\n",
__FUNCT__,*architecture);
57 _printf_(
"Assignment output file: ");
62 _printf_(
"File name for saving run results: ");
75 _printf_(
"Global partitioning method:\n");
84 *global_method = (int)options[OPT_GLOBAL];
85 if (*global_method < 1 || *global_method > 7) {
86 printf(
"%s -- Global method %d must be between 1 and 7.\n",
__FUNCT__,*global_method);
91 if (*global_method == 7) {
96 else if (*global_method == 3) {
98 _printf_(
"Geometry input file name: ");
101 else if (*global_method == 2) {
104 _printf_(
" (1) Multilevel RQI/Symmlq\n");
107 eigensolver = (int)options[OPT_RQI];
108 if (eigensolver < 0 || eigensolver > 2) {
109 printf(
"%s -- RQI/Symmlq flag %d must be between 0 and 2.\n",
__FUNCT__,eigensolver);
112 if (eigensolver == 1) {
113 if (MATCH_TYPE == 5) {
115 _printf_(
"Geometry input file name: ");
119 _printf_(
"Number of vertices to coarsen down to: ");
120 *vmax = (int)options[OPT_VMAX];
122 printf(
"%s -- Vmax %d must be greater then 0.\n",
__FUNCT__,*vmax);
126 else if (eigensolver == 0 || eigensolver == 2) {
131 else if (*global_method == 1) {
132 if (MATCH_TYPE == 5) {
134 _printf_(
"Geometry input file name: ");
137 _printf_(
"Number of vertices to coarsen down to: ");
138 *vmax = (int)options[OPT_VMAX];
140 printf(
"%s -- Vmax %d must be greater then 0.\n",
__FUNCT__,*vmax);
147 if (*architecture == 0) {
150 else if (*architecture > 0) {
152 mesh_dims[1] = mesh_dims[2] = 1;
160 if (*global_method == 1)
164 _printf_(
"Local refinement method:\n");
168 *local_method = (int)options[OPT_LOCAL];
169 if (*local_method < 1 || *local_method > 2) {
170 printf(
"%s -- Local method %d must be 1 and 2.\n",
__FUNCT__,*local_method);
176 if (*architecture == 0) {
180 _printf_(
"Total number of target hypercube dimensions: ");
181 *ndims_tot = nparts[0];
182 if (*ndims_tot < 1) {
183 _printf_(
" Number of divisions must be at least 1\n");
184 printf(
"%s -- Number of divisions %d must be at least 1.\n",
188 *nprocs = 1 << (*ndims_tot);
192 mesh_dims[1] = mesh_dims[2] = 1;
193 if (*architecture == 2) {
195 _printf_(
"X and Y extent of of 2-D mesh: ");
196 mesh_dims[0] = nparts[0];
197 mesh_dims[1] = nparts[1];
199 else if (*architecture == 3) {
201 _printf_(
"X, Y and Z extent of 3-D mesh: ");
202 mesh_dims[0] = nparts[0];
203 mesh_dims[1] = nparts[1];
204 mesh_dims[2] = nparts[2];
209 mesh_dims[0] = nparts[0];
212 *nprocs = mesh_dims[0] * mesh_dims[1] * mesh_dims[2];
220 else if (*nprocs <= 7) {
222 _printf_(
"Partitioning dimension: \n");
226 *ndims = (int)options[OPT_NDIMS];
227 if (*ndims < 1 || *ndims > 2) {
228 printf(
"%s -- Ndims %d must be 1 or 2 for %d processors.\n",
__FUNCT__,*ndims,*nprocs);
234 _printf_(
"Partitioning dimension: \n");
239 *ndims = (int)options[OPT_NDIMS];
240 if (*ndims < 1 || *ndims > 3) {
241 printf(
"%s -- Ndims %d must be between 1 and 3 for %d processors.\n",
__FUNCT__,*ndims,*nprocs);
247 if (*global_method == 1 || *rqi_flag) {
248 if (*vmax < 2 * (1 << *ndims)) {
249 *vmax = 2 * (1 << *ndims);
255 #else //#ifdef _HAVE_CHACO_