IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Aug 8, 2008, 8:12:50 AM (18 years ago)
Author:
Paul Price
Message:

Adding threading support.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppSub/src/ppSubArguments.c

    r18920 r18963  
    217217    psMetadataAddS32(arguments, PS_LIST_TAIL, "-renorm-width", 0, "Renormalisation width", 0);
    218218    psMetadataAddBool(arguments, PS_LIST_TAIL, "-photometry", 0, "Perform photometry?", false);
     219    psMetadataAddS32(arguments, PS_LIST_TAIL, "-threads", 0, "Number of threads", 0);
    219220
    220221    if (argc == 1 || !psArgumentParse(arguments, &argc, argv) || argc != 4) {
     
    252253    if (psMetadataLookupBool(NULL, arguments, "-photometry")) {
    253254        psMetadataAddBool(recipe, PS_LIST_TAIL, "PHOTOMETRY", PS_META_REPLACE, "Perform photometry?", true);
     255    }
     256
     257    int threads = psMetadataLookupS32(NULL, arguments, "-threads"); // Number of threads
     258    if (threads > 0) {
     259        if (!psThreadPoolInit(threads)) {
     260            psError(PS_ERR_UNKNOWN, false, "Unable to setup %d threads", threads);
     261            return false;
     262        }
     263        pmSubtractionThreadSetup();
    254264    }
    255265
Note: See TracChangeset for help on using the changeset viewer.