Optimizing Collective Communication on Multicores
Rajesh Nishtala1 Katherine Yelick1
1University of California, Berkeley
(2009)
1 / 57
Optimizing Collective Communication on Multicores Rajesh Nishtala 1 - - PowerPoint PPT Presentation
Optimizing Collective Communication on Multicores Rajesh Nishtala 1 Katherine Yelick 1 1 University of California, Berkeley (2009) 1 / 57 Algorithms for Scalable Synchronization on Shared-Memory Multiprocessors John M. Mellor-Crummey, Michael
1University of California, Berkeley
1 / 57
2 / 57
3 / 57
4 / 57
5 / 57
6 / 57
7 / 57
http://images.bit-tech.net/content_images/2007/11/the_secrets_of_pc_memory_part_1/hei.png 8 / 57
9 / 57
10 / 57
http://www.rz.rwth-aachen.de/aw/cms/rz/Themen/hochleistungsrechnen/ rechnersysteme/beschreibung_der_hpc_systeme/ultrasparc_t2/ rba/ultrasparc_t2_architectural_details/?lang=de 11 / 57
12 / 57
http://techresearch.intel.com/ProjectDetails.aspx?Id=1 13 / 57
14 / 57
15 / 57
16 / 57
17 / 57
18 / 57
19 / 57
20 / 57
21 / 57
22 / 57
23 / 57
double [ ] vector = read_vector ( ) ; Thread [ ] workers = spwan_workers ( ) ; start_workers ( workers ) ; double r e s u l t = c a l c u l a t e _ r e s u l t ( workers ) ; 24 / 57
double [ ] vector = read_vector ( ) ; Thread [ ] workers = spwan_workers ( ) ; start_workers ( workers ) ; wait_until_everything_finished(workers); double r e s u l t = c a l c u l a t e _ r e s u l t ( workers ) ; 25 / 57
26 / 57
27 / 57
28 / 57
29 / 57
30 / 57
31 / 57
32 / 57
33 / 57
34 / 57
35 / 57
36 / 57
37 / 57
38 / 57
39 / 57
40 / 57
41 / 57
42 / 57
43 / 57
#define N 4 pthread_t threads [N ] ; vo l a ti l e int ready [N ] ; vo l a ti l e int go [N ] ; void b a r r i e r ( int id ) { i f ( id == 0) { / / wait f o r each thread for ( int i = 1; i < N; i ++) while ( ready [ i ] == 0 ) ; / / reset the ready flags for ( int i = 0; i < N; i ++) ready [ i ] = 0; / / signal each thread for ( int i = 0; i < N; i ++) go [ i ] = 1; } else { ready [ id ] = 1; / / wait u n t i l thread i s signalled while ( go [ id ] == 0 ) ; go [ id ] = 0; } } 44 / 57
45 / 57
46 / 57
47 / 57
48 / 57
49 / 57
50 / 57
51 / 57
52 / 57
53 / 57
54 / 57
55 / 57
56 / 57
57 / 57