1 / 9

Informal Parallel Programming Course for High School Students

Informal Parallel Programming Course for High School Students. Fall 2007 By: Alex Valentin. Who?. Uzi Vishkin, UMD Professor Scott Watson, UMD Graduate Student 10 Montgomery Blair Students Me. Why?. Think Differently Target younger audience Parallel is the Future. What?.

drake
Download Presentation

Informal Parallel Programming Course for High School Students

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Informal Parallel Programming Course for High School Students Fall 2007 By: Alex Valentin

  2. Who? • Uzi Vishkin, UMD Professor • Scott Watson, UMD Graduate Student • 10 Montgomery Blair Students • Me

  3. Why? • Think Differently • Target younger audience • Parallel is the Future

  4. What? • Language: XMT-C • Spawn • Ps( ) • Hardware: 64-processor computer

  5. HW0: Exchange Problem Swap elements from A[ ] with those of B[ ] Input: A[ ], B[ ], n = length of arrays #include <xmtc.h> int main( ) { int x; for(x=0; x<n; x++){ int e= A[x]; A[x] = B[x]; B[x] = e; }//end for }//end main #include <xmtc.h> int main() { spawn(0,n-1){ Int x ; x= A[$]; A[$] = B[$]; B[$] = x[$]; }//end for }//end main

  6. Optimal Parallel Exchange int main() { int y[n]; int x[n]; spawn(0,2*n-1) { if($<n) x[$] = A[$]; else y[$%n] = B[$%n]; } spawn(0, 2*n-1) { if($<n) A[$] = y[$]; else B[$%n] = x[$%n]; } }

  7. HW3: Compaction • Given a sparse array, copy all non-zero values into a new array • Input: A[ ], B[ ], C[ ], n= length of arrays • To be done in constant time, O(1)

  8. Compaction Code int main(void) { int ptr=0; int l; for(l=0; l<n; l++) { if(B[l] != 0) { C[ptr] = A[l]; ptr++; } }//end for }//end main #include <xmtc.h> psBaseReg base; int main (void) { base =0; spawn(0, n-1) { int step =1; if( B[$] != 0) { ps( step, base); C[step] = A[$]; } }//end spawn }// end main

  9. The Future • Ear Decomposition Search ( EDS) • Sub-Graph of Input • Parallel equivalence of Depth-First-Search • st-Numbering

More Related