IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 28959


Ignore:
Timestamp:
Aug 18, 2010, 7:42:49 PM (16 years ago)
Author:
bills
Message:

Changes to support distribution of the "sky" stage (short for staticsky)

Location:
trunk/ippTools
Files:
5 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTools/share/Makefile.am

    r28941 r28959  
    153153        disttool_definebyquery_fake.sql \
    154154        disttool_definebyquery_raw.sql \
     155        disttool_definebyquery_sky.sql \
    155156        disttool_definebyquery_stack.sql \
    156157        disttool_definebyquery_warp.sql \
     
    166167        disttool_pending_fake.sql \
    167168        disttool_pending_raw.sql \
     169        disttool_pending_sky.sql \
    168170        disttool_pending_stack.sql \
    169171        disttool_pending_warp.sql \
     
    328330        staticskytool_definebyquery_select.sql \
    329331        staticskytool_definebyquery_inputs.sql \
     332        staticskytool_export_run.sql \
     333        staticskytool_export_input.sql \
     334        staticskytool_export_result.sql \
    330335        staticskytool_inputs.sql \
    331336        staticskytool_todo.sql \
  • trunk/ippTools/share/disttool_toadvance.sql

    r28733 r28959  
    240240        AND distComponent.fault = 0
    241241UNION
     242-- staticsky stage
     243-- NOTE this assumes that there is only one component per staticskyRun
     244-- (one skycell)
     245SELECT
     246    distRun.dist_id,
     247    stage,
     248    stage_id,
     249    outroot,
     250    label,
     251    clean
     252    FROM distRun
     253    JOIN staticskyResult on stage_id = sky_id
     254    LEFT JOIN distComponent
     255        ON distRun.dist_id = distComponent.dist_id
     256    WHERE
     257        distRun.state = 'new'
     258        AND distRun.fault = 0
     259        AND distRun.stage = 'sky'
     260        AND distComponent.component IS NOT NULL
     261        AND distComponent.fault = 0
     262UNION
    242263-- SSdiff stage
    243264SELECT
  • trunk/ippTools/share/staticskytool_result.sql

    r28091 r28959  
    1 SELECT
     1SELECT DISTINCT
    22    staticskyResult.*,
    33    staticskyRun.state,
    4     staticskyRun.tess_id,
    5     staticskyRun.skycell_id,
    6     staticskyRun.filter,
    74    staticskyRun.workdir,
    85    staticskyRun.label,
     6    stackRun.tess_id,
     7    stackRun.skycell_id,
     8    stackRun.filter
    99FROM staticskyRun
    10 JOIN staticskyResult
    11 USING(stack_id)
     10JOIN staticskyResult USING(sky_id)
     11JOIN staticskyInput USING(sky_id)
     12JOIN stackRun using(stack_id)
  • trunk/ippTools/src/disttool.c

    r28938 r28959  
    329329        // stack stage doesn't require magic
    330330        no_magic = true;
     331    } else if (!strcmp(stage, "sky")) {
     332        magicRunType = "staticskyRun";
     333        query = pxDataGet("disttool_definebyquery_sky.sql");
     334        if (!query) {
     335            psError(PXTOOLS_ERR_SYS, false, "failed to retreive SQL statement");
     336            psFree(where);
     337            return false;
     338        }
     339
     340        if (label) {
     341            psStringAppend(&query, " AND (staticskyRun.label = '%s')", label);
     342        }
     343        if (dist_group) {
     344            psStringAppend(&query, " AND (sticskyRun.dist_group = '%s')", dist_group);
     345        }
     346        // (static)sky stage doesn't require magic
     347        no_magic = true;
    331348    } else if (!strcmp(stage, "SSdiff")) {
    332349      magicRunType = "diffRun";
  • trunk/ippTools/src/staticskytool.c

    r28154 r28959  
    727727bool exportrunMode(pxConfig *config)
    728728{
    729 # if (0)
    730729  typedef struct ExportTable {
    731730    char tableName[80];
     
    737736  PS_ASSERT_PTR_NON_NULL(config, NULL);
    738737
    739   PXOPT_LOOKUP_S64(det_id, config->args, "-stack_id", true,  false);
     738  PXOPT_LOOKUP_S64(det_id, config->args, "-sky_id", true,  false);
    740739  PXOPT_LOOKUP_STR(outfile, config->args, "-outfile", true,  false);
    741740  PXOPT_LOOKUP_BOOL(clean, config->args, "-clean", false);
     
    753752  }
    754753  psMetadata *where = psMetadataAlloc();
    755   PXOPT_COPY_S64(config->args, where, "-stack_id", "stack_id", "==");
     754  PXOPT_COPY_S64(config->args, where, "-sky_id", "sky_id", "==");
    756755
    757756  ExportTable tables [] = {
    758     {"stackRun", "staticskytool_export_run.sql"},
    759     {"stackInputSkyfile", "staticskytool_export_input_skyfile.sql"},
    760     {"stackSumSkyfile", "staticskytool_export_sum_skyfile.sql"},
     757    {"staticskyRun", "staticskytool_export_run.sql"},
     758    {"staticskyInput", "staticskytool_export_input.sql"},
     759    {"staticskyResult", "staticskytool_export_result.sql"},
    761760  };
    762761
     
    800799
    801800    if (clean) {
    802         if (!strcmp(tables[i].tableName, "stackRun")) {
    803             if (!pxSetStateCleaned("stackRun", "state", output)) {
     801        if (!strcmp(tables[i].tableName, "staticskyRun")) {
     802            if (!pxSetStateCleaned("staticskyRun", "state", output)) {
    804803                psFree(output);
    805804                psError(PS_ERR_UNKNOWN, false, "pxSetStateClean failed for table %s",  tables[i].tableName);
     
    821820    fclose (f);
    822821
    823 # endif
    824822    return true;
    825823}
Note: See TracChangeset for help on using the changeset viewer.