IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Ignore:
Timestamp:
Jul 27, 2008, 6:06:03 PM (18 years ago)
Author:
eugene
Message:

adding multithreading capability

File:
1 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppMerge/src/ppMergeArguments.c

    r18603 r18757  
    1 #ifdef HAVE_CONFIG_H
    2 #include <config.h>
    3 #endif
    4 
    5 #include <stdio.h>
    6 #include <string.h>
    7 #include <strings.h>
    8 #include <pslib.h>
    9 #include <psmodules.h>
    10 
    111#include "ppMerge.h"
    122
     
    179169        psMetadataAddStr (config->arguments, PS_LIST_TAIL, "CELL_SELECTIONS", PS_DATA_STRING, "", argv[argnum]);
    180170        psArgumentRemove (argnum, &argc, argv);
     171    }
     172
     173    // Number of threads
     174    if ((argnum = psArgumentGet(argc, argv, "-threads"))) {
     175        psArgumentRemove(argnum, &argc, argv);
     176        int nThreads = atoi(argv[argnum]);
     177        psMetadataAddS32(config->arguments, PS_LIST_TAIL, "NTHREADS", 0, "number of warp threads", nThreads);
     178        psArgumentRemove(argnum, &argc, argv);
     179
     180        // create the thread pool with number of desired threads, supplying our thread launcher function
     181        // XXX need to determine the number of threads from the config data
     182        psThreadPoolInit (nThreads, &ppMergeThreadLauncher);
    181183    }
    182184
Note: See TracChangeset for help on using the changeset viewer.