IPP Software Navigation Tools IPP Links Communication Pan-STARRS Links

Changeset 18757


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

adding multithreading capability

Location:
trunk/ppMerge/src
Files:
4 added
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/ppMerge/src/Makefile.am

    r17227 r18757  
    1111        ppMergeScaleZero.c      \
    1212        ppMergeLoop.c           \
     13        ppMergeThreadLauncher.c \
     14        ppMergeFileGroup.c      \
    1315        ppMergeMask.c
    1416
  • trunk/ppMerge/src/ppMerge.c

    r18070 r18757  
    1 #ifdef HAVE_CONFIG_H
    2 #include <config.h>
    3 #endif
    4 
    5 #include <stdio.h>
    6 #include <string.h>
    7 #include <pslib.h>
    8 #include <psmodules.h>
    9 
    101#include "ppMerge.h"
    11 
    12 //#include "ppMem.h"
    132
    143// Yet to do:
  • trunk/ppMerge/src/ppMerge.h

    r18166 r18757  
    11#ifndef PP_MERGE_H
    22#define PP_MERGE_H
     3
     4#ifdef HAVE_CONFIG_H
     5#include <config.h>
     6#endif
     7
     8#include <stdio.h>
     9#include <string.h>
     10#include <unistd.h>
     11#include <pslib.h>
     12#include <psmodules.h>
     13#include <ppStats.h>
    314
    415#define TIMERNAME "ppMerge"             // Name for timer
     
    2233    PPMERGE_FILES_OUTPUT                // Output files
    2334} ppMergeFiles;
     35
     36typedef struct {
     37    psArray *readouts;
     38    bool read;
     39    bool busy;
     40} ppMergeFileGroup;
    2441
    2542// Parse command-line arguments and recipe
     
    8097    );
    8198
     99
     100ppMergeFileGroup *ppMergeFileGroupAlloc();
     101ppMergeFileGroup *ppMergeReadChunk (psArray *fileGroups, pmConfig *config, int numChunk);
     102void *ppMergeThreadLauncher (void *data);
     103
    82104#endif
  • 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
  • trunk/ppMerge/src/ppMergeLoop.c

    r18558 r18757  
    1 #ifdef HAVE_CONFIG_H
    2 #include <config.h>
    3 #endif
    4 
    5 #include <stdio.h>
    6 #include <string.h>
    7 
    8 #include <pslib.h>
    9 #include <psmodules.h>
    10 #include <ppStats.h>
    11 
    121#include "ppMerge.h"
    132
Note: See TracChangeset for help on using the changeset viewer.