Changeset 36546
- Timestamp:
- Feb 25, 2014, 11:25:44 AM (12 years ago)
- Location:
- tags/ipp-20140114
- Files:
-
- 6 added
- 12 edited
-
ippScripts/scripts/dist_bundle.pl (modified) (9 diffs)
-
ippScripts/scripts/ipp_apply_burntool_single.pl (modified) (1 prop)
-
ippScripts/scripts/publish_file.pl (modified) (1 prop)
-
ippScripts/scripts/queuestaticsky.pl (modified) (2 diffs)
-
ippTools/share/Makefile.am (modified) (3 diffs)
-
ippTools/share/disttool_definebyquery_ff.sql (added)
-
ippTools/share/disttool_pending_ff.sql (added)
-
ippTools/share/disttool_toadvance.sql (modified) (1 diff)
-
ippTools/share/fftool_export_input.sql (added)
-
ippTools/share/fftool_export_result.sql (added)
-
ippTools/share/fftool_export_run.sql (added)
-
ippTools/share/fftool_export_summary.sql (added)
-
ippTools/src/disttool.c (modified) (1 diff)
-
ippTools/src/fftool.c (modified) (7 diffs)
-
ippTools/src/fftool.h (modified) (1 diff)
-
ippTools/src/fftoolConfig.c (modified) (2 diffs)
-
ippconfig/recipes/ppSub.config (modified) (1 prop)
-
ippconfig/recipes/reductionClasses.mdc (modified) (1 prop)
Legend:
- Unmodified
- Added
- Removed
-
tags/ipp-20140114/ippScripts/scripts/dist_bundle.pl
r36223 r36546 50 50 'PPSUB.INVERSE.MASK' => 'inv_mask', 51 51 'PPSUB.INVERSE.VARIANCE' => 'inv_variance' ); 52 my %stack_cleaned = ( 'PPSTACK.OUTPUT' => 'image', 52 53 my %stack_cleaned = ( 'PPSTACK.UNCONV' => 'image', 54 'PPSTACK.UNCONV.MASK' => 'mask', 55 'PPSTACK.UNCONV.VARIANCE' => 'variance', 56 'PPSTACK.UNCONV.EXP' => 'exp', 57 'PPSTACK.UNCONV.EXPNUM' => 'expnum', 58 'PPSTACK.UNCONV.EXPWT' => 'expwt' 59 ); 60 61 my %stack_convolved = ( 'PPSTACK.OUTPUT' => 'image', 53 62 'PPSTACK.OUTPUT.MASK' => 'mask', 54 'PPSTACK.OUTPUT.VARIANCE' => 'variance' ); 63 'PPSTACK.OUTPUT.VARIANCE' => 'variance', 64 'PPSTACK.OUTPUT.EXP' => 'exp', 65 'PPSTACK.OUTPUT.EXPNUM' => 'expnum', 66 'PPSTACK.OUTPUT.EXPWT' => 'expwt' 67 ); 55 68 my %empty_cleaned = (); 69 56 70 57 71 … … 136 150 if (($stage ne 'raw') and ($stage ne 'fake') and ($stage ne 'stack_summary') and !$poor_quality) { 137 151 # If the file list is empty it is an error because we should at least get a config dump file 138 # except for fake stage which doesn't do anything yet 152 # except for fake stage which doesn't do anything yet, stack_summary stage, and of course raw files have 153 # no config dump because they aren't processed 139 154 &my_die("empty file list", $component, $PS_EXIT_CONFIG_ERROR) if (!scalar @$file_list); 140 155 } … … 165 180 my $image_type = get_image_type($stage, $file_rule); 166 181 182 # skip useless empty trace files 183 next if ($file_rule =~ /TRACE/); 184 167 185 # if this is an image and we are building a clean bundle or if quality is bad skip this rule 168 186 next if $image_type and ($clean or $poor_quality); 187 188 if ($stage eq 'stack') { 189 # skip convolved stacks since they are deleted just after they are created now 190 next if $stack_convolved{$file_rule}; 191 } 169 192 170 193 # if magic is required, don't ship jpegs or binned fits images … … 180 203 181 204 my $file_name = $file->{name}; 182 my $base = basename($file_name);183 205 my $path = $ipprc->file_resolve($file_name); 206 207 if (!$path and $file_rule =~ /LOG/) { 208 my $compressed_file_name = $file_name . '.bz2'; 209 my $compressed_path = $ipprc->file_resolve($compressed_file_name); 210 if ($compressed_path) { 211 $path = $compressed_path; 212 $file_name = $compressed_file_name; 213 } 214 } 215 184 216 185 217 if (!$path) { … … 194 226 # XXX: perhaps only do this for stages where we know that this happens 195 227 next if $file_rule =~ /STATS/; 196 # don't fail on these "non-essential files" 228 # don't fail if these "non-essential files" are missing 229 next if $file_rule =~ /LOG/; 197 230 next if $file_rule =~ /TRACE/; 198 next if $file_rule =~ /LOG/;199 231 next if $file_rule =~ /BIN/; 200 232 … … 236 268 # create a symbolic link from the file in the nebulous repository 237 269 # in the temporary directory 238 symlink $path, "$tmpdir/ $base";270 symlink $path, "$tmpdir/" . basename($file_name); 239 271 } 240 272 } … … 464 496 } elsif ($stage eq "stack") { 465 497 $type = $stack_cleaned{$rule}; 466 } elsif ($stage eq "sky" or $stage eq 'skycal' or $stage eq 'stack_summary' ) {498 } elsif ($stage eq "sky" or $stage eq 'skycal' or $stage eq 'stack_summary' or $stage eq 'ff') { 467 499 $type = $empty_cleaned{$rule}; 468 500 } else { … … 556 588 # stack_summary stage does not use a config dump file. 557 589 return build_stack_summary_file_list($path_base, \@file_list); 590 } elsif ($stage eq "ff") { 591 if ($component eq 'summary') { 592 # full force summary does not use a config dump file. Cobble together a file list 593 return build_ff_summary_file_list($path_base, \@file_list); 594 } else { 595 $config_file_rule = "PSPHOT.SKY.CONFIG"; 596 } 558 597 } else { 559 598 &my_die("$stage is not a valid stage", $component, $PS_EXIT_CONFIG_ERROR); … … 710 749 } 711 750 751 # psphotFullForceSummary does not produce a config dump file cobble together a file list 752 sub build_ff_summary_file_list { 753 my ($path_base, $file_list) = @_; 754 755 my %cmf ; 756 $cmf{file_rule} = "SOURCES"; 757 $cmf{name} = "$path_base.cmf"; 758 push @$file_list, \%cmf; 759 760 my %log; 761 $log{file_rule} = "LOG"; 762 $log{name} = "$path_base.log"; 763 push @$file_list, \%log; 764 765 return $file_list; 766 } 767 712 768 sub my_die 713 769 { -
tags/ipp-20140114/ippScripts/scripts/ipp_apply_burntool_single.pl
- Property svn:mergeinfo changed
/trunk/ippScripts/scripts/ipp_apply_burntool_single.pl merged: 36455
- Property svn:mergeinfo changed
-
tags/ipp-20140114/ippScripts/scripts/publish_file.pl
- Property svn:mergeinfo changed
/trunk/ippScripts/scripts/publish_file.pl merged: 36455
- Property svn:mergeinfo changed
-
tags/ipp-20140114/ippScripts/scripts/queuestaticsky.pl
r35329 r36546 33 33 }; 34 34 35 # don't update the database if we are pretending 36 $no_update = 1 if $pretend; 35 37 36 38 my $missing_tools; … … 113 115 } 114 116 } 117 last if $pretend; # only do the first (full) set if we are in pretend mode 115 118 } 116 119 { -
tags/ipp-20140114/ippTools/share/Makefile.am
r36441 r36546 189 189 disttool_definebyquery_diff.sql \ 190 190 disttool_definebyquery_fake.sql \ 191 disttool_definebyquery_ff.sql \ 191 192 disttool_definebyquery_raw.sql \ 192 193 disttool_definebyquery_raw_no_magic.sql \ … … 206 207 disttool_pending_diff.sql \ 207 208 disttool_pending_fake.sql \ 209 disttool_pending_ff.sql \ 208 210 disttool_pending_raw.sql \ 209 211 disttool_pending_sky.sql \ … … 496 498 fftool_summary.sql \ 497 499 fftool_todo.sql \ 498 fftool_toadvance.sql 500 fftool_toadvance.sql \ 501 fftool_export_run.sql \ 502 fftool_export_input.sql \ 503 fftool_export_result.sql \ 504 fftool_export_summary.sql 499 505 506 -
tags/ipp-20140114/ippTools/share/disttool_toadvance.sql
r35960 r36546 308 308 COUNT(diffSkyfile.skycell_id) = COUNT(distComponent.component) 309 309 AND SUM(distComponent.fault) = 0 310 UNION 311 -- ff stage 312 SELECT 313 distRun.dist_id, 314 stage, 315 stage_id, 316 outroot, 317 distRun.label, 318 clean 319 -- ,COUNT(warp_id) 320 -- ,COUNT(ff_id) 321 FROM distRun 322 JOIN fullForceRun ON stage_id = ff_id 323 JOIN fullForceResult USING(ff_id) 324 JOIN skycalRun USING(skycal_id) 325 JOIN stackRun USING(stack_id) 326 LEFT JOIN distComponent 327 ON distRun.dist_id = distComponent.dist_id 328 AND distComponent.component = CONCAT_WS('.', warp_id, stackRun.skycell_id) 329 WHERE 330 distRun.state = 'new' 331 AND distRun.fault = 0 332 AND distRun.stage = 'ff' 333 GROUP BY 334 distRun.dist_id, 335 ff_id 336 HAVING 337 -- number of dist components is the number of warps plus 1 (for the summary component) 338 COUNT(fullForceResult.ff_id) = COUNT(distComponent.component) 339 AND SUM(distComponent.fault) = 0 310 340 ) as Foo -
tags/ipp-20140114/ippTools/src/disttool.c
r36248 r36546 413 413 414 414 magic = false; 415 } else if (!strcmp(stage, "ff")) { 416 runJoinStr = "fullForceRun.ff_id"; 417 query = pxDataGet("disttool_definebyquery_ff.sql"); 418 if (!query) { 419 psError(PXTOOLS_ERR_SYS, false, "failed to retrieve SQL statement"); 420 psFree(where); 421 return(false); 422 } 423 424 if (label) { 425 psStringAppend(&query, " AND (fullForceRun.label = '%s') ", label); 426 } 427 if (dist_group) { 428 psStringAppend(&query, " AND (fullForceRun.dist_group = '%s') ", dist_group); 429 } 430 431 magic = false; 415 432 } else { 416 433 psError(PS_ERR_UNKNOWN, true, "unknown value for stage: %s", stage); -
tags/ipp-20140114/ippTools/src/fftool.c
r36441 r36546 44 44 static bool updatesummaryMode(pxConfig *config); 45 45 static bool summaryMode(pxConfig *config); 46 static bool exportrunMode(pxConfig *config); 47 static bool importrunMode(pxConfig *config); 48 static bool summaryMode(pxConfig *config); 46 49 47 50 static bool setfullForceRunState(pxConfig *config, psS64 sky_id, const char *state); … … 77 80 MODECASE(FFTOOL_MODE_UPDATESUMMARY, updatesummaryMode); 78 81 MODECASE(FFTOOL_MODE_SUMMARY, summaryMode); 82 MODECASE(FFTOOL_MODE_EXPORTRUN, exportrunMode); 83 MODECASE(FFTOOL_MODE_IMPORTRUN, importrunMode); 79 84 default: 80 85 psAbort("invalid option (this should not happen)"); … … 134 139 135 140 psMetadata *warpWhereMD = psMetadataAlloc(); 136 pxAddLabelSearchArgs(config, warpWhereMD, "-select_warp_label", " warpRun.label", "LIKE");137 pxAddLabelSearchArgs(config, warpWhereMD, "-select_warp_data_group"," warpRun.data_group", "LIKE");138 PXOPT_COPY_S64(config->args, warpWhereMD, "-select_warp_id", " warpRun.warp_id", "==");141 pxAddLabelSearchArgs(config, warpWhereMD, "-select_warp_label", "fullForceRun.label", "LIKE"); 142 pxAddLabelSearchArgs(config, warpWhereMD, "-select_warp_data_group","fullForceRun.data_group", "LIKE"); 143 PXOPT_COPY_S64(config->args, warpWhereMD, "-select_warp_id", "fullForceRun.warp_id", "=="); 139 144 if (!psListLength(warpWhereMD->list)) { 140 145 psError(PXTOOLS_ERR_CONFIG, false, "warp search parameters are required"); … … 150 155 } 151 156 152 PXOPT_COPY_STR(config->args, warpWhereMD, "-select_tess_id", " warpRun.tess_id", "==");153 pxAddLabelSearchArgs(config, warpWhereMD, "-select_filter", " warpRun.filter", "LIKE");157 PXOPT_COPY_STR(config->args, warpWhereMD, "-select_tess_id", "fullForceRun.tess_id", "=="); 158 pxAddLabelSearchArgs(config, warpWhereMD, "-select_filter", "fullForceRun.filter", "LIKE"); 154 159 if (!pxskycellAddWhere(config, warpWhereMD)) { 155 160 psError(PXTOOLS_ERR_CONFIG, false, "failed to add skycell search arguments"); … … 504 509 PXOPT_COPY_STR(config->args, where, "-tess_id", "stackRun.tess_id", "LIKE"); 505 510 PXOPT_COPY_STR(config->args, where, "-skycell_id", "stackRun.skycell_id", "LIKE"); 511 PXOPT_COPY_STR(config->args, where, "-filter", "stackRun.filter", "LIKE"); 506 512 PXOPT_COPY_S16(config->args, where, "-fault", "staticskyResult.fault", "=="); 507 513 pxskycellAddWhere(config, where); … … 864 870 PXOPT_COPY_STR(config->args, where, "-tess_id", "stackRun.tess_id", "LIKE"); 865 871 PXOPT_COPY_STR(config->args, where, "-skycell_id", "stackRun.skycell_id", "LIKE"); 872 PXOPT_COPY_STR(config->args, where, "-filter", "stackRun.filter", "LIKE"); 866 873 PXOPT_COPY_S16(config->args, where, "-fault", "staticskyResult.fault", "=="); 867 874 pxskycellAddWhere(config, where); … … 933 940 return true; 934 941 } 942 943 bool exportrunMode(pxConfig *config) 944 { 945 typedef struct ExportTable { 946 char tableName[80]; 947 char sqlFilename[80]; 948 } ExportTable; 949 950 PS_ASSERT_PTR_NON_NULL(config, NULL); 951 952 // PXOPT_LOOKUP_S64(det_id, config->args, "-warp_id", true, false); 953 PXOPT_LOOKUP_STR(outfile, config->args, "-outfile", true, false); 954 PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false); 955 // PXOPT_LOOKUP_BOOL(clean, config->args, "-clean", false); 956 957 FILE *f = fopen (outfile, "w"); 958 if (f == NULL) { 959 psError(PS_ERR_UNKNOWN, false, "failed to open output file"); 960 return false; 961 } 962 963 if (!pxExportVersion(config, f)) { 964 psError(PS_ERR_UNKNOWN, false, "failed to write dbversion output file"); 965 return false; 966 } 967 psMetadata *where = psMetadataAlloc(); 968 PXOPT_COPY_S64(config->args, where, "-ff_id", "ff_id", "=="); 969 970 ExportTable tables [] = { 971 {"fullForceRun", "fftool_export_run.sql"}, 972 {"fullForceInput", "fftool_export_input.sql"}, 973 {"fullForceResult", "fftool_export_result.sql"}, 974 {"fullForceSummary", "fftool_export_summary.sql"}, 975 }; 976 977 int numTables = sizeof(tables)/sizeof(tables[0]); 978 979 for (int i=0; i < numTables; i++) { 980 psString query = pxDataGet(tables[i].sqlFilename); 981 if (!query) { 982 psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement"); 983 return false; 984 } 985 986 if (where && psListLength(where->list)) { 987 psString whereClause = psDBGenerateWhereSQL(where, NULL); 988 psStringAppend(&query, " %s", whereClause); 989 psFree(whereClause); 990 } 991 992 // treat limit == 0 as "no limit" 993 if (limit) { 994 psString limitString = psDBGenerateLimitSQL(limit); 995 psStringAppend(&query, " %s", limitString); 996 psFree(limitString); 997 } 998 999 if (!p_psDBRunQuery(config->dbh, query)) { 1000 psError(PS_ERR_UNKNOWN, false, "database error"); 1001 psFree(query); 1002 return false; 1003 } 1004 psFree(query); 1005 1006 psArray *output = p_psDBFetchResult(config->dbh); 1007 if (!output) { 1008 psError(PS_ERR_UNKNOWN, false, "database error"); 1009 return false; 1010 } 1011 if (!psArrayLength(output)) { 1012 psError(PS_ERR_UNKNOWN, true, "no rows found"); 1013 psFree(output); 1014 return false; 1015 } 1016 1017 // we must write the export table in non-simple (true) format 1018 if (!ippdbPrintMetadatas(f, output, tables[i].tableName, true)) { 1019 psError(PS_ERR_UNKNOWN, false, "failed to print array"); 1020 psFree(output); 1021 return false; 1022 } 1023 psFree(output); 1024 } 1025 1026 fclose (f); 1027 1028 return true; 1029 } 1030 1031 bool importrunMode(pxConfig *config) 1032 { 1033 unsigned int nFail; 1034 1035 int numImportTables = 3; 1036 1037 char tables[3] [80] = {"fullForceInput", "fullForceResult", "fullForceSummary"}; 1038 1039 PS_ASSERT_PTR_NON_NULL(config, NULL); 1040 1041 PXOPT_LOOKUP_STR(infile, config->args, "-infile", true, false); 1042 1043 psMetadata *input = psMetadataConfigRead (NULL, &nFail, infile, false); 1044 1045 #ifdef notdef 1046 fprintf (stderr, "---- input ----\n"); 1047 psMetadataPrint (stderr, input, 1); 1048 #endif 1049 1050 if (!pxCheckImportVersion(config, input)) { 1051 psError(PS_ERR_UNKNOWN, false, "pxCheckImportVersion failed"); 1052 return false; 1053 } 1054 1055 psMetadataItem *item = psMetadataLookup (input, "fullForceRun"); 1056 psAssert (item, "entry not in input?"); 1057 psAssert (item->type == PS_DATA_METADATA_MULTI, "entry not multi?"); 1058 1059 psMetadataItem *entry = psListGet (item->data.list, 0); 1060 assert (entry); 1061 assert (entry->type == PS_DATA_METADATA); 1062 fullForceRunRow *fullForceRun = fullForceRunObjectFromMetadata (entry->data.md); 1063 fullForceRunInsertObject (config->dbh, fullForceRun); 1064 1065 // fprintf (stdout, "---- warp run ----\n"); 1066 // psMetadataPrint (stderr, entry->data.md, 1); 1067 1068 for (int i = 0; i < numImportTables; i++) { 1069 item = psMetadataLookup (input, tables[i]); 1070 psAssert (item, "entry not in input?"); 1071 psAssert (item->type == PS_DATA_METADATA_MULTI, "entry not multi?"); 1072 1073 switch (i) { 1074 case 0: 1075 for (int i = 0; i < item->data.list->n; i++) { 1076 entry = psListGet (item->data.list, i); 1077 assert (entry); 1078 assert (entry->type == PS_DATA_METADATA); 1079 fullForceInputRow *fullForceInput = fullForceInputObjectFromMetadata (entry->data.md); 1080 fullForceInputInsertObject (config->dbh, fullForceInput); 1081 1082 // fprintf (stdout, "---- row %d ----\n", i); 1083 // psMetadataPrint (stderr, entry->data.md, 1); 1084 } 1085 break; 1086 1087 case 1: 1088 for (int i = 0; i < item->data.list->n; i++) { 1089 entry = psListGet (item->data.list, i); 1090 assert (entry); 1091 assert (entry->type == PS_DATA_METADATA); 1092 fullForceResultRow *fullForceResult = fullForceResultObjectFromMetadata (entry->data.md); 1093 fullForceResultInsertObject (config->dbh, fullForceResult); 1094 1095 // fprintf (stdout, "---- row %d ----\n", i); 1096 // psMetadataPrint (stderr, entry->data.md, 1); 1097 } 1098 break; 1099 1100 case 2: 1101 for (int i = 0; i < item->data.list->n; i++) { 1102 entry = psListGet (item->data.list, i); 1103 assert (entry); 1104 assert (entry->type == PS_DATA_METADATA); 1105 fullForceSummaryRow *fullForceSummary = fullForceSummaryObjectFromMetadata (entry->data.md); 1106 fullForceSummaryInsertObject (config->dbh, fullForceSummary); 1107 1108 // fprintf (stdout, "---- row %d ----\n", i); 1109 // psMetadataPrint (stderr, entry->data.md, 1); 1110 } 1111 break; 1112 } 1113 } 1114 return true; 1115 } -
tags/ipp-20140114/ippTools/src/fftool.h
r36441 r36546 36 36 FFTOOL_MODE_REVERTSUMMARY, 37 37 FFTOOL_MODE_UPDATESUMMARY, 38 FFTOOL_MODE_SUMMARY 38 FFTOOL_MODE_SUMMARY, 39 FFTOOL_MODE_EXPORTRUN, 40 FFTOOL_MODE_IMPORTRUN, 39 41 } fftoolMode; 40 42 -
tags/ipp-20140114/ippTools/src/fftoolConfig.c
r36441 r36546 186 186 pxskycellAddArguments(revertsummaryArgs); 187 187 188 // -exportrun 189 psMetadata *exportrunArgs = psMetadataAlloc(); 190 psMetadataAddS64(exportrunArgs, PS_LIST_TAIL, "-ff_id", 0, "export this full force ID (required)", 0); 191 psMetadataAddStr(exportrunArgs, PS_LIST_TAIL, "-outfile", 0, "export to this file (required)", NULL); 192 psMetadataAddU64(exportrunArgs, PS_LIST_TAIL, "-limit", 0, "limit result set to N items", 0); 193 // psMetadataAddBool(exportrunArgs, PS_LIST_TAIL, "-clean", 0, "export run in cleaned state", false); 194 195 // -importrun 196 psMetadata *importrunArgs = psMetadataAlloc(); 197 psMetadataAddStr(importrunArgs, PS_LIST_TAIL, "-infile", 0, "import from this file (required)", NULL); 198 199 200 188 201 psFree(now); 189 202 … … 203 216 PXOPT_ADD_MODE("-revertsummary", "revert faulted summary", FFTOOL_MODE_REVERTSUMMARY, revertsummaryArgs); 204 217 PXOPT_ADD_MODE("-summary", "list summary results", FFTOOL_MODE_SUMMARY, summaryArgs); 218 PXOPT_ADD_MODE("-exportrun", "list summary results", FFTOOL_MODE_EXPORTRUN, exportrunArgs); 219 PXOPT_ADD_MODE("-importrun", "list summary results", FFTOOL_MODE_IMPORTRUN, importrunArgs); 205 220 206 221 if (!pxGetOptions(stderr, argc, argv, config, modes, argSets)) { -
tags/ipp-20140114/ippconfig/recipes/ppSub.config
- Property svn:mergeinfo changed
/trunk/ippconfig/recipes/ppSub.config merged: 36454
- Property svn:mergeinfo changed
-
tags/ipp-20140114/ippconfig/recipes/reductionClasses.mdc
- Property svn:mergeinfo changed
/trunk/ippconfig/recipes/reductionClasses.mdc merged: 36454
- Property svn:mergeinfo changed
Note:
See TracChangeset
for help on using the changeset viewer.
