Changeset 14644
- Timestamp:
- 04/18/13 11:10:45 (12 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/c/modules/Chacox/Chacox.cpp
r13622 r14644 22 22 #ifdef _HAVE_CHACO_ //only works if Chaco library has been compiled in. 23 23 24 extern int Using_Main; /* is main routine being called?*/25 extern char *PARAMS_FILENAME; /* name of file with parameter updates*/26 extern double EIGEN_TOLERANCE; /* tolerance for eigen calculations*/27 extern int OUTPUT_ASSIGN; /* whether to write assignment to file*/28 extern int DEBUG_MEMORY; /* debug memory allocation and freeing?*/29 extern int DEBUG_TRACE; /* trace main execution path*/30 extern int DEBUG_PARAMS; /* debug flag for reading parameters*/31 extern long RANDOM_SEED; /* seed for random number generators*/32 extern int ECHO; /* controls amount of output*/33 extern int PROMPT; /* prompt for input or not?*/34 extern int PRINT_HEADERS; /* print lines for output sections?*/35 extern int MATCH_TYPE; /* matching routine to call*/36 extern double input_time; /* times data file input*/37 extern double start_time; /* time partitioning starts*/38 FILE *params_file; /* file with parameter value updates*/39 int global_method; /* global partitioning method*/40 int local_method; /* local partitioning method*/41 double eigtol; /* tolerance in eigenvector calculation*/42 int ndims; /* dimension of recursive partitioning*/43 int architecture; /* 0 => hypercube, d => d-dimensional mesh*/44 int ndims_tot; /* total number of cube dimensions to divide*/45 int mesh_dims[3]; /* dimensions of mesh of processors*/46 long seed; /* for random graph mutations*/47 int rqi_flag; /* use RQI/Symmlq eigensolver?*/48 int vmax;/* if so, how many vertices to coarsen down to? */49 char outassignname[NAME_LENGTH]; /* assignment output file name*/50 char outfilename[NAME_LENGTH]; /* name of output file*/51 char *outassignptr; /* name or null pointer for output assignment*/52 char *outfileptr; /* name or null pointer for output file*/53 int nprocs; /* number of processors being divided into*/54 double time; /* timing marker*/55 int flag; /* return code from input routines*/56 double *smalloc(); /* safe version of malloc*/57 //double seconds(); /* returns elapsed time in seconds*/58 /*int 59 void input_queries(), smalloc_stats(), read_params(), clear_timing();*/24 extern int Using_Main; /* is main routine being called? */ 25 extern char *PARAMS_FILENAME; /* name of file with parameter updates */ 26 extern double EIGEN_TOLERANCE; /* tolerance for eigen calculations */ 27 extern int OUTPUT_ASSIGN; /* whether to write assignment to file */ 28 extern int DEBUG_MEMORY; /* debug memory allocation and freeing? */ 29 extern int DEBUG_TRACE; /* trace main execution path */ 30 extern int DEBUG_PARAMS; /* debug flag for reading parameters */ 31 extern long RANDOM_SEED; /* seed for random number generators */ 32 extern int ECHO; /* controls amount of output */ 33 extern int PROMPT; /* prompt for input or not? */ 34 extern int PRINT_HEADERS; /* print lines for output sections? */ 35 extern int MATCH_TYPE; /* matching routine to call */ 36 extern double input_time; /* times data file input */ 37 extern double start_time; /* time partitioning starts */ 38 FILE *params_file; /* file with parameter value updates */ 39 int global_method; /* global partitioning method */ 40 int local_method; /* local partitioning method */ 41 double eigtol; /* tolerance in eigenvector calculation */ 42 int ndims; /* dimension of recursive partitioning */ 43 int architecture; /* 0 => hypercube, d => d-dimensional mesh */ 44 int ndims_tot; /* total number of cube dimensions to divide */ 45 int mesh_dims[3]; /* dimensions of mesh of processors */ 46 long seed; /* for random graph mutations */ 47 int rqi_flag; /* use RQI/Symmlq eigensolver? */ 48 int vmax; /* if so, how many vertices to coarsen down to? */ 49 char outassignname[NAME_LENGTH]; /* assignment output file name */ 50 char outfilename[NAME_LENGTH]; /* name of output file */ 51 char *outassignptr; /* name or null pointer for output assignment */ 52 char *outfileptr; /* name or null pointer for output file */ 53 int nprocs; /* number of processors being divided into */ 54 double time; /* timing marker */ 55 int flag; /* return code from input routines */ 56 double *smalloc(); /* safe version of malloc */ 57 //double seconds(); /* returns elapsed time in seconds */ 58 /*int sfree(), interface(), affirm(); 59 void input_queries() , smalloc_stats(), read_params(), clear_timing(); */ 60 60 61 61 int i,tvwgt; … … 74 74 params_file = fopen(PARAMS_FILENAME, "r"); 75 75 if (params_file == NULL && DEBUG_PARAMS > 1) { 76 printf("Parameter file `%s' not found; using default parameters.\n", 77 PARAMS_FILENAME); 76 printf("Parameter file `%s' not found; using default parameters.\n",PARAMS_FILENAME); 78 77 } 79 78 … … 100 99 101 100 if ((int)options[OPT_VWGTS] && vwgts) { 102 printf("%s -- Applying weights for %d vertices.\n", 103 __FUNCT__,nvtxs); 101 printf("%s -- Applying weights for %d vertices.\n",__FUNCT__,nvtxs); 104 102 tvwgt = 0; 105 103 for (i=0; i<nvtxs; i++) … … 109 107 tvwgt = nvtxs; 110 108 if ( (int)options[OPT_VWGTS] && !vwgts) 111 printf("%s -- Vertex weight flag=%d, but no vertex weights specified.\n", 112 __FUNCT__,options[OPT_VWGTS]); 109 printf("%s -- Vertex weight flag=%d, but no vertex weights specified.\n",__FUNCT__,(int)options[OPT_VWGTS]); 113 110 else if (!(int)options[OPT_VWGTS] && vwgts) 114 printf("%s -- Vertex weight flag=%d, so specified vertex weights ignored.\n", 115 __FUNCT__,options[OPT_VWGTS]); 111 printf("%s -- Vertex weight flag=%d, so specified vertex weights ignored.\n",__FUNCT__,(int)options[OPT_VWGTS]); 116 112 } 117 113 … … 122 118 else { 123 119 if ( (int)options[OPT_EWGTS] && !ewgts) 124 printf("%s -- Edge weight flag=%d, but no edge weights specified.\n", 125 __FUNCT__,options[OPT_EWGTS]); 120 printf("%s -- Edge weight flag=%d, but no edge weights specified.\n",__FUNCT__,(int)options[OPT_EWGTS]); 126 121 else if (!(int)options[OPT_EWGTS] && ewgts) 127 printf("%s -- Edge weight flag=%d, so specified edge weights ignored.\n", 128 __FUNCT__,options[OPT_EWGTS]); 122 printf("%s -- Edge weight flag=%d, so specified edge weights ignored.\n",__FUNCT__,(int)options[OPT_EWGTS]); 129 123 } 130 124 … … 155 149 for (i=0; i<start[nvtxs]; adjacency[i++]++); 156 150 157 printf("\n%s -- Calling Chaco interface:\n\n", 158 __FUNCT__); 151 printf("\n%s -- Calling Chaco interface:\n\n",__FUNCT__); 159 152 flag = interface(nvtxs, start, adjacency, 160 153 ((int)options[OPT_VWGTS] && vwgts ? vwgts : NULL), … … 166 159 global_method, local_method, rqi_flag, vmax, ndims, 167 160 eigtol, seed); 168 printf("\n%s -- Chaco interface returning flag=%d.\n", 169 __FUNCT__,flag); 161 printf("\n%s -- Chaco interface returning flag=%d.\n",__FUNCT__,flag); 170 162 171 163 /* Reset adjacency matrix in case calling function needs it. */
Note:
See TracChangeset
for help on using the changeset viewer.