IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 33089 for trunk/psphot/src


Ignore:
Timestamp:
Jan 11, 2012, 10:16:48 AM (15 years ago)
Author:
bills
Message:

Fix problems with IPP threading. In psThreadPoolWait wait until all threads have
finished before returning even if one of the threads has a fault.
Return false if any thread faults. Also add a new argument bool harvestOnFailure
which tells psThreadPoolWait to harvest the done jobs if there is a failure.
Many functions previously used psThreadPoolWait(harvest = false) because they
wanted to examine the jobs structs afterwards. However they weren't cleaning up the
jobs in the failure case.
These now call psThreadPoolWait(harvest = false, harvestOnFailure = true)
which causes the jobs to be cleaned up on fault. These lingering jobs were the
cause of the "Unknown task" failure in psImageConvolve*
Also changed psphotReadout to check for failure of psphotGuessModels and return
to the caller. This yields quality = 3007

Location:
trunk/psphot/src
Files:
13 edited

Legend:

Unmodified
Added
Removed
  • trunk/psphot/src/psphotApResid.c

    r32348 r33089  
    154154
    155155        // wait for the threads to finish and manage results
    156         if (!psThreadPoolWait (false)) {
     156        if (!psThreadPoolWait (false, true)) {
    157157            psError(PS_ERR_UNKNOWN, false, "Unable to guess model.");
     158            psFree(cellGroups);
    158159            return false;
    159160        }
  • trunk/psphot/src/psphotBlendFit.c

    r32695 r33089  
    151151
    152152        // wait for the threads to finish and manage results
    153         if (!psThreadPoolWait (false)) {
     153        if (!psThreadPoolWait (false, true)) {
    154154            psError(PS_ERR_UNKNOWN, false, "Unable to guess model.");
    155155            psFree (fitOptions);
  • trunk/psphot/src/psphotExtendedSourceAnalysis.c

    r32633 r33089  
    134134
    135135        // wait for the threads to finish and manage results
    136         if (!psThreadPoolWait (false)) {
     136        if (!psThreadPoolWait (false, true)) {
    137137            psError(PS_ERR_UNKNOWN, false, "Unable to guess model.");
    138138            psFree(AnalysisRegion);
  • trunk/psphot/src/psphotExtendedSourceFits.c

    r32744 r33089  
    218218
    219219        // wait for the threads to finish and manage results
    220         if (!psThreadPoolWait (false)) {
     220        if (!psThreadPoolWait (false, true)) {
    221221            psError(PS_ERR_UNKNOWN, false, "Unable to guess model.");
    222222            psFree(AnalysisRegion);
  • trunk/psphot/src/psphotFindFootprints.c

    r32348 r33089  
    3535        psArray *tmp = pmFootprintArrayGrow(footprints, growRadius);
    3636        psImageConvolveSetThreads(oldThreads);
    37         psLogMsg ("psphot", PS_LOG_MINUTIA, "grow footprint coverage by %d pixels, %ld footprints become %ld footprints: %f sec\n", growRadius, footprints->n, tmp->n, psTimerMark ("psphot.footprints"));
    38         psFree(footprints);
    39         footprints = tmp;
     37        psLogMsg ("psphot", PS_LOG_MINUTIA, "grow footprint coverage by %d pixels, %ld footprints become %ld footprints: %f sec\n", growRadius, footprints->n, tmp ? tmp->n : 0, psTimerMark ("psphot.footprints"));
     38        if (tmp) {
     39            psFree(footprints);
     40            footprints = tmp;
     41        } else {
     42            psLogMsg ("psphot", PS_LOG_WARN, "pmFootprintArray grow returned NULL\n");
     43        }
     44           
    4045    }
    4146
  • trunk/psphot/src/psphotGuessModels.c

    r32996 r33089  
    112112        // wait here for the threaded jobs to finish
    113113        // fprintf (stderr, "wait for threads (%d, %d)\n", jx, jy);
    114         if (!psThreadPoolWait (false)) {
     114        if (!psThreadPoolWait (false, true)) {
     115            // harvest our jobs
     116            psFree(cellGroups);
    115117            psError(PS_ERR_UNKNOWN, false, "Unable to guess model.");
    116118            return false;
  • trunk/psphot/src/psphotKronIterate.c

    r32996 r33089  
    158158
    159159        // wait for the threads to finish and manage results
    160         if (!psThreadPoolWait (false)) {
     160        if (!psThreadPoolWait (false, true)) {
    161161            psError(PS_ERR_UNKNOWN, false, "Unable to guess model.");
    162162            return false;
  • trunk/psphot/src/psphotMagnitudes.c

    r32348 r33089  
    129129
    130130        // wait for the threads to finish and manage results
    131         if (!psThreadPoolWait (false)) {
     131        if (!psThreadPoolWait (false, true)) {
    132132            psError(PS_ERR_UNKNOWN, false, "Unable to guess model.");
    133133            return false;
     
    309309
    310310        // wait for the threads to finish and manage results
    311         if (!psThreadPoolWait (false)) {
     311        if (!psThreadPoolWait (false, true)) {
    312312            psError(PS_ERR_UNKNOWN, false, "Unable to guess model.");
    313313            return false;
  • trunk/psphot/src/psphotRadialApertures.c

    r32633 r33089  
    176176
    177177        // wait for the threads to finish and manage results
    178         if (!psThreadPoolWait (false)) {
     178        if (!psThreadPoolWait (false, true)) {
    179179            psError(PS_ERR_UNKNOWN, false, "Unable to guess model.");
    180180            psFree(AnalysisRegion);
  • trunk/psphot/src/psphotRadialProfileWings.c

    r32996 r33089  
    147147
    148148        // wait for the threads to finish and manage results
    149         if (!psThreadPoolWait (false)) {
     149        if (!psThreadPoolWait (false, true)) {
    150150            psError(PS_ERR_UNKNOWN, false, "Unable to guess model.");
    151151            return false;
  • trunk/psphot/src/psphotReadout.c

    r32996 r33089  
    133133    // Construct an initial model for each object, set the radius to fitRadius, set circular
    134134    // fit mask.  NOTE: only applied to sources without guess models
    135     psphotGuessModels (config, view, filerule); // pass 1
     135    // pass 1
     136    if (!psphotGuessModels (config, view, filerule)) {
     137        psLogMsg ("psphot", 3, "failure to Guess Model - pass 1");
     138        return psphotReadoutCleanup (config, view, filerule);
     139    }
    136140
    137141    // linear PSF fit to source peaks, subtract the models from the image (in PSF mask)
     
    155159    // non-linear PSF and EXT fit to brighter sources
    156160    // replace model flux, adjust mask as needed, fit, subtract the models (full stamp)
     161    // XXX: can leave faulted job in done queue
    157162    psphotBlendFit (config, view, filerule); // pass 1 (detections->allSources)
    158163
  • trunk/psphot/src/psphotSourceStats.c

    r32699 r33089  
    216216
    217217        // wait for the threads to finish and manage results
    218         if (!psThreadPoolWait (false)) {
     218        if (!psThreadPoolWait (false, true)) {
    219219            psError(PS_ERR_UNKNOWN, false, "Failure in thread job PSPHOT_SOURCE_STATS");
    220220            psFree(detections->newSources);
     
    347347
    348348        // wait for the threads to finish and manage results
    349         if (!psThreadPoolWait (false)) {
     349        if (!psThreadPoolWait (false, true)) {
    350350            psError(PS_ERR_UNKNOWN, false, "Failure in thread job PSPHOT_SOURCE_STATS");
    351351            return NULL;
  • trunk/psphot/src/psphotTest.c

    r29936 r33089  
    8585
    8686    // wait for the threads to finish and manage results
    87     if (!psThreadPoolWait (true)) {
     87    if (!psThreadPoolWait (true, true)) {
    8888        fprintf (stderr, "failure to run FillImage (2)");
    8989        exit (1);
Note: See TracChangeset for help on using the changeset viewer.