13.07.2015 Views

automatically exploiting cross-invocation parallelism using runtime ...

automatically exploiting cross-invocation parallelism using runtime ...

automatically exploiting cross-invocation parallelism using runtime ...

SHOW MORE
SHOW LESS

You also want an ePaper? Increase the reach of your titles

YUMPU automatically turns print PDFs into web optimized ePapers that Google loves.

library provides efficient misspeculation detection. In order to check for misspeculation,all threads periodically send memory access signatures to a dedicated checker thread. Amemory access signature summarizes which bytes in memory have been accessed since thelast check. The checker thread uses signatures to verify that speculative execution respectsall memory dependences. If the checker thread detects misspeculation, it kills all the speculativethreads and resumes execution from the last checkpoint. If two threads calculateand send signatures while they are executing in code regions guaranteed to be independent,these signatures will be safely skipped to avoid unnecessary checking overhead.To avoid high penalty from misspeculation, SPECCROSS uses a profiler to determinethe speculative range, which controls how aggressively to speculate. The speculative rangeis the distance between a thread with a high epoch number and thread with a low epochnumber. In SPECCROSS, an epoch number counts the number of barriers each threadhas passed. Non-speculative barriers ensure that all threads have the same epoch number,whereas speculative barriers allow each thread’s epoch number to increase independently.When the difference of two threads’ epoch numbers is zero, misspeculation is impossible,since nothing is speculated. When the difference is high, misspeculation is more likely,since more intervening memory accesses are speculated. The SPECCROSS <strong>runtime</strong> systemuses profiling data to compute a limit for the speculative range. When the program reachesthe limit, SPECCROSS stalls the thread with the higher epoch number until the thread withthe lower epoch number has caught up. Choosing the correct limit keeps misspeculationrates low.Figure 4.5 gives an overview of the SPECCROSS system. The SPECCROSS compilertakes a sequential program as input and detects a SPECCROSS code region as the transformationtarget. A SPECCROSS code region is often an outermost loop composed of consecutiveparallelizable inner loops. SPECCROSS parallelizes each independent inner loop andthen inserts SPECCROSS library function calls to enable <strong>cross</strong>-<strong>invocation</strong> parallelization.At <strong>runtime</strong>, the original process spawns multiple worker threads and a checker thread for56

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!