IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 25429


Ignore:
Timestamp:
Sep 17, 2009, 10:04:08 AM (17 years ago)
Author:
bills
Message:

Speed up disttool -pendingcomponent by having separate queries for each stage.

Location:
trunk
Files:
7 added
1 deleted
4 edited

Legend:

Unmodified
Added
Removed
  • trunk/ippTasks/dist.pro

    r25113 r25429  
    1616$distQueue_DB = 0
    1717
     18### list of stages
     19#list of stages
     20$STAGE:n = 0
     21list STAGE -add "raw"
     22list STAGE -add "chip"
     23list STAGE -add "camera"
     24list STAGE -add "fake"
     25list STAGE -add "warp"
     26list STAGE -add "diff"
     27list STAGE -add "stack"
     28
     29$currentStage = 0
     30
    1831### Check status of tasks
    1932macro dist.status
     
    7891
    7992  task.exec
    80     $run = disttool -pendingcomponent
     93    $run = disttool -pendingcomponent -stage $STAGE:$currentStage
     94    $currentStage ++
     95    if ($currentStage >= $STAGE:n) set currentStage = 0
    8196    if ($DB:n == 0)
    8297      option DEFAULT
     
    85100      option $DB:$distToProcess_DB
    86101      $run = $run -dbname $DB:$distToProcess_DB
    87       $distToProcess_DB ++
    88       if ($distToProcess_DB >= $DB:n) set distToProcess_DB = 0
     102
     103      # only increment the database number after we have gone through all of
     104      # the stages
     105      if ($currentStage == 0)
     106          $distToProcess_DB ++
     107          if ($distToProcess_DB >= $DB:n) set distToProcess_DB = 0
     108      end
    89109    end
    90110    add_poll_args run
  • trunk/ippTools/share/Makefile.am

    r25423 r25429  
    110110     disttool_definebyquery_stack.sql \
    111111     disttool_definebyquery_warp.sql \
    112      disttool_pendingcomponent.sql \
     112     disttool_pending_camera.sql \
     113     disttool_pending_chip.sql \
     114     disttool_pending_diff.sql \
     115     disttool_pending_fake.sql \
     116     disttool_pending_raw.sql \
     117     disttool_pending_stack.sql \
     118     disttool_pending_warp.sql \
    113119     disttool_pendingfileset.sql \
    114120     disttool_pendingdest.sql \
  • trunk/ippTools/src/disttool.c

    r25031 r25429  
    22 * disttool.c
    33 *
    4  * Copyright (C) 2008
     4 * Copyright (C) 2008-2009
    55 *
    66 * This program is free software; you can redistribute it and/or modify it
     
    600600    PS_ASSERT_PTR_NON_NULL(config, false);
    601601
     602    PXOPT_LOOKUP_STR(stage, config->args, "-stage", true, false);
     603
    602604    psMetadata *where = psMetadataAlloc();
    603605    PXOPT_COPY_S64(config->args, where, "-dist_id", "dist_id", "==");
    604     PXOPT_COPY_STR(config->args, where, "-stage", "stage", "==");
    605     pxAddLabelSearchArgs (config, where, "-label", "label", "==");
     606    pxAddLabelSearchArgs (config, where, "-label", "distRun.label", "==");
    606607
    607608    PXOPT_LOOKUP_U64(limit, config->args, "-limit", false, false);
    608609    PXOPT_LOOKUP_BOOL(simple, config->args, "-simple", false);
    609610
    610     // look for "inputs" that need to processed
    611     psString query = pxDataGet("disttool_pendingcomponent.sql");
     611    psString queryFile = NULL;
     612    psStringAppend(&queryFile, "disttool_pending_%s.sql", stage);
     613    psString query = pxDataGet(queryFile);
    612614    if (!query) {
    613         psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement");
     615        psError(PXTOOLS_ERR_DATA, false, "failed to retreive SQL statement from %s", queryFile);
    614616        return false;
    615617    }
     
    617619    if (psListLength(where->list)) {
    618620        psString whereClause = psDBGenerateWhereConditionSQL(where, NULL);
    619         psStringAppend(&query, " WHERE %s", whereClause);
     621        psStringAppend(&query, " AND %s", whereClause);
    620622        psFree(whereClause);
    621623    }
     
    629631    }
    630632
    631     // the query has where hooks for each stage.
    632     // right now we aren't using them.
    633     // XXX: I think that I want to change the query from a union of selects on the various
    634     // stages to separate queries. As it is pending data at the later stages of the pipline
    635     // will get blocked by pending earlier stages
    636     psString    raw_where = "";
    637     psString    raw_clean_where = "";
    638     psString    chip_where = "";
    639     psString    camera_where = "";
    640     psString    fake_where = "";
    641     psString    warp_where = "";
    642     psString    diff_where = "";
    643     psString    stack_where = "";
    644 
    645     if (!p_psDBRunQueryF(config->dbh,
    646             query,
    647             raw_where,
    648             raw_clean_where,
    649             chip_where,
    650             camera_where,
    651             fake_where,
    652             warp_where,
    653             diff_where,
    654             stack_where)) {
     633    if (!p_psDBRunQuery(config->dbh, query)) {
    655634        psError(PS_ERR_UNKNOWN, false, "database error");
    656635        psFree(query);
  • trunk/ippTools/src/disttoolConfig.c

    r24871 r25429  
    9595    // -pendingcomponent
    9696    psMetadata *pendingcomponentArgs = psMetadataAlloc();
     97    psMetadataAddStr(pendingcomponentArgs, PS_LIST_TAIL, "-stage",    0, "limit results to runs for stage (required)", NULL);
    9798    psMetadataAddS64(pendingcomponentArgs, PS_LIST_TAIL, "-dist_id", 0, "define dist_id", 0);
    98     psMetadataAddStr(pendingcomponentArgs, PS_LIST_TAIL, "-stage",    0, "limit results to runs for stage", NULL);
    9999    psMetadataAddStr(pendingcomponentArgs, PS_LIST_TAIL, "-label",    PS_META_DUPLICATE_OK, "limit results to label", NULL);
    100100    psMetadataAddU64(pendingcomponentArgs, PS_LIST_TAIL, "-limit",  0,  "limit result set to N items", 0);
Note: See TracChangeset for help on using the changeset viewer.