Changeset 34120
- Timestamp:
- Jul 5, 2012, 9:12:47 AM (14 years ago)
- Location:
- branches/eam_branches/ipp-20120627/Ohana/src/dvomerge
- Files:
-
- 6 edited
-
include/dvoverify.h (modified) (2 diffs)
-
src/dvoverify.c (modified) (1 diff)
-
src/dvoverify_args.c (modified) (4 diffs)
-
src/dvoverify_catalogs.c (modified) (7 diffs)
-
src/dvoverify_client.c (modified) (1 diff)
-
src/dvoverify_utils.c (modified) (2 diffs)
Legend:
- Unmodified
- Added
- Removed
-
branches/eam_branches/ipp-20120627/Ohana/src/dvomerge/include/dvoverify.h
r34116 r34120 34 34 int NNotSorted; 35 35 int CHECK_TOPLEVEL; 36 int LIST_MISSING; 36 37 37 38 SkyRegion UserPatch; … … 48 49 int CheckCatalogIndexes (char *filename, SkyRegion *region); 49 50 51 void InitFailures (); 52 void AddFailures (char *filename); 53 char **GetFailures (int *N); -
branches/eam_branches/ipp-20120627/Ohana/src/dvomerge/src/dvoverify.c
r34116 r34120 50 50 dvoverify_catalogs (skylist, &Nbad); 51 51 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 52 60 if (Nbad > 0) { 53 61 fprintf (stderr, "ERROR: %d files are bad\n", Nbad); -
branches/eam_branches/ipp-20120627/Ohana/src/dvomerge/src/dvoverify_args.c
r34116 r34120 5 5 int N; 6 6 7 VERBOSE = FALSE;8 CHECKSORTED = FALSE;9 7 NNotSorted = 0; 10 8 9 VERBOSE = FALSE; 11 10 if ((N = get_argument (*argc, argv, "-v"))) { 12 11 VERBOSE = TRUE; … … 17 16 remove_argument (N, argc, argv); 18 17 } 18 19 CHECKSORTED = FALSE; 19 20 if ((N = get_argument (*argc, argv, "-s"))) { 20 21 CHECKSORTED = TRUE; … … 23 24 if ((N = get_argument (*argc, argv, "-sorted"))) { 24 25 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; 25 32 remove_argument (N, argc, argv); 26 33 } … … 126 133 } 127 134 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 128 141 // restrict to a portion of the sky 129 142 UserPatch.Rmin = 0; -
branches/eam_branches/ipp-20120627/Ohana/src/dvomerge/src/dvoverify_catalogs.c
r34116 r34120 5 5 int i; 6 6 char filename[DVO_MAX_PATH]; 7 8 InitFailures (); 7 9 8 10 if (PARALLEL && !HOST_ID) { … … 29 31 Nbad ++; 30 32 skipIndexCheck = TRUE; 33 AddFailures (filename); 31 34 } 32 35 … … 34 37 if (!VerifyTableFile (filename)) { 35 38 Nbad ++; 39 AddFailures (filename); 36 40 } 37 41 … … 40 44 Nbad ++; 41 45 skipIndexCheck = TRUE; 46 AddFailures (filename); 42 47 } 43 48 … … 46 51 if (!CheckCatalogIndexes(filename, skylist[0].regions[i])){ 47 52 Nbad ++; 53 AddFailures (filename); 48 54 } 49 55 } … … 94 100 95 101 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); } 98 105 99 106 fprintf (stderr, "command: %s\n", command); … … 131 138 for (i = 0; i < table->Nhosts; i++) { 132 139 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 } 134 144 fscanf (results, "%*s %d %*s %d", &NbadHost, &NNotSortedHost); 135 145 *Nbad += NbadHost; -
branches/eam_branches/ipp-20120627/Ohana/src/dvomerge/src/dvoverify_client.c
r34116 r34120 21 21 dvoverify_catalogs (skylist, &Nbad); 22 22 23 // write result to file 23 24 FILE *results = fopen (RESULTS, "w"); 24 25 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 } 25 33 fclose (results); 26 27 // write result to file28 34 29 35 if (Nbad > 0) { -
branches/eam_branches/ipp-20120627/Ohana/src/dvomerge/src/dvoverify_utils.c
r34116 r34120 1 1 # include "dvoverify.h" 2 3 static int Nfailures = 0; 4 static int NFAILURES = 100; 5 static char **failures = NULL; 6 7 void InitFailures () { 8 ALLOCATE (failures, char *, NFAILURES); 9 } 10 11 void AddFailures (char *filename) { 12 failures[Nfailures] = strcreate (filename); 13 Nfailures ++; 14 CHECK_REALLOCATE (failures, char *, NFAILURES, Nfailures, 100); 15 } 16 17 char **GetFailures (int *N) { 18 *N = Nfailures; 19 return failures; 20 } 2 21 3 22 int dvoverify_single (char *filename) { … … 46 65 case ENOENT: 47 66 if (DEBUG) fprintf (stderr, "file does not exist, skipping %s\n", filename); 67 if (LIST_MISSING) return FALSE; 48 68 return TRUE; 49 69 case ENOMEM:
Note:
See TracChangeset
for help on using the changeset viewer.
