automatically exploiting cross-invocation parallelism using runtime ...
automatically exploiting cross-invocation parallelism using runtime ... automatically exploiting cross-invocation parallelism using runtime ...
Operation DescriptionFunctions for Both Profiling and Speculationinit() Initialize data structures used for barrier profiling or speculative execution.If in speculation mode, checkpoint the program before beginningthe parallel execution.exit task(threadID) Record the signature of the current task in global signature log.Increment the task number. If in profiling mode, compare the signature ofcurrent task with signatures of tasks belonging to previous epochsand return the minimum dependence distance.If in speculation mode, return value is 0.spec access(threadID, callback, addr list) Apply callback function to each address in the addr list to computethe signature.enter barrier(threadID, loop name) Increment the epoch number. If in profiling mode, execute the actualnon-speculative barrier operation. If in speculation mode, checkpoint according tothe checkpointing frequency.create threads(threads, attrs, start routines, args) Create worker threads and if in speculation mode, create a checkerthread for violation detection.cleanup() Wait for worker threads and checker thread to finish.Free data structures allocated for profiling or speculation.Functions for Speculation Onlyenter task(threadID, spec distance) Collect epoch number and task number of other worker threads andsend them to the checker thread. The parameter spec distance specifiesthe speculation distance between two tasks.send end token(threadID) Send an END TOKEN to checker thread to inform it of the completionof a worker thread.sync() Synchronize all threads before entering the next epoch.checkpoint() Checkpoint program state before entering the next epoch.Table 4.1: Interface for SPECCROSS Runtime Library66
1. Initialization. The init function performs initialization by setting up bookkeepingdata structures, including allocating memory for signatures, the epoch number,and the task number. In speculation mode, init checkpoints the program beforebeginning parallel execution.2. Thread Creation. The create threads function spawns new threads in bothprofiling and speculation modes. Unlike pthreads, a SPECCROSS thread’s stack isnot deallocated after the thread exits. This implementation detail is vital for checkpointingand recovery, because it allows a new thread to reclaim an old thread’s stackusing longjmp.3. Barrier Entry. The enter barrier function increments the epoch number uponentry into a new epoch. In profiling mode or non-speculative mode, it executes thenon-speculative barrier. The parameter loop name is set to be the name of the loopheader basic block so that profiling could compute a minimum dependence distancefor each independent loop. While in speculation mode, it skips barrier synchronization.The enter barrier function is also responsible for periodically checkpointingspeculative state.4. Dependence Tracking. To compute the access signatures for each task, its memoryaccesses (loads and stores) are instrumented using the spec access function.Loads and stores need to be instrumented if they belong to different epochs and mayalias with each other. For typical programs, only a few memory accesses requireinstrumentation. The spec access function takes as input the memory locationreferred in the memory access instruction and a pointer to the signature generatorfunction. Passing a pointer to the signature generator provides users with the flexibilityto choose customized functions that are specific to each parallel program. Thisin turn enables SPECCROSS to achieve low conflict rate across programs with differingmemory access patterns.67
- Page 30 and 31: 1 cost = 0;2 node = list->head;3 Wh
- Page 32 and 33: example which cannot benefit from e
- Page 34 and 35: These techniques are referred to as
- Page 36 and 37: unnecessary overhead at runtime.Tab
- Page 38 and 39: Chapter 3Non-Speculatively Exploiti
- Page 40 and 41: for a variety of reasons. For insta
- Page 42 and 43: 12x11x10xDOMOREPthread Barrier9xLoo
- Page 44 and 45: Algorithm 1: Pseudo-code for schedu
- Page 46 and 47: Algorithm 2: Pseudo-code for worker
- Page 48 and 49: 3.3 Compiler ImplementationThe DOMO
- Page 50 and 51: to T i . DOMORE’s MTCG follows th
- Page 52 and 53: Outer_Preheaderbr BB1ABB1A:ind1 = P
- Page 54 and 55: Algorithm 3: Pseudo-code for genera
- Page 56 and 57: Scheduler Function SchedulerSync Fu
- Page 58 and 59: SchedulerWorker1 Worker2Worker3Work
- Page 60 and 61: 3.5 Related Work3.5.1 Cross-invocat
- Page 62 and 63: ations during the inspecting proces
- Page 64 and 65: for (t = 0; t < STEP; t++) {L1: for
- Page 66 and 67: sequential_func() {for (t = 0; t <
- Page 68 and 69: Workerthread 1Workerthread 2Workert
- Page 70 and 71: library provides efficient misspecu
- Page 72 and 73: Workerthread 1TimeFigure 4.6: Timin
- Page 74 and 75: 4.2 SPECCROSS Runtime System4.2.1 M
- Page 76 and 77: takes up to 200MB memory space.To d
- Page 78 and 79: checkpoint, the child spawns new wo
- Page 82 and 83: Main thread:main() {init();create_t
- Page 84 and 85: implemented in the Liberty parallel
- Page 86 and 87: Algorithm 5: Pseudo-code for SPECCR
- Page 88 and 89: CROSS, since SPECCROSS can be appli
- Page 90 and 91: techniques.Synchronization via sche
- Page 92 and 93: Source Benchmark Function % of exec
- Page 94 and 95: applied to the outermost loop, gene
- Page 96 and 97: 5.2 SPECCROSS Performance Evaluatio
- Page 98 and 99: and the number of checking requests
- Page 100 and 101: 8x7xno misspec.with misspec.Geomean
- Page 102 and 103: This thesisPrevious workSpeedup (x)
- Page 104 and 105: Program Speedup6x5x4x3x2xLOCALWRITE
- Page 106 and 107: for DOMORE and SPECCROSS. Others (e
- Page 108 and 109: programs and it achieves a geomean
- Page 110 and 111: Bibliography[1] R. Allen and K. Ken
- Page 112 and 113: [15] R. Cytron. DOACROSS: Beyond ve
- Page 114 and 115: [31] T. B. Jablin, Y. Zhang, J. A.
- Page 116 and 117: [47] A. Nicolau, G. Li, A. V. Veide
- Page 118 and 119: [62] L. Rauchwerger and D. Padua. T
- Page 120: national conference on Parallel Arc
1. Initialization. The init function performs initialization by setting up bookkeepingdata structures, including allocating memory for signatures, the epoch number,and the task number. In speculation mode, init checkpoints the program beforebeginning parallel execution.2. Thread Creation. The create threads function spawns new threads in bothprofiling and speculation modes. Unlike pthreads, a SPECCROSS thread’s stack isnot deallocated after the thread exits. This implementation detail is vital for checkpointingand recovery, because it allows a new thread to reclaim an old thread’s stack<strong>using</strong> longjmp.3. Barrier Entry. The enter barrier function increments the epoch number uponentry into a new epoch. In profiling mode or non-speculative mode, it executes thenon-speculative barrier. The parameter loop name is set to be the name of the loopheader basic block so that profiling could compute a minimum dependence distancefor each independent loop. While in speculation mode, it skips barrier synchronization.The enter barrier function is also responsible for periodically checkpointingspeculative state.4. Dependence Tracking. To compute the access signatures for each task, its memoryaccesses (loads and stores) are instrumented <strong>using</strong> the spec access function.Loads and stores need to be instrumented if they belong to different epochs and mayalias with each other. For typical programs, only a few memory accesses requireinstrumentation. The spec access function takes as input the memory locationreferred in the memory access instruction and a pointer to the signature generatorfunction. Passing a pointer to the signature generator provides users with the flexibilityto choose customized functions that are specific to each parallel program. Thisin turn enables SPECCROSS to achieve low conflict rate a<strong>cross</strong> programs with differingmemory access patterns.67