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

SCM Repository

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

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

Parent Directory Parent Directory | Revision Log Revision Log

Revision 1831 - (download) (annotate)
Fri Apr 13 13:33:40 2012 UTC (9 years, 2 months ago) by jhr
File size: 1272 byte(s)
  Working on support for parallel target
// The number of strands a worker will take for processing at one time
#define BLOCK_SIZE 4096

// 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            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_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