~ubuntu-branches/ubuntu/precise/code-saturne/precise

« back to all changes in this revision

Viewing changes to src/base/cs_opts.c

  • Committer: Package Import Robot
  • Author(s): Sylvestre Ledru
  • Date: 2011-11-24 00:00:08 UTC
  • mfrom: (6.1.9 sid)
  • Revision ID: package-import@ubuntu.com-20111124000008-2vo99e38267942q5
Tags: 2.1.0-3
Install a missing file

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*============================================================================
2
 
 *
3
 
 *     This file is part of the Code_Saturne Kernel, element of the
4
 
 *     Code_Saturne CFD tool.
5
 
 *
6
 
 *     Copyright (C) 1998-2009 EDF S.A., France
7
 
 *
8
 
 *     contact: saturne-support@edf.fr
9
 
 *
10
 
 *     The Code_Saturne Kernel is free software; you can redistribute it
11
 
 *     and/or modify it under the terms of the GNU General Public License
12
 
 *     as published by the Free Software Foundation; either version 2 of
13
 
 *     the License, or (at your option) any later version.
14
 
 *
15
 
 *     The Code_Saturne Kernel is distributed in the hope that it will be
16
 
 *     useful, but WITHOUT ANY WARRANTY; without even the implied warranty
17
 
 *     of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 
 *     GNU General Public License for more details.
19
 
 *
20
 
 *     You should have received a copy of the GNU General Public License
21
 
 *     along with the Code_Saturne Kernel; if not, write to the
22
 
 *     Free Software Foundation, Inc.,
23
 
 *     51 Franklin St, Fifth Floor,
24
 
 *     Boston, MA  02110-1301  USA
25
 
 *
26
 
 *============================================================================*/
27
 
 
28
 
/*============================================================================
29
2
 * Parsing of program arguments and associated initializations
30
3
 *============================================================================*/
31
4
 
 
5
/*
 
6
  This file is part of Code_Saturne, a general-purpose CFD tool.
 
7
 
 
8
  Copyright (C) 1998-2011 EDF S.A.
 
9
 
 
10
  This program is free software; you can redistribute it and/or modify it under
 
11
  the terms of the GNU General Public License as published by the Free Software
 
12
  Foundation; either version 2 of the License, or (at your option) any later
 
13
  version.
 
14
 
 
15
  This program is distributed in the hope that it will be useful, but WITHOUT
 
16
  ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
 
17
  FOR A PARTICULAR PURPOSE.  See the GNU General Public License for more
 
18
  details.
 
19
 
 
20
  You should have received a copy of the GNU General Public License along with
 
21
  this program; if not, write to the Free Software Foundation, Inc., 51 Franklin
 
22
  Street, Fifth Floor, Boston, MA 02110-1301, USA.
 
23
*/
 
24
 
 
25
/*----------------------------------------------------------------------------*/
 
26
 
32
27
#if defined(HAVE_CONFIG_H)
33
28
#include "cs_config.h"
34
29
#endif
51
46
 * BFT library headers
52
47
 *----------------------------------------------------------------------------*/
53
48
 
54
 
#include <bft_config.h>
55
49
#include <bft_mem.h>
56
50
#include <bft_printf.h>
57
51
 
115
109
 
116
110
  fprintf (e, _("\nCommand line options:\n\n"));
117
111
  fprintf
118
 
    (e, _(" --solcom          stand-alone kernel with \"geomet\" mesh in\n"
119
 
          "                   SolCom format (obsolete)\n"));
120
 
  fprintf
121
 
    (e, _(" --mpi             use MPI for parallelism or coupling\n"
122
 
          "                   [appnum]: number of this application in\n"
123
 
          "                             case of code coupling (default: 0)\n"));
 
112
    (e, _(" --app-name        <app_name> to name this code instance\n"
 
113
          "                   (default: working directory base name)\n"));
 
114
  fprintf
 
115
    (e, _(" --benchmark       elementary operations performance\n"
 
116
          "                   [--mpitrace] operations done only once\n"
 
117
          "                                for light MPI traces\n"));
 
118
  fprintf
 
119
    (e, _(" -h, --help        this help message\n\n"));
 
120
 
 
121
  fprintf
 
122
    (e, _(" --mpi             force use of MPI for parallelism or coupling\n"
 
123
          "                   (usually automatic, only required for\n"
 
124
          "                   undetermined MPI libraries)\n"));
124
125
  fprintf
125
126
    (e, _(" --mpi-io          <mode> set parallel I/O behavior\n"
126
127
          "                     off: do not use MPI-IO\n"
128
129
          "                          (default if available)\n"
129
130
          "                     ip:  MPI-IO with individual file pointers\n"));
130
131
  fprintf
131
 
    (e, _(" -q, --quality     mesh quality verification mode\n"));
132
 
  fprintf
133
 
    (e, _(" --cwf             <criterion> cut warped faces\n"
134
 
          "                    -post: activate the post-processing related\n"
135
 
          "                           to the cutting of warped faces\n"));
136
 
  fprintf
137
 
    (e, _(" --benchmark       elementary operations performance\n"
138
 
          "                   [--mpitrace] operations done only once\n"
139
 
          "                                for light MPI traces\n"));
140
 
  fprintf
141
132
    (e, _(" --log             output redirection for rank -1 or 0:\n"
142
133
          "                     0: standard output\n"
143
134
          "                     1: output in \"listing\" (default)\n"));
151
142
    (e, _(" -p, --param       <file_name> parameter file\n"));
152
143
 
153
144
  fprintf
 
145
    (e, _(" --preprocess      mesh preprocessing mode\n"));
 
146
 
 
147
  fprintf
 
148
    (e, _(" -q, --quality     mesh quality verification mode\n"));
 
149
 
 
150
  fprintf
154
151
    (e, _(" --syr-socket      enable sockets for SYRTHES 3 coupling\n"
155
152
          "                   <port_num> port number on rank 0\n"));
156
153
 
157
154
  fprintf
158
155
    (e, _(" --version         print version number\n"));
159
 
  fprintf
160
 
    (e, _(" -h, --help        this help message\n\n"));
161
156
}
162
157
 
163
158
/*----------------------------------------------------------------------------
211
206
  return retval;
212
207
}
213
208
 
214
 
/*----------------------------------------------------------------------------
215
 
 * Convert an argument to a double and check its validity
216
 
 *
217
 
 * parameters:
218
 
 *   arg_id  <-- index of argument in argv
219
 
 *   argc    <-- number of command line arguments
220
 
 *   argv    <-- array of command line arguments
221
 
 *   argerr  --> error indicator
222
 
 *
223
 
 * returns:
224
 
 *   integer value
225
 
 *----------------------------------------------------------------------------*/
226
 
 
227
 
static double
228
 
_arg_to_double(int    arg_id,
229
 
               int    argc,
230
 
               char  *argv[],
231
 
               int   *argerr)
232
 
{
233
 
  char  *start = NULL;
234
 
  char  *end =  NULL;
235
 
  double  retval = 0.;
236
 
 
237
 
  *argerr = 0;
238
 
 
239
 
  if (arg_id < argc) {
240
 
    start = argv[arg_id];
241
 
    end = start + strlen(start);
242
 
    retval = strtod(start, &end);
243
 
    if (end != start + strlen(start)) *argerr = 1;
244
 
  }
245
 
  else {
246
 
    *argerr = 1;
247
 
  }
248
 
 
249
 
  return retval;
250
 
}
251
 
 
252
209
/*============================================================================
253
210
 * Public function definitions for Fortran API
254
211
 *============================================================================*/
258
215
 *============================================================================*/
259
216
 
260
217
/*----------------------------------------------------------------------------
261
 
 * Print logfile header
262
 
 *
263
 
 * parameters:
264
 
 *   argc  <-- number of command line arguments
265
 
 *   argv  <-- array of command line arguments
266
 
 *----------------------------------------------------------------------------*/
267
 
 
268
 
void
269
 
cs_opts_logfile_head(int    argc,
270
 
                     char  *argv[])
271
 
{
272
 
  char str[81];
273
 
  int ii;
274
 
  char date_str[] = __DATE__;
275
 
  char time_str[] = __TIME__;
276
 
  const char mon_name[12][4]
277
 
    = {"Jan", "Feb", "Mar", "Apr", "May", "Jun",
278
 
       "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"};
279
 
  struct tm time_cnv;
280
 
 
281
 
  /* Define MPI Information */
282
 
 
283
 
#if defined(MPI_VERSION) && defined(MPI_SUBVERSION)
284
 
#if defined(OPEN_MPI)
285
 
  const char mpi_lib[] = "Open MPI";
286
 
#elif defined(MPICH2)
287
 
  const char mpi_lib[] = "MPICH2";
288
 
#elif defined(LAM_MPI)
289
 
  const char mpi_lib[] = "LAM/MPI";
290
 
#elif defined(MPICH_NAME)
291
 
  const char mpi_lib[] = "MPICH";
292
 
#elif defined(HP_MPI)
293
 
  const char mpi_lib[] = "HP-MPI";
294
 
#elif defined(MPI_VERSION) && defined(MPI_SUBVERSION)
295
 
  const char *mpi_lib = NULL;
296
 
#endif
297
 
#endif /* defined(MPI_VERSION) && defined(MPI_SUBVERSION) */
298
 
 
299
 
  /* Determine compilation date */
300
 
 
301
 
  for (ii = 0; ii < 12; ii++) {
302
 
    if (strncmp(date_str, mon_name[ii], 3) == 0) {
303
 
      time_cnv.tm_mon = ii ;
304
 
      break;
305
 
    }
306
 
  }
307
 
 
308
 
  sscanf(date_str + 3, "%d", &(time_cnv.tm_mday)) ;
309
 
  sscanf(date_str + 6, "%d", &(time_cnv.tm_year)) ;
310
 
 
311
 
  time_cnv.tm_year -= 1900 ;
312
 
 
313
 
  sscanf(time_str    , "%d", &(time_cnv.tm_hour)) ;
314
 
  sscanf(time_str + 3, "%d", &(time_cnv.tm_min)) ;
315
 
  sscanf(time_str + 6, "%d", &(time_cnv.tm_sec)) ;
316
 
 
317
 
  time_cnv.tm_isdst = -1 ;
318
 
 
319
 
  /* Re-compute and internationalize build date */
320
 
 
321
 
  mktime(&time_cnv) ;
322
 
  strftime(str, 80, "%c", &time_cnv) ;
323
 
 
324
 
  /* Now print info */
325
 
 
326
 
  bft_printf(_("command: \n"));
327
 
 
328
 
  for (ii = 0 ; ii < argc ; ii++)
329
 
    bft_printf(" %s", argv[ii]);
330
 
 
331
 
  bft_printf("\n");
332
 
  bft_printf("\n************************************"
333
 
             "***************************\n\n");
334
 
  bft_printf("                                  (R)\n"
335
 
             "                      Code_Saturne\n\n"
336
 
             "                      Version %s\n\n",
337
 
             CS_APP_VERSION);
338
 
 
339
 
  bft_printf("\n  Copyright (C) 1998-2011 EDF S.A., France\n\n");
340
 
 
341
 
  bft_printf(_("  build %s\n"), str);
342
 
 
343
 
#if defined(MPI_VERSION) && defined(MPI_SUBVERSION)
344
 
  if (mpi_lib != NULL)
345
 
    bft_printf(_("  MPI version %d.%d (%s)\n\n"),
346
 
               MPI_VERSION, MPI_SUBVERSION, mpi_lib);
347
 
  else
348
 
    bft_printf(_("  MPI version %d.%d\n\n"),
349
 
               MPI_VERSION, MPI_SUBVERSION);
350
 
#endif
351
 
 
352
 
  bft_printf("\n");
353
 
  bft_printf("  The Code_Saturne CFD tool  is free software;\n"
354
 
             "  you can redistribute it and/or modify it under the terms\n"
355
 
             "  of the GNU General Public License as published by the\n"
356
 
             "  Free Software Foundation; either version 2 of the License,\n"
357
 
             "  or (at your option) any later version.\n\n");
358
 
 
359
 
  bft_printf("  The Code_Saturne CFD tool is distributed in the hope that\n"
360
 
             "  it will be useful, but WITHOUT ANY WARRANTY; without even\n"
361
 
             "  the implied warranty of MERCHANTABILITY or FITNESS FOR A\n"
362
 
             "  PARTICULAR PURPOSE.  See the GNU General Public License\n"
363
 
             "  for more details.\n");
364
 
 
365
 
  bft_printf("\n************************************"
366
 
             "***************************\n\n");
367
 
}
368
 
 
369
 
/*----------------------------------------------------------------------------
370
 
 * First analysis of the command line to determine if we require MPI,
371
 
 * and initialization if necessary
372
 
 *
373
 
 * parameters:
374
 
 *   argc  <-> number of command line arguments
375
 
 *   argv  <-> array of command line arguments
376
 
 *
377
 
 * returns:
378
 
 *   -1 if MPI is not needed, or application number in MPI_COMM_WORLD of
379
 
 *   processes associated with this instance of Code_Saturne
380
 
 *----------------------------------------------------------------------------*/
381
 
 
382
 
int
383
 
cs_opts_mpi_init(int    *argc,
384
 
                 char  **argv[])
385
 
{
386
 
#if defined(HAVE_MPI)
387
 
 
388
 
  char *s;
389
 
 
390
 
  int arg_id = 0, flag = 0;
391
 
  int appnum = -1;
392
 
  int use_mpi = false;
393
 
 
394
 
#if defined(__bg__) || defined(__CRAYXT_COMPUTE_LINUX_TARGET)
395
 
 
396
 
  /* Notes: Blue Gene/L also defines the BGLMPI_SIZE environment variable.
397
 
   *        Blue Gene/P defines BG_SIZE (plus BG_MAPPING, and BG_RELEASE). */
398
 
 
399
 
  use_mpi = true;
400
 
 
401
 
#elif defined(MPICH2)
402
 
  if (getenv("PMI_RANK") != NULL)
403
 
    use_mpi = true;
404
 
 
405
 
#elif defined(MPICH_NAME)
406
 
 
407
 
  /*
408
 
    Using standard MPICH1 1.2.x with the p4 (default) mechanism,
409
 
    the information required by MPI_Init() are transferred through
410
 
    the command line, which is then modified by MPI_Init();
411
 
    in this case, only rank 0 knows the "user" command line arguments
412
 
    at program startup, the other processes obtaining them only upon
413
 
    calling  MPI_Init(). In this case, it is thus necessary to initialize
414
 
    MPI before parsing the command line.
415
 
  */
416
 
 
417
 
  for (arg_id = 0 ; arg_id < *argc ; arg_id++) {
418
 
    if (   !strcmp((*argv)[arg_id], "-p4pg")         /* For process 0 */
419
 
        || !strcmp((*argv)[arg_id], "-p4rmrank")) {  /* For other processes */
420
 
      use_mpi = true;
421
 
      break;
422
 
    }
423
 
  }
424
 
 
425
 
  if (getenv("GMPI_ID") != NULL) /* In case we are using MPICH-GM */
426
 
    use_mpi = true;
427
 
 
428
 
#elif defined(LAM_MPI)
429
 
  if (getenv("LAMRANK") != NULL)
430
 
    use_mpi = true;
431
 
 
432
 
#elif defined(OPEN_MPI)
433
 
  if (getenv("OMPI_MCA_ns_nds_vpid") != NULL)         /* OpenMPI 1.2 */
434
 
    use_mpi = true;
435
 
  else if (getenv("OMPI_COMM_WORLD_RANK") != NULL)    /* OpenMPI 1.3 */
436
 
    use_mpi = true;
437
 
 
438
 
#endif /* Tests for known MPI variants */
439
 
 
440
 
  /* If we have determined from known MPI environment variables
441
 
     of command line arguments that we are running under MPI,
442
 
     initialize MPI */
443
 
 
444
 
  if (use_mpi == true) {
445
 
    MPI_Initialized(&flag);
446
 
    if (!flag) {
447
 
#if defined(MPI_VERSION) && (MPI_VERSION >= 2) && defined(HAVE_OPENMP)
448
 
      int mpi_threads;
449
 
      MPI_Init_thread(argc, argv, MPI_THREAD_FUNNELED, &mpi_threads);
450
 
#else
451
 
      MPI_Init(argc, argv);
452
 
#endif
453
 
    }
454
 
  }
455
 
 
456
 
  /* Loop on command line arguments */
457
 
 
458
 
  arg_id = 0;
459
 
 
460
 
  while (++arg_id < *argc) {
461
 
 
462
 
    s = (*argv)[arg_id];
463
 
 
464
 
    /* Parallel run */
465
 
 
466
 
    if (strcmp(s, "--mpi") == 0) {
467
 
      int tmperr = 0;
468
 
      int _appnum = 0;
469
 
      use_mpi = true;
470
 
      _appnum = _arg_to_int(arg_id + 1, *argc, *argv, &tmperr);
471
 
      if (tmperr == 0) {
472
 
        arg_id++;
473
 
        appnum = _appnum;
474
 
      }
475
 
    }
476
 
 
477
 
  } /* End of loop on command line arguments */
478
 
 
479
 
  if (use_mpi == true) {
480
 
 
481
 
    MPI_Initialized(&flag);
482
 
    if (!flag) {
483
 
#if defined(MPI_VERSION) && (MPI_VERSION >= 2) && defined(HAVE_OPENMP)
484
 
      int mpi_threads;
485
 
      MPI_Init_thread(argc, argv, MPI_THREAD_FUNNELED, &mpi_threads);
486
 
#else
487
 
      MPI_Init(argc, argv);
488
 
#endif
489
 
    }
490
 
 
491
 
    /*
492
 
      If appnum was not given through the command line but we
493
 
      are running under MPI-2, appnum may be available through
494
 
      the MPI_APPNUM attribute.
495
 
    */
496
 
 
497
 
#if defined(MPI_VERSION) && (MPI_VERSION >= 2)
498
 
    if (appnum < 0) {
499
 
      void *attp = NULL;
500
 
      MPI_Comm_get_attr(MPI_COMM_WORLD, MPI_APPNUM, &attp, &flag);
501
 
      if (flag != 0)
502
 
        appnum = *(int *)attp;
503
 
    }
504
 
#endif
505
 
 
506
 
    if (appnum < 0)
507
 
      appnum = 0;
508
 
  }
509
 
 
510
 
  return appnum;
511
 
 
512
 
#else /* if defined(HAVE_MPI) */
513
 
 
514
 
  return -1;
515
 
 
516
 
#endif
517
 
}
518
 
 
519
 
/*----------------------------------------------------------------------------
520
218
 * Define options and call some associated initializations
521
219
 * based on command line arguments
522
220
 *
542
240
 
543
241
  /* Default initialization */
544
242
 
545
 
  opts->ifoenv = 1;
 
243
  opts->app_name = NULL;
546
244
 
547
245
  opts->ilisr0 = 1;
548
246
  opts->ilisrp = 2;
549
247
 
550
248
  opts->mpi_io_mode = -1;
551
249
 
 
250
  opts->preprocess = false;
552
251
  opts->verif = false;
553
252
  opts->benchmark = 0;
554
253
 
555
 
  opts->cwf = false;
556
 
  opts->cwf_post = false;
557
 
  opts->cwf_criterion = 0.01;
558
 
 
559
254
  opts->syr_socket = -1;
560
255
 
561
256
  opts->yacs_module = NULL;
569
264
 
570
265
    s = argv[arg_id];
571
266
 
572
 
    if (strcmp(s, "--solcom") == 0)
573
 
      opts->ifoenv = 0;
 
267
    if (strcmp(s, "--app-name") == 0) {
 
268
      if (arg_id + 1 < argc) {
 
269
        BFT_MALLOC(opts->app_name, strlen(argv[arg_id + 1]) + 1, char);
 
270
        strcpy(opts->app_name, argv[arg_id + 1]);
 
271
        arg_id++;
 
272
      }
 
273
    }
 
274
 
 
275
    else if (strcmp(s, "--benchmark") == 0) {
 
276
      opts->benchmark = 1;
 
277
      if (arg_id + 1 < argc) {
 
278
        if (strcmp(argv[arg_id + 1], "--mpitrace") == 0) {
 
279
          opts->benchmark = 2;
 
280
          arg_id++;
 
281
        }
 
282
      }
 
283
    }
 
284
 
 
285
    else if (strcmp(s, "--log") == 0) {
 
286
      int n1 = 0;
 
287
      n1 = _arg_to_int(++arg_id, argc, argv, &argerr);
 
288
      if (n1 == 0)
 
289
        opts->ilisr0 = 0;
 
290
      else if (n1 == 1)
 
291
        opts->ilisr0 = 1;
 
292
      else
 
293
        argerr = 1;
 
294
    }
 
295
 
 
296
    else if (strcmp(s, "--logp") == 0) {
 
297
      int n1 = 0;
 
298
      n1 = _arg_to_int(++arg_id, argc, argv, &argerr);
 
299
      if (n1 == -1)
 
300
        opts->ilisrp = 2;
 
301
      else if (n1 == 0)
 
302
        opts->ilisrp = 0;
 
303
      else if (n1 == 1)
 
304
        opts->ilisrp = 1;
 
305
      else
 
306
        argerr = 1;
 
307
    }
574
308
 
575
309
#if defined(HAVE_MPI)
576
310
 
577
311
    else if (strcmp(s, "--mpi") == 0) {
578
 
      int tmperr = 0;
579
 
      (void)_arg_to_int(arg_id + 1, argc, argv, &tmperr);
580
 
      if (tmperr == 0) {
581
 
        arg_id++;
582
 
      }
 
312
      /* Handled in pre-reading stage */
583
313
    }
584
314
 
585
315
    else if (strcmp(s, "--mpi-io") == 0) {
611
341
 
612
342
#endif /* defined(HAVE_MPI) */
613
343
 
614
 
    else if (strcmp(s, "-q") == 0 || strcmp(s, "--quality") == 0)
615
 
      opts->verif = true;
616
 
 
617
 
    else if (strcmp(s, "--log") == 0) {
618
 
      int n1 = 0;
619
 
      n1 = _arg_to_int(++arg_id, argc, argv, &argerr);
620
 
      if (n1 == 0)
621
 
        opts->ilisr0 = 0;
622
 
      else if (n1 == 1)
623
 
        opts->ilisr0 = 1;
624
 
      else
625
 
        argerr = 1;
626
 
    }
627
 
 
628
 
    else if (strcmp(s, "--logp") == 0) {
629
 
      int n1 = 0;
630
 
      n1 = _arg_to_int(++arg_id, argc, argv, &argerr);
631
 
      if (n1 == -1)
632
 
        opts->ilisrp = 2;
633
 
      else if (n1 == 0)
634
 
        opts->ilisrp = 0;
635
 
      else if (n1 == 1)
636
 
        opts->ilisrp = 1;
637
 
      else
638
 
        argerr = 1;
639
 
    }
640
 
 
641
 
    else if (strcmp(s, "--benchmark") == 0) {
642
 
      opts->benchmark = 1;
643
 
      if (arg_id + 1 < argc) {
644
 
        if (strcmp(argv[arg_id + 1], "--mpitrace") == 0) {
645
 
          opts->benchmark = 2;
646
 
          arg_id++;
647
 
        }
648
 
      }
649
 
    }
650
 
 
651
344
    else if (strcmp(s, "-p") == 0 || strcmp(s, "--param") == 0) {
652
345
      if (arg_id + 1 < argc) {
653
346
        s = argv[++arg_id];
654
347
#if defined(HAVE_LIBXML2)
655
 
        argerr = cs_gui_file_loading(s);
 
348
        argerr = cs_gui_load_file(s);
656
349
#else
657
350
        fprintf(stderr, _("%s was built without XML support,\n"
658
351
                          "so parameter file \"%s\" may not be loaded.\n"),
664
357
        argerr = 1;
665
358
    }
666
359
 
667
 
    else if (strcmp(s, "--cwf") == 0) {
668
 
      opts->cwf = true;
669
 
      if (arg_id + 1 < argc) {
670
 
        if (*(argv[arg_id+1]) != '-') {
671
 
          opts->cwf_criterion = _arg_to_double(arg_id + 1, argc, argv, &argerr);
672
 
          if (argerr == 0)
673
 
            arg_id++;
674
 
        }
675
 
      }
676
 
      if (arg_id + 1 < argc) {
677
 
        if (strcmp((argv[arg_id+1]), "--post") == 0) {
678
 
          opts->cwf_post = true;
679
 
          arg_id++;
680
 
        }
681
 
      }
682
 
    }
 
360
    else if (strcmp(s, "--preprocess") == 0)
 
361
      opts->preprocess = true;
 
362
 
 
363
    else if (strcmp(s, "-q") == 0 || strcmp(s, "--quality") == 0)
 
364
      opts->verif = true;
683
365
 
684
366
#if defined(HAVE_SOCKET)
685
367
 
757
439
      switch (argerr) {
758
440
      case 1:
759
441
      case 2:
760
 
        cs_opts_logfile_head(argc, argv);
 
442
        cs_base_logfile_head(argc, argv);
761
443
        _arg_env_help(argv[0]);
762
444
        break;
763
445
      case 3:
772
454
    else
773
455
      cs_exit(EXIT_SUCCESS);
774
456
  }
 
457
 
 
458
  /* If application name has not been defined, use working directory
 
459
     base name as default. */
 
460
 
 
461
  if (opts->app_name == NULL)
 
462
    opts->app_name = cs_base_get_app_name(0, NULL);
775
463
}
776
464
 
777
465
/*----------------------------------------------------------------------------*/