Presentation is loading. Please wait.

Presentation is loading. Please wait.

Limited Time and Experience: Parallelism in CS1 Fourth NSF/TCPP Workshop on Parallel and Distributed Computing Education (EduPar-14) Steven Bogaerts.

Similar presentations


Presentation on theme: "Limited Time and Experience: Parallelism in CS1 Fourth NSF/TCPP Workshop on Parallel and Distributed Computing Education (EduPar-14) Steven Bogaerts."— Presentation transcript:

1 Limited Time and Experience: Parallelism in CS1 Fourth NSF/TCPP Workshop on Parallel and Distributed Computing Education (EduPar-14) Steven Bogaerts

2 Outline Context Details of topic coverage Evaluation

3 Parallelism in CS1 Benefit – See parallelism as a natural and common part of programming Challenge – Unique cognitive and technical issues

4 CS1 at DePauw Audience: Intended majors, minors, related disciplines, math-phobic Two sections, same parallelism outline, based on same pre/post test – Background, Moore’s Law, speedup expected, race conditions, locks, communication and coordination – Around week 12 out of 14

5 Two Sections: Differences Section A: – 28 students – ~4 hours on parallelism – Lecture, exercises, activities, analogies, brief Java implementation Section B: – 26 students – ~1.5 hours on parallelism – Primarily lecture, some brief exercises

6

7 Overview of Analogies and Exercises Parallelism in real life Clock speed Interprocess Communication Race Conditions Locks Join Java Implementation

8 Parallelism in Real Life If I can shovel my driveway in 1 hour, how long would you expect it to take if someone equally capable were helping me? Answer: 30 minutes Split up the task: easy Communication required: very little

9 Parallelism in Real Life If one person can dig a hole with a shovel in 100 seconds, how long would it take for 10 people to dig that hole? Answer: 80 seconds? Split up the task: hard Communication required: some

10 Parallelism in Real Life If I can run a company all by myself by working 100 hours per week, how much time do I need if I hire an assistant? Answer: 75 hours? Split up the task: hard Communication required: a lot

11 Parallelism in Real Life Lessons: – Task must be split up – Communication required for coordination – Can be much overhead Can explore more “real life” examples Briefly introduce parallel computation examples

12 Clock Speed Measuring the speed of a processor Why not just make the clock tick faster? Analogy: Make a peanut butter and jelly sandwich at the rate of: – 1 per hour – 1 per minute…? – 1 per second…??!? One technology improvement: smaller transistors (Moore’s Law) Leading into increased prevalence of parallelism today

13 Interprocess Communication Analogy: friend and I count how many people are in a building Communication options: 1.”I’ve counted 27 people in the basement. Please go count the other floors and determine the total.” (Passing data at process creation) 2.”I’ll count the basement, you count the other floors. Whenever you finish a floor, send me a text message with that result. I’ll merge your results with mine.” (Message-passing) 3.”I’ll count the basement, you count the other floors. Whenever you finish a floor, open up our shared Google Doc. Add what you just counted to the total already in the doc, and erase the old total. I’ll do the same as I go.” (Shared memory)

14 Interprocess Communication Card sorting activity – Group A (sequentialism): 1 person (processing element) 1 sheet of workspace (RAM) – Group B (message passing parallelism): 2 people (processing elements) Each with 1 sheet of workspace (RAM) Communicate only via message passed by a 3 rd person – Group C (shared memory parallelism): 2 people (processing elements) 1 sheet of workspace (RAM)

15 Interprocess Communication: Observations Much variation in which group finishes first. Sequentialism – No parallelism overhead, but work alone Message passing – Communication was a little slower Shared memory – Faster communication, but can more easily “mess up” each other’s work

16 Race Conditions x++ modeled as: 1.Get the value of x 2.Compute x+1 3.Store the result in x Processes A and B, two of many possibilities:

17 Locks Analogy: conch shell in Lord of the Flies

18 Join Confusion: which process is waiting? Analogy – Parent walking with a child – Child goes to pick flowers – Parent can go on a bit, but eventually must wait for child to join.

19 Java Implementation Hides a few Java- specific details – Runnable vs. Thread – Exceptions – Implement an interface ( run )

20

21

22 Evaluation Comparing two sections: – Section A: 4 hours, many analogies and exercises – Section B: 1.5 hours, mostly lecture Four opinion questions – Self-rated interest and ability in parallelism – Strongly Disagree to Strongly Agree Eight factual questions – Background, Moore’s Law, speedup expected, race conditions, locks, communication and coordination Pre-test – Beginning of semester, no course material covered yet Post-test – Last week of the semester

23 Pre-test: comparable neutrality Post-test: A shows stronger increase

24 Pre-test: comparable disagreement Post-test: A shows stronger increase

25 Pre-test: comparable agreement Post-test: A holding steady B drop

26 Pre-test: low performance all-around Post-test: A performance higher – Exception: question 2, a more difficult concurrency question that neither section had really covered

27 Summary and Conclusions Student learning – Both sections show evidence – Section A results stronger Student opinions – Section A students are more positive about the experience – Note: Overall course evaluations and grades were similar between the two sections It seems that, for better learning and more positive opinions: – The approach of A, while more time-intensive, is helpful to enable students to learn these concepts more effectively as introductory students. – If sufficient time is not available to cover deeply a given set of concepts, it may be preferable to reduce the size of the set, rather than cover the entire set at a more shallow level.


Download ppt "Limited Time and Experience: Parallelism in CS1 Fourth NSF/TCPP Workshop on Parallel and Distributed Computing Education (EduPar-14) Steven Bogaerts."

Similar presentations


Ads by Google