Presentation is loading. Please wait.

Presentation is loading. Please wait.

Hands-On Exploration of Parallelism for Absolute Beginners With Scratch Steven Bogaerts Department of Mathematics & Computer Science Wittenberg University.

Similar presentations


Presentation on theme: "Hands-On Exploration of Parallelism for Absolute Beginners With Scratch Steven Bogaerts Department of Mathematics & Computer Science Wittenberg University."— Presentation transcript:

1 Hands-On Exploration of Parallelism for Absolute Beginners With Scratch Steven Bogaerts Department of Mathematics & Computer Science Wittenberg University Springfield, OH Third NSF/TCPP Workshop on Parallel and Distributed Computing Education (EduPar-13) May 20 th, 2013 NSF grant CCF-0915805, SHF:Small:RUI:Collaborative Research: Accelerators to Applications – Supercharging the Undergraduate Computer Science Curriculum PIs: Eric Stahlberg, Melissa Smith, Steven Bogaerts

2 Outline Steven Bogaerts The context of this work Introduction to Scratch Hands-on exercises on parallelism with Scratch Outcomes

3 PDC at Wittenberg Steven Bogaerts The integration effort continues… CS1 Key concepts, message-passing paradigm, race conditions, blocking commands, … CS2 Threads, divide and conquer parallelism, efficiency Languages Shared memory (OpenMP) and message passing (MPI) in C Algorithms Sequential and parallel algorithms for various tasks, asymptotic complexity Software design Sequential and parallel design patterns Hardware FPGA programming Artificial intelligence Parallel alpha-beta pruning, neural network training Cybersecurity Botnets, distributed denial of service attacks …

4 Computer Literacy Steven Bogaerts Audience Entirely non-majors (does not count towards CS major) Occasionally a student will move on to CS1 and perhaps a minor or major Many students with great unease in math and computing Three roughly 5-week (15 contact-hour) parts Excel Design of spreadsheets to capture relevant data and calculations to facilitate real-world decisions Access Database design Queries Keys, referential integrity Programming Get an introduction to what programming is…

5 Programming in Scratch Steven Bogaerts Developed at the MIT Media Lab in 2007 In use at various institutions as a first language for both majors and non-majors, and in K-12 education Visually-oriented, fun introduction to key programming concepts Similar to Alice – dragging and connecting blocks, manipulating “sprites” Not literally in parallel Code executes concurrently, sharing a single execution thread through context switches.

6 The Situation Steven Bogaerts I have 15 hours of contact time to give students a first taste of programming. To be truly “literate” in computing today requires some basic understanding of parallelism. Most literacy courses don’t include hands-on parallel programming exercises. Question With no prerequisites and little time, how can I give non- majors hands-on experience in parallelism?

7 Illustrations of Parallel Computing with Scratch Steven Bogaerts Parallelism and communication for clean solutions Race conditions Blocking and non-blocking commands Shared and private variables

8 Option 1 Parallelism and Communication for Clean Solutions The world is naturally parallel Let parallelism arise naturally as the best solution Task: Animation of a boy walking and dribbling a ball Option 2 Complex relationship of values Boy Ball Simple relationship of values Boy Ball ? ?

9 Race Conditions Steven Bogaerts Parallelism also brings added challenges Not truly parallel, so actually this is unexpected program behavior occurring due to the arbitrary interleaving of concurrent code Ball Paddle First? Later? Arbitrary interleaving – some blocks may immediately end execution! Exercises Determine interleaving through observation Fix code through wait s or blocking until receipt of a signal

10 Blocking and Non-Blocking Commands Steven Bogaerts BlockingNon-Blocking Say for secsSay Think for secsThink Play sound until donePlay sound Broadcast and waitBroadcast A sample broadcast exercise: Blocking Non-Blocking Sender Recipient

11 Shared and Private Variables Steven Bogaerts Whack-A-Mole Q W E R A S D F Private variable Each mole’s state (up or down) Shared variables Score counter Game difficulty parameters

12 Outcomes Steven Bogaerts Material was very easy to integrate into the class in a level- appropriate manner. Strong performance (mostly A’s and B’s) on parallelism assignments and exam questions. General parallelism discussions - students report very good understanding (4.0 / 5.0) and enjoyment (4.0 / 5.0). Parallelism in Scratch – students report high understanding (4.7 / 5.0) and enjoyment (4.4 / 5.0).

13 Summary Steven Bogaerts Context A very short time in a literacy course Maybe at the start of CS1 Hands-on exploration of parallelism with Scratch Parallelism and communication for clean solutions Race conditions Blocking and non-blocking commands Shared and private variables Outcomes – successful integration in literacy course


Download ppt "Hands-On Exploration of Parallelism for Absolute Beginners With Scratch Steven Bogaerts Department of Mathematics & Computer Science Wittenberg University."

Similar presentations


Ads by Google