Changeset 11981
- Timestamp:
- Feb 21, 2007, 3:09:18 PM (19 years ago)
- Location:
- trunk/ippTools/src
- Files:
-
- 2 edited
-
warptool.c (modified) (9 diffs)
-
warptoolConfig.c (modified) (1 diff)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/warptool.c
r11973 r11981 46 46 static bool setp4RunState(pxConfig *config, const char *p4_id, const char *state); 47 47 static bool isValidMode(pxConfig *config, const char *mode); 48 bool p4CompletedRuns(pxConfig *config); 48 49 49 50 # define MODECASE(caseName, func) \ … … 611 612 psMetadataItem *item = NULL; 612 613 psMetadataIterator *iter = psMetadataIteratorAlloc(skycells, 0, NULL); 613 if((item = psMetadataGetAndIncrement(iter))) {614 while ((item = psMetadataGetAndIncrement(iter))) { 614 615 if (item->type != PS_DATA_METADATA) { 615 616 psError(PS_ERR_UNKNOWN, false, "mapfile: %s is in the wrong format", mapfile); … … 761 762 " USING(p4_id)\n" 762 763 " LEFT JOIN p4Scfile\n" 763 " USING(p4_id, skycell_id, tess_id , exp_tag, p3_version)\n"764 " USING(p4_id, skycell_id, tess_id)\n" 764 765 " WHERE\n" 765 766 " p4Run.state = 'run'\n" … … 767 768 " AND p4Scfile.skycell_id IS NULL\n" 768 769 " AND p4Scfile.tess_id IS NULL\n" 769 " AND p4Scfile.exp_tag IS NULL\n"770 " AND p4Scfile.p3_version IS NULL\n"771 770 ); 772 771 … … 871 870 } 872 871 873 psString exp_tag = psMetadataLookupStr(&status, config->args, "-exp_tag");874 if (!status) {875 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -exp_tag");876 return false;877 }878 if (!exp_tag) {879 psError(PS_ERR_UNKNOWN, true, "-exp_tag is required");880 return false;881 }882 883 872 psString uri = psMetadataLookupStr(&status, config->args, "-uri"); 884 873 if (!status) { … … 891 880 } 892 881 893 // defaults to 0894 psS32 p3_version = psMetadataLookupS32(&status, config->args, "-p3_version");895 if (!status) {896 psError(PS_ERR_UNKNOWN, false, "failed to lookup value for -p3_version");897 return false;898 }899 900 882 // optional 901 883 psF64 bg = psMetadataLookupF64(&status, config->args, "-bg"); … … 911 893 } 912 894 895 // we don't want to insert the last scfile in a run but then not mark the 896 // run as 'stop' 897 if (!psDBTransaction(config->dbh)) { 898 psError(PS_ERR_UNKNOWN, false, "database error"); 899 return false; 900 } 913 901 914 902 // XXX need to validate that this coresponds to an p4InputImfile … … 917 905 skycell_id, 918 906 tess_id, 919 exp_tag,920 p3_version,921 907 uri, 922 908 bg, … … 927 913 } 928 914 929 return true; 930 } 931 915 if (!p4CompletedRuns(config)) { 916 psError(PS_ERR_UNKNOWN, false, "database error"); 917 return false; 918 } 919 920 // point of no return 921 if (!psDBCommit(config->dbh)) { 922 psError(PS_ERR_UNKNOWN, false, "database error"); 923 return false; 924 } 925 926 return true; 927 } 928 929 bool p4CompletedRuns(pxConfig *config) 930 { 931 PS_ASSERT_PTR_NON_NULL(config, false); 932 933 // find 934 psString query = psStringCopy( 935 "UPDATE p4Run\n" 936 " SET p4Run.state = 'stop'\n" 937 " WHERE\n" 938 " p4Run.p4_id =\n" 939 " (SELECT DISTINCT\n" 940 " p4_id\n" 941 " FROM\n" 942 " (SELECT DISTINCT\n" 943 " p4Run.p4_id,\n" 944 " p4SkyCellMap.p4_id as foo,\n" 945 " p4Scfile.p4_id as bar\n" 946 " FROM p4Run\n" 947 " JOIN p4SkyCellMap\n" 948 " USING(p4_id)\n" 949 " LEFT JOIN p4Scfile\n" 950 " USING(p4_id, skycell_id, tess_id)\n" 951 " WHERE\n" 952 " p4Run.state = 'run'\n" 953 " GROUP BY\n" 954 " p4Run.p4_id\n" 955 " HAVING\n" 956 " COUNT(p4SkyCellMap.p4_id) = COUNT(p4Scfile.p4_id)\n" 957 " ) as Foo\n" 958 " )\n" 959 ); 960 961 if (!p_psDBRunQuery(config->dbh, query)) { 962 psError(PS_ERR_UNKNOWN, false, "database error"); 963 psFree(query); 964 return false; 965 } 966 967 psFree(query); 968 969 return true; 970 } 932 971 933 972 static bool warpedMode(pxConfig *config) -
trunk/ippTools/src/warptoolConfig.c
r11852 r11981 151 151 psMetadataAddStr(addwarpedArgs, PS_LIST_TAIL, "-tess_id", 0, 152 152 "define tessellation ID (required)", NULL); 153 psMetadataAddStr(addwarpedArgs, PS_LIST_TAIL, "-exp_tag", 0,154 "define exposure tag (required)", NULL);155 psMetadataAddS32(addwarpedArgs, PS_LIST_TAIL, "-p3_version", 0,156 "define phase 3 version of exposure tag (required)", 0);157 153 psMetadataAddStr(addwarpedArgs, PS_LIST_TAIL, "-uri", 0, 158 154 "define URI of file (required)", 0);
Note:
See TracChangeset
for help on using the changeset viewer.
