151 int *check,
int *scatter, spm_driver_t *driver,
char **filename )
162#if defined(HAVE_GETOPT_LONG)
164 long_options, NULL );
172 fprintf(stderr,
"RSA driver is no longer supported and is replaced by the HB driver\n");
173 pastix_attr_fallthrough;
177 *driver = SpmDriverHB;
180 *filename = strdup( optarg );
186 *driver = SpmDriverIJV;
189 *filename = strdup( optarg );
195 *driver = SpmDriverMM;
198 *filename = strdup( optarg );
204 *driver = SpmDriverSPM;
207 *filename = strdup( optarg );
213 *driver = SpmDriverLaplacian;
216 *filename = strdup( optarg );
222 *driver = SpmDriverXLaplacian;
225 *filename = strdup( optarg );
231 *driver = SpmDriverGraph;
234 *filename = strdup( optarg );
239 int scattervalue = atoi( optarg );
240 if ( (scattervalue >= 0) && (scattervalue < 6) ) {
241 if ( scatter != NULL ) {
242 *scatter = scattervalue;
246 fprintf(stderr,
"\nInvalid value for scatter option: %s\n\n", optarg);
256 if (strncasecmp(optarg,
"scotch", 6) == 0)
260 else if (strncasecmp(optarg,
"metis", 5) == 0)
264 else if (strncasecmp(optarg,
"ptscotch", 8) == 0)
268 else if (strncasecmp(optarg,
"parmetis", 8) == 0)
272 else if (strncasecmp(optarg,
"personal", 8) == 0)
277 fprintf(stderr,
"\nInvalid value for ordering option: %s\n\n", optarg);
283 int factotype = atoi( optarg );
284 if ( (factotype >= 0) && (factotype <= 4)){
288 fprintf(stderr,
"\nInvalid value for factorization option: %s\n\n", optarg);
295 int checkvalue = atoi( optarg );
296 if ( (checkvalue >= 0) && (checkvalue < 6) ) {
297 if ( check != NULL ) {
302 fprintf(stderr,
"\nInvalid value for check option: %s\n\n", optarg);
309 int schedtype = atoi( optarg );
310 if ( (schedtype >= 0) && (schedtype <= 4) ){
314 fprintf(stderr,
"\nInvalid value for scheduler option: %s\n\n", optarg);
326 iparm_idx = parse_iparm( optarg );
328 fprintf(stderr,
"\n%s is not a correct iparm parameter\n\n", optarg );
333 iparm_val = parse_enums( argv[optind] );
334 if ( iparm_val == -1 ){
335 fprintf(stderr,
"\n%s is not a correct value for the iparm parameters\n\n", argv[optind] );
338 iparam[iparm_idx] = iparm_val;
348 dparm_idx = parse_dparm( optarg );
350 fprintf(stderr,
"\n%s is not a correct dparm parameter\n\n", optarg );
355 dparm_val = atof( argv[optind] );
356 dparam[dparm_idx] = dparm_val;
369 fprintf(stderr,
"\nOption %c is missing an argument\n\n", c );
380 if ( driver && ( (
int)(*driver) == -1 ) ) {
void pastixGetOptions(int argc, char **argv, pastix_int_t *iparam, double *dparam, int *check, int *scatter, spm_driver_t *driver, char **filename)
PaStiX helper function to read command line options in examples.