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-par-extra.in
ViewVC logotype

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

Parent Directory Parent Directory | Revision Log Revision Log

Revision 2548 - (download) (annotate)
Wed Feb 26 14:22:24 2014 UTC (5 years, 7 months ago) by lamonts
File size: 1548 byte(s)
Fixed global reduction block
// The number of strands a worker will take for processing at one time
#define BLOCK_SIZE 4096

// The default workgroup size for workers performing a reduction. 

// cache-line alignment (Xeon has 64-byte lines)
#define CACHE_ALIGN     __attribute__((aligned(64)))

// argument struct for worker threads
typedef struct {
    uint32_t		id;		// worker's index into worker array
    uint32_t		maxNSteps;	// maximum number of steps to take; 0 == infinity
    @PREFIX@World_t     *wrld;		// pointer to world structure
} WorkerArg_t CACHE_ALIGN;

// Scheduler state
typedef struct {
    CPUInfo_t		cpuInfo;	// information about the available CPUs
    uint32_t		numWorkers;	// number of worker threads to use
    uint32_t            nextStrand CACHE_ALIGN; // index of next strand to update
    uint32_t            numActive CACHE_ALIGN;  // # active strands
    uint32_t            numStable CACHE_ALIGN;  // # stable strands
    uint32_t            numAvail CACHE_ALIGN;   // # unevaluated strands
    uint32_t            numIdle CACHE_ALIGN;    // # idle workers
    uint32_t		numSteps CACHE_ALIGN;	// # of steps taken
    pthread_mutex_t     lock;           // big lock to protect wrld from multiple accesses
    pthread_mutex_t     newLock;       // a lock to protect new strands from multiple creations 
    pthread_cond_t      barrier;        // workers wait on this when they have no work
    pthread_cond_t      runWait;	// used to signal @PREFIX@Run that the workers have finished
} Diderot_Sched_t;

ViewVC Help
Powered by ViewVC 1.0.0