📄 node65.html
字号:
<html><!DOCTYPE HTML PUBLIC "-//W3O//DTD W3 HTML 2.0//EN">
<!Converted with LaTeX2HTML 95.1 (Fri Jan 20 1995) by Nikos Drakos (nikos@cbl.leeds.ac.uk), CBLU, University of Leeds >
<HEAD>
<TITLE> Exercises</TITLE>
</HEAD>
<BODY>
<meta name="description" value=" Exercises">
<meta name="keywords" value="book">
<meta name="resource-type" value="document">
<meta name="distribution" value="global">
<P>
<BR> <HR><a href="msgs0.htm#2" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/tppmsgs/msgs0.htm#2"><img ALIGN=MIDDLE src="asm_color_tiny.gif" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/asm_color_tiny.gif" alt="[DBPP]"></a> <A NAME=tex2html2715 HREF="node64.html" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node64.html"><IMG ALIGN=MIDDLE ALT="previous" SRC="previous_motif.gif" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/previous_motif.gif"></A> <A NAME=tex2html2723 HREF="node66.html" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node66.html"><IMG ALIGN=MIDDLE ALT="next" SRC="next_motif.gif" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/next_motif.gif"></A> <A NAME=tex2html2721 HREF="node51.html" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node51.html"><IMG ALIGN=MIDDLE ALT="up" SRC="up_motif.gif" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/up_motif.gif"></A> <A NAME=tex2html2725 HREF="node1.html" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node1.html"><IMG ALIGN=MIDDLE ALT="contents" SRC="contents_motif.gif" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/contents_motif.gif"></A> <A NAME=tex2html2726 HREF="node133.html" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node133.html"><IMG ALIGN=MIDDLE ALT="index" SRC="index_motif.gif" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/index_motif.gif"></A> <a href="msgs0.htm#3" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/tppmsgs/msgs0.htm#3"><img ALIGN=MIDDLE src="search_motif.gif" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/search_motif.gif" alt="[Search]"></a> <BR>
<B> Next:</B> <A NAME=tex2html2724 HREF="node66.html" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node66.html"> Chapter Notes</A>
<B>Up:</B> <A NAME=tex2html2722 HREF="node51.html" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node51.html">5 Compositional C++
</A>
<B> Previous:</B> <A NAME=tex2html2716 HREF="node64.html" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node64.html">5.13 Summary</A>
<BR><HR><P>
<H1><A NAME=SECTION032140000000000000000> Exercises</A></H1>
<P>
<OL><LI>
Extend Program <A HREF="node55.html#progcctree" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node55.html#progcctree">5.4</A> to allow for nonbinary trees: that
is, trees with an arbitrary number of subtrees rooted at each node.
<P>
<LI>
<A NAME=excc11> </A>
Design and construct a CC++
implementation of the manager/worker
structure used in the parameter study problem described in
Section <A HREF="node10.html#exdatabase" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node10.html#exdatabase">1.4.4</A>.
<P>
<LI>
Design and construct a decentralized version of the manager/worker
structure developed in Exercise <A HREF="node65.html#excc11" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node65.html#excc11">2</A>. Design and carry out
experiments to determine when each version is more efficient.
<P>
<LI>
Design and implement a program that can be used to quantify
CC++
processor object and thread creation costs, both within the same
processor and on remote processors. Conduct experiments to measure
these costs, and obtain estimates for <IMG BORDER=0 ALIGN=MIDDLE ALT="" SRC="img869.gif" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/img869.gif"> and <IMG BORDER=0 ALIGN=MIDDLE ALT="" SRC="img870.gif" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/img870.gif">.
<P>
<LI>
<A NAME=excc6> </A>
Implement and instrument the channel library presented in
Section <A HREF="node62.html#secccchan" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node62.html#secccchan">5.11</A>, and use this code to measure
CC++
communication costs on various parallel computers.
<P>
<LI>
Modify the program developed in Exercise <A HREF="node65.html#excc6" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node65.html#excc6">5</A> to use <tt>
spawn</tt> to implement the RPC used for a send operation, and conduct
experiments to compare the performance of the two versions.
<P>
<LI>
<A NAME=excc1> </A>
Complete Program <A HREF="node60.html#progccfd1" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node60.html#progccfd1">5.13</A>, using the channel library of
Section <A HREF="node62.html#secccchan" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node62.html#secccchan">5.11</A> to perform communication.
<P>
<LI>
<A NAME=excc2> </A>
Complete Program <A HREF="node60.html#progccfd2" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node60.html#progccfd2">5.14</A>, using the channel library of
Section <A HREF="node62.html#secccchan" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node62.html#secccchan">5.11</A> to perform communication.
<P>
<LI>
Design and carry out experiments to compare the performance of the
programs developed in Exercises <A HREF="node65.html#excc1" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node65.html#excc1">7</A> and <A HREF="node65.html#excc2" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node65.html#excc2">8</A>.
<P>
<LI>
Use the <tt> POArray</tt> class of Program <A HREF="node59.html#progccpo" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node59.html#progccpo">5.10</A> to implement a
version of Program <A HREF="node55.html#progcctree" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node55.html#progcctree">5.4</A> in which search tasks are
implemented as threads mapped to a fixed number of processor objects.
<P>
<LI>
Extend the program developed in Exercise <A HREF="node65.html#excc1" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node65.html#excc1">7</A> to provide a
2-D decomposition of principal data structures.
<P>
<LI>
Extend the channel library presented in Section <A HREF="node62.html#secccchan" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node62.html#secccchan">5.11</A> to
allow polling for pending messages.
<P>
<LI>
Extend the channel library presented in Section <A HREF="node62.html#secccchan" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node62.html#secccchan">5.11</A> to
provide a merger that allows multiple senders on a channel.
<P>
<LI>
Implement a hypercube communication template (see
Chapter <A HREF="node123.html#chapcube" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node123.html#chapcube">11</A>). Use this template to implement simple
reduction, vector reduction, and broadcast algorithms.
<P>
<LI>
Construct a CC++
implementation of the tuple space module described
in Section <A HREF="node44.html#secmodts" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node44.html#secmodts">4.5</A>. Use this module to implement the
database search problem described in that section.
<P>
</OL>
<P>
<BR> <HR><a href="msgs0.htm#2" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/tppmsgs/msgs0.htm#2"><img ALIGN=MIDDLE src="asm_color_tiny.gif" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/asm_color_tiny.gif" alt="[DBPP]"></a> <A NAME=tex2html2715 HREF="node64.html" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node64.html"><IMG ALIGN=MIDDLE ALT="previous" SRC="previous_motif.gif" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/previous_motif.gif"></A> <A NAME=tex2html2723 HREF="node66.html" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node66.html"><IMG ALIGN=MIDDLE ALT="next" SRC="next_motif.gif" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/next_motif.gif"></A> <A NAME=tex2html2721 HREF="node51.html" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node51.html"><IMG ALIGN=MIDDLE ALT="up" SRC="up_motif.gif" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/up_motif.gif"></A> <A NAME=tex2html2725 HREF="node1.html" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node1.html"><IMG ALIGN=MIDDLE ALT="contents" SRC="contents_motif.gif" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/contents_motif.gif"></A> <A NAME=tex2html2726 HREF="node133.html" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node133.html"><IMG ALIGN=MIDDLE ALT="index" SRC="index_motif.gif" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/index_motif.gif"></A> <a href="msgs0.htm#3" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/tppmsgs/msgs0.htm#3"><img ALIGN=MIDDLE src="search_motif.gif" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/search_motif.gif" alt="[Search]"></a> <BR>
<B> Next:</B> <A NAME=tex2html2724 HREF="node66.html" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node66.html"> Chapter Notes</A>
<B>Up:</B> <A NAME=tex2html2722 HREF="node51.html" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node51.html">5 Compositional C++
</A>
<B> Previous:</B> <A NAME=tex2html2716 HREF="node64.html" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/node64.html">5.13 Summary</A>
<BR><HR><P>
<P><ADDRESS>
<I>© Copyright 1995 by <A href="msgs0.htm#6" tppabs="http://www.dit.hcmut.edu.vn/books/system/par_anl/tppmsgs/msgs0.htm#6">Ian Foster</a></I>
</ADDRESS>
</BODY>
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -