全球主机交流论坛

 找回密码
 注册

QQ登录

只需一步,快速开始

IP归属甄别会员请立即修改密码
查看: 2431|回复: 18
打印 上一主题 下一主题

[疑问] 续:美国本科作业, 本周的作业题

[复制链接]
跳转到指定楼层
1#
发表于 2011-10-15 09:20:27 | 只看该作者 回帖奖励 |倒序浏览 |阅读模式
本周翘课了,求辅导。

作业1:
    Read the man page for the time command for observing various timing measurements on Linux.
    Run the timing experiments for the suggested number of test runs and record the results.
    Use the Linux sort command. You will need a large datafile. This can be any text document and can be concatenated mutltiple times to produce a large enough file. Note that if the file is too small, you will not get a useful measurement. Also, keep an unsorted copy so you can repeat the tests.
    Write your observations regarding the timing experiments:
        Include the data with your observations.
        Comment on the differences between the types of time measurements supplied by the time command and how you used each one.

作业2: 编程
    Write a simple program that exercises various system resources such as memory allocation, CPU usage, and I/O usage. Design a calculation for some expression and run a range of values in the expression in a loop. You will need to make a large number of iterations to make this work so you can time it.
    Using the time command under Unix, measure the time required for the program to run. Divide each time by the number of operations that the program reports. Estimate running time based on the number of operations your program will use.
    Analyze the code and timing. Compare the three program types (memory allocation bound, CPU bound, and I/O bound) and speculate on why differences may occur.
2#
发表于 2011-10-15 09:21:51 | 只看该作者
记录结果。使用Linux的 sort命令。您将需要一个大的数据文件。这可以是任何文本文件,并可以连接在一起mutltiple倍,产生足够大的文件。请注意,如果该文件是太小了,你不会得到一个有用的测量 。此外,保持一个未排序的副本,所以你可以重复测试     。写入您的意见的时机         实验:包括与你的观测         数据。评论之间的时间测量时间命令提供的类型,以及如何您使用的每一个差异。 作业2:编程     写一个简单的程序行使各种系统资源,如内存分配,CPU使用率和I / O使用率 。设计某些表达式的计算和运行在一个循环中的表达的一个值的范围。您将需要进行大量的迭代,使这项工作,这样你就可以时间     。Unix下使用的时间命令,测量程序运行所需的时间 。除以的操作数,该计划的报告,每次 。你的程序基础上的操作数的估计运行时间将     使用分析代码和定时 。比较三个方案类型(内存分配的约束CPU束缚,I / O绑定),并猜测为什么差异可能发生
3#
 楼主| 发表于 2011-10-15 09:22:41 | 只看该作者
- - 求辅导,没求软翻
4#
发表于 2011-10-15 09:24:47 | 只看该作者
你在美国上学吗?
5#
 楼主| 发表于 2011-10-15 09:25:20 | 只看该作者
原帖由 wdstar 于 2011-10-15 09:22 发表
- - 求辅导,没求软翻

6#
发表于 2011-10-15 09:28:20 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
7#
发表于 2011-10-15 09:32:53 | 只看该作者
提示: 作者被禁止或删除 内容自动屏蔽
8#
发表于 2011-10-15 09:48:05 | 只看该作者
给你顶下,估计整个个论坛不一定搞定
9#
发表于 2011-10-15 10:09:17 | 只看该作者
time会给出三个时间。
第一个作业让你用sort做例程,分析三个时间是什么,第二个作业让你自己写个例程,体现三个时间的差别。
10#
发表于 2011-10-15 10:11:26 | 只看该作者
题目还看不明白来着
您需要登录后才可以回帖 登录 | 注册

本版积分规则

Archiver|手机版|小黑屋|全球主机交流论坛

GMT+8, 2025-9-27 23:19 , Processed in 0.060281 second(s), 10 queries , Gzip On, MemCache On.

Powered by Discuz! X3.4

© 2001-2023 Discuz! Team.

快速回复 返回顶部 返回列表