Home My Page Projects Code Snippets Project Openings diderot
Summary Activity Tracker Tasks SCM

SCM Repository

[diderot] View of /branches/lamont/src/compiler/c-target/fragments/c-hdr-spatial-extra.in
ViewVC logotype

View of /branches/lamont/src/compiler/c-target/fragments/c-hdr-spatial-extra.in

Parent Directory Parent Directory | Revision Log Revision Log


Revision 3282 - (download) (annotate)
Tue Oct 13 19:46:34 2015 UTC (4 years, 3 months ago) by lamonts
File size: 2637 byte(s)
Fixed bug with dead strands appearing in query lists
#define DIDEROT_SPATIAL_COM
STATIC_INLINE Diderot_DynSeq_t * spherical_query(
                                 @PREFIX@World_t * wrld,  
                                 Diderot_vec@SPATIAL_DIMENSION@_t qPos,
                                 @STRANDTY@ * qStrand,
                                 QueryListPool_t * queryPool, 
                                 Diderot_real_t radius); 
#ifdef DIDEROT_TARGET_PARALLEL
#define PAR_MEDIANS_SIZE 5 
#define SPATIAL_SEQ_THERSHOLD 2048
typedef struct spatialworkerArgs SpatialWorkerArgs_t;
typedef struct spatialscheduler SpatialScheduler_t;

typedef enum {
    DONE,
    LOWER,
    UPPER
}Diderot_ParSearchState;

struct spatialscheduler{
    uint32_t * spatialIn;              // a duplicate indice array for axes (malloced as a single array) 
    uint32_t * spatialOut;             // a duplicate indice array for axes (malloced as a single array) 
    uint32_t * spilttersIn; 
    uint32_t numRunning;                // the number of running workers. 
    uint32_t startRunning; 
    SpatialWorkerArgs_t * workers; 
    pthread_cond_t  runWait;            // a condition to make a worker wait before being assigned a task
    pthread_mutex_t barrier; 
    double startTime; 
    double endTime; 
    @STRANDTY@ * globalMedian; 
    uint32_t globMedIdx; 
    uint32_t lessCount; 
    uint32_t greaterCount; 
    uint32_t nextStrand; 
    uint32_t copyStart; 
    uint32_t copyEnd; 
    uint32_t leaderId; 
    uint32_t start; 
    uint32_t end; 
    uint32_t dim; 
    bool isTreeBuilt; 
    @PREFIX@World_t *wrld; 
    Diderot_ParSearchState state; 
    bool isRunning; 
    uint32_t seqThreshold; 
}; 

struct spatialworkerArgs{ 
    uint32_t start; 
    uint32_t end; 
    uint32_t level; 
    uint32_t lessCount;
    uint32_t greaterCount;
    SpatialScheduler_t * sched; 
    uint32_t id; 
}; 

uint32_t * Diderot_Par_Median_Search(SpatialWorkerArgs_t * workerData, uint32_t start, uint32_t end, uint32_t dim); 
void spatialWorker(SpatialWorkerArgs_t * worker); 
void Diderot_KDTree_SwapValues(uint32_t * a, uint32_t *b); 
@STRANDTY@ * seq_median(@PREFIX@World_t *wrld, uint32_t * spatialIndices, int start, int end, int dim); 
@STRANDTY@ * find_median(@PREFIX@World_t *wrld,SpatialWorkerArgs_t * worker,int start, int end, int dim); 
KDNode_t * Diderot_KDTree_BuildHelper(@PREFIX@World_t *wrld, SpatialScheduler_t * sched,SpatialWorkerArgs_t * worker, int start, int len, int axis);
void Diderot_KDTree_Build(@PREFIX@World_t *wrld, uint32_t id, double * spatialTotalTime); 
void Diderot_KDTree_Init(@PREFIX@World_t *wrld); 
void Diderot_KDTree_Realloc(@PREFIX@World_t *wrld); 
#endif 

root@smlnj-gforge.cs.uchicago.edu
ViewVC Help
Powered by ViewVC 1.0.0