



Study with the several resources on Docsity
Earn points by helping other students or get them with a premium plan
Prepare for your exams
Study with the several resources on Docsity
Earn points to download
Earn points by helping other students or get them with a premium plan
Material Type: Notes; Professor: Li; Class: PARALLEL PROGRAMMING; Subject: Computer Science; University: Portland State University; Term: Unknown 1989;
Typology: Study notes
1 / 5
This page cannot be seen from the preview
Don't miss anything!




Jingke Li
Portland State University
Jingke Li (Portland State University) Review Problems 1 / 9
Consider the search tree shown below (left figure), in which the dark node represents the solution. Assume that traversing each edge (in each direction) counts as one step.
Derive a formula L(k) for the number of links in a k-dimensional binary hypercube.
Jingke Li (Portland State University) Review Problems 3 / 9
Five philosophers spend their lives just thinking and eating. They sit around a circular table, but never talk to each other. There are five forks, placed evenly between the philosphers. To eat, each philosopher must pick up both forks that are placed next to him. Write a SPMD program to simulate the philosophers’ life. (Picture credit: GFDL by Bdesham)
Solution 3: Introduce asymmetry.
while (true) { think(); if (I am philosopher0) { pick up fork(right); if (not available) wait(); pick up fork(left); if (not available) wait(); } else { pick up fork(left); if (not available) wait(); pick up fork(right); if (not available) wait(); } eat(); put down fork(left); put down fork(right); }
Jingke Li (Portland State University) Review Problems 7 / 9
Consider Sollin’s algorithm for finding a minimum-cost spanning tree on a connected graph.
A job for multiprocessor with P processors consists of N independent tasks of two types, long and short: L L S L S S L S S L ... S L Long tasks take TL units of processor time, and short tasks take TS. There are NL long tasks and the rest are short. P divides N evenly and m = N/P > NL. The long tasks are randomly placed among the N tasks. Assume the tasks are being statically scheduled, i.e. without knowing the actual distribution of long and short tasks.