IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 34120


Ignore:
Timestamp:
Jul 5, 2012, 9:12:47 AM (14 years ago)
Author:
eugene
Message:

write out list of files with problems; add option to report missing files

Location:
branches/eam_branches/ipp-20120627/Ohana/src/dvomerge
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • branches/eam_branches/ipp-20120627/Ohana/src/dvomerge/include/dvoverify.h

    r34116 r34120  
    3434int    NNotSorted;
    3535int    CHECK_TOPLEVEL;
     36int    LIST_MISSING;
    3637
    3738SkyRegion UserPatch;
     
    4849int CheckCatalogIndexes (char *filename,  SkyRegion *region);
    4950
     51void InitFailures ();
     52void AddFailures (char *filename);
     53char **GetFailures (int *N);
  • branches/eam_branches/ipp-20120627/Ohana/src/dvomerge/src/dvoverify.c

    r34116 r34120  
    5050  dvoverify_catalogs (skylist, &Nbad);
    5151
     52  int i, Nfailures;
     53  char **failures = GetFailures (&Nfailures);
     54
     55  fprintf (stderr, "---- files with errors ---- \n");
     56  for (i = 0; i < Nfailures; i++) {
     57    fprintf (stderr, "%s\n", failures[i]);
     58  }
     59
    5260  if (Nbad > 0) {
    5361    fprintf (stderr, "ERROR: %d files are bad\n", Nbad);
  • branches/eam_branches/ipp-20120627/Ohana/src/dvomerge/src/dvoverify_args.c

    r34116 r34120  
    55  int N;
    66
    7   VERBOSE = FALSE;
    8   CHECKSORTED = FALSE;
    97  NNotSorted = 0;
    108
     9  VERBOSE = FALSE;
    1110  if ((N = get_argument (*argc, argv, "-v"))) {
    1211    VERBOSE = TRUE;
     
    1716    remove_argument (N, argc, argv);
    1817  }
     18
     19  CHECKSORTED = FALSE;
    1920  if ((N = get_argument (*argc, argv, "-s"))) {
    2021    CHECKSORTED = TRUE;
     
    2324  if ((N = get_argument (*argc, argv, "-sorted"))) {
    2425    CHECKSORTED = TRUE;
     26    remove_argument (N, argc, argv);
     27  }
     28
     29  LIST_MISSING = FALSE;
     30  if ((N = get_argument (*argc, argv, "-list-missing"))) {
     31    LIST_MISSING = TRUE;
    2532    remove_argument (N, argc, argv);
    2633  }
     
    126133  }
    127134
     135  LIST_MISSING = FALSE;
     136  if ((N = get_argument (*argc, argv, "-list-missing"))) {
     137    LIST_MISSING = TRUE;
     138    remove_argument (N, argc, argv);
     139  }
     140
    128141  // restrict to a portion of the sky
    129142  UserPatch.Rmin = 0;
  • branches/eam_branches/ipp-20120627/Ohana/src/dvomerge/src/dvoverify_catalogs.c

    r34116 r34120  
    55  int i;
    66  char filename[DVO_MAX_PATH];
     7
     8  InitFailures ();
    79
    810  if (PARALLEL && !HOST_ID) {
     
    2931      Nbad ++;
    3032      skipIndexCheck = TRUE;
     33      AddFailures (filename);
    3134    }
    3235
     
    3437    if (!VerifyTableFile (filename)) {
    3538      Nbad ++;
     39      AddFailures (filename);
    3640    }
    3741
     
    4044      Nbad ++;
    4145      skipIndexCheck = TRUE;
     46      AddFailures (filename);
    4247    }
    4348
     
    4651      if (!CheckCatalogIndexes(filename, skylist[0].regions[i])){
    4752        Nbad ++;
     53        AddFailures (filename);
    4854      }
    4955    }
     
    94100
    95101    char tmpline[DVO_MAX_PATH];
    96     if (VERBOSE)     { snprintf (tmpline, DVO_MAX_PATH, "%s -v", command); strcpy (command, tmpline); }
    97     if (CHECKSORTED) { snprintf (tmpline, DVO_MAX_PATH, "%s -s", command); strcpy (command, tmpline); }
     102    if (VERBOSE)      { snprintf (tmpline, DVO_MAX_PATH, "%s -v", command); strcpy (command, tmpline); }
     103    if (CHECKSORTED)  { snprintf (tmpline, DVO_MAX_PATH, "%s -s", command); strcpy (command, tmpline); }
     104    if (LIST_MISSING) { snprintf (tmpline, DVO_MAX_PATH, "%s -list-missing", command); strcpy (command, tmpline); }
    98105
    99106    fprintf (stderr, "command: %s\n", command);
     
    131138  for (i = 0; i < table->Nhosts; i++) {
    132139    FILE *results = fopen (table->hosts[i].results, "r");
    133     myAssert (results, "cannot read result?");
     140    if (!results) {
     141      fprintf (stderr, "cannot read results for %d: %s\n", i, table->hosts[i].results);
     142      continue;
     143    }
    134144    fscanf (results, "%*s %d %*s %d", &NbadHost, &NNotSortedHost);
    135145    *Nbad += NbadHost;
  • branches/eam_branches/ipp-20120627/Ohana/src/dvomerge/src/dvoverify_client.c

    r34116 r34120  
    2121  dvoverify_catalogs (skylist, &Nbad);
    2222
     23  // write result to file
    2324  FILE *results = fopen (RESULTS, "w");
    2425  fprintf (results, "Nbad: %d NNotSorted: %d\n", Nbad, NNotSorted);
     26
     27  int i, Nfailures;
     28  char **failures = GetFailures (&Nfailures);
     29  fprintf (results, "---- files with errors ---- \n");
     30  for (i = 0; i < Nfailures; i++) {
     31    fprintf (results, "%s\n", failures[i]);
     32  }
    2533  fclose (results);
    26 
    27   // write result to file
    2834
    2935  if (Nbad > 0) {
  • branches/eam_branches/ipp-20120627/Ohana/src/dvomerge/src/dvoverify_utils.c

    r34116 r34120  
    11# include "dvoverify.h"
     2
     3static int Nfailures = 0;
     4static int NFAILURES = 100;
     5static char **failures = NULL;
     6
     7void InitFailures () {
     8  ALLOCATE (failures, char *, NFAILURES);
     9}
     10
     11void AddFailures (char *filename) {
     12  failures[Nfailures] = strcreate (filename);
     13  Nfailures ++;
     14  CHECK_REALLOCATE (failures, char *, NFAILURES, Nfailures, 100);
     15}
     16
     17char **GetFailures (int *N) {
     18  *N = Nfailures;
     19  return failures;
     20}
    221
    322int dvoverify_single (char *filename) {
     
    4665      case ENOENT:
    4766        if (DEBUG) fprintf (stderr, "file does not exist, skipping %s\n", filename);
     67        if (LIST_MISSING) return FALSE;
    4868        return TRUE;
    4969      case ENOMEM:
Note: See TracChangeset for help on using the changeset viewer.