Changeset 37938 for trunk/ippTools/src/difftool.c
- Timestamp:
- Feb 26, 2015, 3:53:04 PM (11 years ago)
- File:
-
- 1 edited
-
trunk/ippTools/src/difftool.c (modified) (9 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/ippTools/src/difftool.c
r37900 r37938 42 42 static bool definepoprunMode(pxConfig *config); 43 43 static bool definewarpstackMode(pxConfig *config); 44 static bool definewarpstackOldMethodMode(pxConfig *config); 44 45 static bool definewarpwarpMode(pxConfig *config); 45 46 static bool definestackstackMode(pxConfig *config); … … 95 96 MODECASE(DIFFTOOL_MODE_DEFINEPOPRUN, definepoprunMode); 96 97 MODECASE(DIFFTOOL_MODE_DEFINEWARPSTACK, definewarpstackMode); 98 MODECASE(DIFFTOOL_MODE_DEFINEWARPSTACKOLDMETHOD, definewarpstackOldMethodMode); 97 99 MODECASE(DIFFTOOL_MODE_DEFINEWARPWARP, definewarpwarpMode); 98 100 MODECASE(DIFFTOOL_MODE_DEFINESTACKSTACK, definestackstackMode); … … 1250 1252 } 1251 1253 1252 1254 PXOPT_LOOKUP_BOOL(available, config->args, "-available", false); 1253 1255 PXOPT_LOOKUP_BOOL(bothways, config->args, "-bothways", false); 1254 1256 … … 1334 1336 return true; 1335 1337 } 1338 1339 // Do a pass through the result list to determine which runs should be excluded. 1340 // This exclusion should do two things: If a skycell doesn't have a stack (as we do a LEFT JOIN) now, 1341 // then that skycell needs to not be included in the diff. However, if we have available off, 1342 // then we need to flag the entire exposure as bad. 1343 psS64 previous_exp_id = 0; 1344 long start_index = 0; 1345 bool bad_exposure = false; 1346 long Nskycells = 0; 1347 for (long i = 0; i < output->n; i++) { 1348 psMetadata *row = output->data[i]; 1349 bool mdok; 1350 psS64 exp_id = psMetadataLookupS64(&mdok, row, "exp_id"); 1351 if (!mdok) { 1352 psError(PXTOOLS_ERR_PROG, false, "exp_id not found"); 1353 if (!psDBRollback(config->dbh)) { 1354 psError(PS_ERR_UNKNOWN, false, "database error"); 1355 } 1356 return false; 1357 } 1358 1359 if (exp_id != previous_exp_id) { // Save the position of the start of this exposure. 1360 if (Nskycells == 0) { // Ooops, we didn't find any good skycells for this exposure. Don't make an empty run. 1361 for (long j = start_index; j < i; j++) { // Clear all the previous entries for this exposure. 1362 psMetadata *old_row = output->data[j]; 1363 psMetadataAddBool(old_row,PS_LIST_TAIL, "exclude", PS_META_REPLACE, "", true); // No stack exists, so this row can't be diffed. 1364 psMetadataAddBool(old_row,PS_LIST_TAIL, "excludeExp", PS_META_REPLACE, "", true); // No stack exists, so this row can't be diffed. 1365 } 1366 } 1367 previous_exp_id = exp_id; 1368 start_index = i; 1369 bad_exposure = false; 1370 Nskycells = 0; 1371 } 1372 1373 if (bad_exposure) { // We've flagged this exposure as bad. 1374 psMetadataAddBool(row,PS_LIST_TAIL, "exclude", PS_META_REPLACE, "", true); 1375 psMetadataAddBool(row,PS_LIST_TAIL, "excludeExp", PS_META_REPLACE, "", true); 1376 continue; 1377 } 1378 1379 psMetadataAddBool(row,PS_LIST_TAIL, "exclude", PS_META_REPLACE, "", false); // By default, this shouldn't be excluded. 1380 psMetadataAddBool(row,PS_LIST_TAIL, "excludeExp", PS_META_REPLACE, "", false); 1381 1382 psS64 stack_id = psMetadataLookupS64(&mdok, row, "stack_id"); 1383 if (stack_id == PS_MAX_S64) { // stack_id IS NULL, we cannot make this skycell-level diff 1384 psMetadataAddBool(row,PS_LIST_TAIL, "exclude", PS_META_REPLACE, "", true); // No stack exists, so this row can't be diffed. 1385 1386 if (!available) { // We want to be strict about everything, so cancel this entire exposure. 1387 bad_exposure = true; // New exposures with this exp_id will be flagged as bad. 1388 for (long j = start_index; j < i; j++) { // Clear all the previous entries for this exposure. 1389 psMetadata *old_row = output->data[j]; 1390 psMetadataAddBool(old_row,PS_LIST_TAIL, "exclude", PS_META_REPLACE, "", true); // No stack exists, so this row can't be diffed. 1391 psMetadataAddBool(old_row,PS_LIST_TAIL, "excludeExp", PS_META_REPLACE, "", true); // No stack exists, so this row can't be diffed. 1392 } 1393 } 1394 } 1395 else { // This looks fine. 1396 Nskycells++; 1397 } 1398 } 1399 1400 1401 1336 1402 if (pretend) { 1337 1403 // negative simple so the default is true … … 1385 1451 return false; 1386 1452 } 1453 } 1454 1455 // Do exposure level exclusion here. 1456 bool excludeExp = psMetadataLookupBool(&mdok, row, "excludeExp"); 1457 if (!mdok) { 1458 psError(PXTOOLS_ERR_PROG, false, "excludeExp not found"); 1459 if (!psDBRollback(config->dbh)) { 1460 psError(PS_ERR_UNKNOWN, false, "database error"); 1461 } 1462 return false; 1463 } 1464 if (excludeExp) { // The pre-scan determined that no diff should be made for this exposure. 1465 continue; 1387 1466 } 1388 1467 … … 1441 1520 1442 1521 if (exp_id == last_exp_id) { 1522 bool exclude = psMetadataLookupBool(&mdok, row, "exclude"); 1523 if (!mdok) { 1524 psError(PXTOOLS_ERR_PROG, false, "exclude not found"); 1525 if (!psDBRollback(config->dbh)) { 1526 psError(PS_ERR_UNKNOWN, false, "database error"); 1527 } 1528 return false; 1529 } 1530 if (exclude) { // skip this skycell, as we probably don't have a diff. 1531 continue; 1532 } 1443 1533 psString skycell_id = psMetadataLookupStr(&mdok, row, "skycell_id"); 1444 1534 if (!mdok) { … … 1524 1614 } 1525 1615 1526 #if (0) 1527 static bool definewarpstack Mode(pxConfig *config)1616 1617 static bool definewarpstackOldMethodMode(pxConfig *config) 1528 1618 { 1529 1619 PS_ASSERT_PTR_NON_NULL(config, false); … … 1806 1896 } 1807 1897 1898 // CZW force available off. If we're using this very-expensive mode, we need to get the one thing it does correctly. 1899 available = false;; 1808 1900 if (!available && (num != skycell_count)) { 1809 1901 psTrace("difftool", PS_LOG_INFO, "%" PRId64 " skyfiles with stack found for warp_id %" PRId64 … … 1913 2005 return true; 1914 2006 } 1915 #endif 2007 1916 2008 1917 2009 static bool definewarpwarpMode(pxConfig *config)
Note:
See TracChangeset
for help on using the changeset viewer.
