1
S S p p r r i i n n g g 1 1 1 1 : : P P D D C C i i n n C C S S 1 1 / / 2 2 a a n n d d a a m m o o b b i i l l e e / / c c l l o o u u d d i i n n t t e e r r m m e e d d i i a a t t e e s s o o f f t t w w a a r r e e d d e e s s i i g g n n c c o o u u r r s s e e J. Kaylor • K. Läufer • C. Sekharan • G. K. Thiruvathukal Dept. of Computer Science • Loyola University Chicago • USA www.cs.luc.edu • [email protected] • edupar.cs.luc.edu C C a a r r n n e e g g i i e e C C l l a a s s s s i i f f i i c c a a t t i i o o n n • Level: 4year or above • Control: Private notforprofit • Undergraduate Instructional Program: Bal/HGC • Graduate Instructional Program: CompDoc*/MedVet • Enrollment Profile: MU • Undergraduate Profile: FT4/MS/HTI • Size and Setting: L4/R • Basic: RU/H: Research Universities (high research activity) • Community Engagement: Curricular, Outreach, Partnerships *CS/SE/IT: up to masters' level I I n n s s t t i i t t u u t t i i o o n n a a l l P P r r o o f f i i l l e e • Urban, private, Jesuit, liberal arts, ~16k students • College of Arts and Sciences, ~8k students • Dept. of Computer Science, ~250 students • 10 FT faculty: 9 CS, 1 bioinf (1/2 FTE), 1 algebraist (1/4 FTE) • ~140 undergrad majors in CS, SE, IT, Networks & Security, bioinformatics • ~110 master's students in CS, SE, IT • External funding: NSF SSTEM, NSF BPC lead institution, NSF research grants, industry grants and donations • Very early adopters: '97 concurrency course, OOPSLA '98 edu symp paper, HPJPC book P P o o s s i i t t i i o o n n S S t t a a t t e e m m e e n n t t s s [for discussion] • To teach PDC topics effectively, they should not be taught in isolation. Instead, they should be taught in the context of relevant software engineering best practices. • Mobile applications backed by RESTful cloud services are rapidly emerging as the mainstream paradigm of computing [Christensen, OOPSLA '09]. PDC curricula should embrace it. P P r r i i o o r r O O u u t t c c o o m m e e s s Spring 2011: We implemented three three week PDC course modules (20% of our 15 week semester) targeting three required courses usually taken in the second year. AY 201112: We implemented four three week advanced PDC course modules in programming and distributed computing targeting electives typically offered every three semesters. W W h h e e r r e e o o u u r r G G r r a a d d u u a a t t e e s s G G o o • Industry ~ 80% • midwest, coasts, international • consulting, finance, software, telecom, ... • Academia and Government ~ 15% • Argonne, county admin, local universities • Graduate School ~ 3% • local, national • Professional Schools ~ 2% • business, law, medical A A b b s s t t r r a a c c t t / / C C u u r r r r e e n n t t F F o o c c u u s s AY 201213: We are moving PDC topics further down into CS1 and CS2, fleshing out PDC coverage in our intermediate object oriented development course (CS 313), and stepping up evaluation. C C S S 1 1 • Spring 2013: separate section aimed at majors in physics and other hard sciences • includes some material on numerical methods at the K and C levels • about 9 class hours were dedicated to sequential and parallel versions of these algorithms and the possible resulting speedup using data parallelism in C# example: threads for speeding up trapezoidal rule integration C C S S 2 2 • emphasis on PDC topics in CS2 starting in fall 2011 • 9hour PDC module on task parallelism, speedup, and load balancing in algorithms involving arbitrary precision arithmetics • presentation at the C and A levels in the form of various examples • example: compute Fibonacci numbers based on repeated squaring of 2by2 matrices of BigIntegers in Java • experiment with the speedup resulting from executing lines (3) and (4) in separate threads • explore load balancing between these unequal tasks I I n n t t e e r r m m e e d d i i a a t t e e O O b b j j e e c c t t O O r r i i e e n n t t e e d d D D e e v v e e l l o o p p m m e e n n t t • Loyola course number: COMP 313 • since fall 2011: C#, emphasis on PDC topics • since fall 2012: Java with Android as highly effective context for studying concurrency and distributed computing topics (C and A levels) • double 18hour PDC module covers • concurrency and coordination • design forces: safety, liveness, performance • external events and internal timers • background threads • progress reporting and cancelation • offloading computation from mobile device to cloud • throughputlatency tradeoff • example to illustrate these topics (see screenshot) • Android app: bruteforce prime checker • remote task returns quickly, local one is still churning E E v v a a l l : : L L e e a a r r n n i i n n g g A A s s s s e e s s s s m m e e n n t t Sample concurrency questions: Suppose we have two philosophers. The first one, Kant, repeatedly behaves like so: think for 10 minutes wait for any available fork and grab it when available think for 2 minutes wait for any available fork and grab it when available eat for 5 minutes release both forks The second one, Heidegger, repeatedly behaves like so: think for 11 minutes wait for any available fork and grab it when available think for 2 minutes wait for any available fork and grab it when available eat for 5 minutes release both forks Suppose Kant and Heidegger sit at the same table with two forks available and start their respective behaviors at the same time. Give an event trace such as: At minute 4, Kant takes fork 1. ... Which type of undesirable situation does this scenario illustrate? a. lack of thread safety b. runtime type error c. memory leak d. deadlock What are possible ways of avoiding this kind of undesirable situation? • use an explicit locking mechanism to enforce mutually exclusive access to each fork • provide at least one more fork • treat both forks as a single resource bundle that must be acquired together at the same time • provide a fork and a knife instead of two forks and rewrite the behaviors such that each philosopher must acquire the fork first E E v v a a l l : : C C o o u u r r s s e e E E f f f f e e c c t t i i v v e e n n e e s s s s Sample questions (Likert scale): Rate BEFORE/AFTER taking this course • your eventbased programming expertise • your threadbased concurrency expertise • your cloud computing expertise • your feeling of preparedness for the job market • the effectiveness of Android for learning event based programming Results available at laufer.cs.luc.edu/teaching/edupar (QR code above). E E d d u u P P a a r r ' ' 1 1 3 3 F F u u t t u u r r e e P P l l a a n n s s Computer Systems/CS3 • Loyola course number: COMP 264 • offered every spring • envisioning PDC module with suitable architecture, programming, and crosscutting topics Algorithms/CS7 • Loyola course number: COMP 363 • offered every fall • developing PDC module: models of computation and complexity, basic algorithmic paradigms, and specific problems and their algorithmic solutions Evaluation • Once our course modules have stabilized, we will need to measure their effectiveness longitudinally over a three to fiveyear period. • Refine our current evaluation approach by working with Loyola’s Center for Science & Math Education, as well as the TCPP and fellow early adopters. Dissemination: workshops for subsequent adopters in the Midwest

Spring11: PDC in CS1/2 and a mobile/cloud intermediate ...tcpp.cs.gsu.edu/curriculum/sites/default/files... · Spring11: PDC in CS1/2 and a mobile/cloud intermediate software design

  • Upload
    others

  • View
    1

  • Download
    0

Embed Size (px)

Citation preview

Page 1: Spring11: PDC in CS1/2 and a mobile/cloud intermediate ...tcpp.cs.gsu.edu/curriculum/sites/default/files... · Spring11: PDC in CS1/2 and a mobile/cloud intermediate software design

SSpprriinngg­­1111:: PPDDCC iinn CCSS11//22 aanndd aammoobbiillee//cclloouudd iinntteerrmmeeddiiaatteessooffttwwaarree ddeessiiggnn ccoouurrsseeJ. Kaylor • K. Läufer • C. Sekharan • G. K. ThiruvathukalDept. of Computer Science • Loyola University Chicago • USAwww.cs.luc.edu • [email protected] • edupar.cs.luc.edu

CCaarrnneeggiiee CCllaassssiiffiiccaattiioonn• Level: 4­year or above

• Control: Private not­for­profit

• Undergraduate Instructional Program: Bal/HGC

• Graduate Instructional Program:CompDoc*/MedVet

• Enrollment Profile: MU

• Undergraduate Profile: FT4/MS/HTI

• Size and Setting: L4/R

• Basic: RU/H: Research Universities (highresearch activity)

• Community Engagement: Curricular, Outreach,Partnerships

*CS/SE/IT: up to masters' level

IInnssttiittuuttiioonnaall PPrrooffiillee• Urban, private, Jesuit, liberal arts, ~16k

students

• College of Arts and Sciences, ~8k students

• Dept. of Computer Science, ~250 students

• 10 FT faculty: 9 CS, 1 bioinf (1/2 FTE), 1algebraist (1/4 FTE)

• ~140 undergrad majors in CS, SE, IT,Networks & Security, bioinformatics

• ~110 master's students in CS, SE, IT

• External funding: NSF S­STEM, NSF BPC leadinstitution, NSF research grants, industrygrants and donations

• Very early adopters: '97 concurrency course,OOPSLA '98 edu symp paper, HPJPC book

PPoossiittiioonn SSttaatteemmeennttss

[for discussion]

• To teach PDC topics effectively, they shouldnot be taught in isolation. Instead, theyshould be taught in the context of relevantsoftware engineering best practices.

• Mobile applications backed by RESTful cloudservices are rapidly emerging as themainstream paradigm of computing[Christensen, OOPSLA '09]. PDC curriculashould embrace it.

PPrriioorr OOuuttccoommeessSpring 2011: We implemented three three­

week PDC course modules (20% of our 15­week semester) targeting three requiredcourses usually taken in the second year.

AY 2011­12: We implemented four three­week advanced PDC course modules inprogramming and distributed computingtargeting electives typically offered everythree semesters.

WWhheerree oouurr GGrraadduuaatteess GGoo• Industry ~ 80%

• midwest, coasts, international• consulting, finance, software, telecom, ...

• Academia and Government ~ 15%• Argonne, county admin, local universities

• Graduate School ~ 3%

• local, national• Professional Schools ~ 2%

• business, law, medical

AAbbssttrraacctt//CCuurrrreenntt FFooccuussAY 2012­13: We are moving PDC topics

further down into CS1 and CS2, fleshing outPDC coverage in our intermediate object­oriented development course (CS 313), andstepping up evaluation.

CCSS11• Spring 2013: separate section aimed at majors in physics and other hard sciences

• includes some material on numerical methods at the K and C levels

• about 9 class hours were dedicated to sequential and parallel versions of thesealgorithms and the possible resulting speedup using data parallelism in C#

• example: threads for speeding up trapezoidal rule integration

for (i = 0; i < numThreads; i++) {// create and start new child threadsits[i] =new IntegTrap1Region(start, end, granularity, fn) ;childThreads[i] = new Thread(new ThreadStart(its[i] . run) ) ;childThreads[i] . Start() ;// set the range for the next threadstart = end;end = a + (i + 2. 0d) / numThreads * range;

}for (i = 0; i < numThreads; i++) {

// wait for child threads to finishchildThreads[i] . Join() ;totalArea += its[i] . getArea() ;

}

CCSS22• emphasis on PDC topics in CS2 starting in fall 2011

• 9­hour PDC module on task parallelism, speedup, and load balancing in algorithmsinvolving arbitrary precision arithmetics

• presentation at the C and A levels in the form of various examples

• example: compute Fibonacci numbers based on repeated squaring of 2­by­2matrices of BigIntegers in Java

• experiment with the speedup resulting from executing lines (3) and (4) in separate threads• explore load balancing between these unequal tasks

public BigInteger[] matMultFib(final BigInteger[] fibK) {final BigInteger[] matFib2K =new BigInteger[2] ;matF[0] = fibK[0] . multiply(fibK[0] ) . add(fibK[1] . multiply(fibK[1] ) ) ; // (3)matF[1] = fibK[1] . multiply(fibK[0] . shiftLeft(1) . add(fibK[1] ) ) ; // (4)return matFib2K;

}

IInntteerrmmeeddiiaattee OObbjjeecctt­­OOrriieenntteedd DDeevveellooppmmeenntt• Loyola course number: COMP 313

• since fall 2011: C#, emphasis on PDC topics

• since fall 2012: Java with Android as highly effective context for studyingconcurrency and distributed computing topics (C and A levels)

// local task: i is the number to checkfinal long half = i / 2;final double dHalf = half;for (long k = 2; k <= half; k += 1) {

if (isCancelled() ) break;publishProgress((int) ((k / dHalf) * 100) ) ;if (i % k == 0) return false;

}return true;

// invoke same code on the remote sidefinal HttpResponse response =

client. execute(request) ;final int status =

response. getStatusLine() . getStatusCode() ;

• double 18­hour PDC module covers

• concurrency and coordination• design forces: safety, liveness, performance• external events and internal timers• background threads• progress reporting and cancelation• offloading computation from mobile device to cloud• throughput­latency tradeoff

• example to illustrate these topics (seescreenshot)

• Android app: brute­force prime checker• remote task returns quickly, local one is still churning

EEvvaall:: LLeeaarrnniinngg AAsssseessssmmeennttSample concurrency questions:Suppose we have two philosophers. The first one, Kant, repeatedlybehaves like so:

think for 10 minuteswait for any available fork and grab it when availablethink for 2 minuteswait for any available fork and grab it when availableeat for 5 minutesrelease both forks

The second one, Heidegger, repeatedly behaves like so:think for 11 minuteswait for any available fork and grab it when availablethink for 2 minuteswait for any available fork and grab it when availableeat for 5 minutesrelease both forks

Suppose Kant and Heidegger sit at the same table with two forksavailable and start their respective behaviors at the same time. Givean event trace such as:

At minute 4, Kant takes fork 1....

Which type of undesirable situation does this scenario illustrate?a. lack of thread safety b. run­time type error c. memory leak d. deadlock

What are possible ways of avoiding this kind of undesirable situation?• use an explicit locking mechanism to enforce mutually exclusive access toeach fork

• provide at least one more fork• treat both forks as a single resource bundle that must be acquired togetherat the same time

• provide a fork and a knife instead of two forks and rewrite the behaviorssuch that each philosopher must acquire the fork first

EEvvaall:: CCoouurrssee EEffffeeccttiivveenneessssSample questions (Likert scale): Rate BEFORE/AFTER

taking this course• your event­based programming expertise• your thread­based concurrency expertise• your cloud computing expertise• your feeling of preparedness for the job market• the effectiveness of Android for learning event­

based programming

Results available atlaufer.cs.luc.edu/teaching/edupar (QR codeabove).

EEdduuPPaarr''1133

FFuuttuurree PPllaannssComputer Systems/CS3

• Loyola course number: COMP 264• offered every spring• envisioning PDC module with suitable architecture,

programming, and cross­cutting topicsAlgorithms/CS7

• Loyola course number: COMP 363• offered every fall• developing PDC module: models of computation and

complexity, basic algorithmic paradigms, andspecific problems and their algorithmic solutions

Evaluation

• Once our course modules have stabilized, we willneed to measure their effectiveness longitudinallyover a three­ to five­year period.

• Refine our current evaluation approach by workingwith Loyola’s Center for Science & Math Education,as well as the TCPP and fellow early adopters.

Dissemination: workshops for subsequentadopters in the Midwest