Computer design

From 22112
Jump to navigation Jump to search
Previous: Coding against databases Next: Queueing System

Material for the lesson

Video: Computer architecture and design
Video: Computerome modules
Video: Python IO performance & file buffers
Powerpoint: Supercomputers
Resource: Computerome 2 general information
Video: Exercises

Tasks to do

  • Set up the two-factor authentication with Entrust IdentityGuard soft token for logging in to Computerome 2.
  • Familiarize yourself with connecting to Computerome. Simple videos are avaliable on the web site.
  • Examine the modules system mentioned in the powerpoint and the web site.
  • Find the course directory /home/projects/pr_course. All files that I refer to during the course will be in that folder.
  • Set up a personal folder in the people folder, which is in the course directory. This personal folder is not your home folder, but the place where you put the files/exercises you create during the course. Set permissions so the group can read, otherwise we am unable to read your stuff. Make sure we can easily see what exercise you are solving.

Exercises

Create four python scripts which copies the file human.fsa to your own home, using the four different methods mentioned in the powerpoint. Time the programs using ’time’, e.g.

time python mycopy1.py

Also time the simple Unix cp doing the same task. Delete your copy afterwards.
Rank the programs according to performance and explain the difference in execution time.

This is actually a bit hard to do correctly. Considering what you learned about file buffering, then reading the same file twice (or more) in a row will use the file buffers instead of real IO the second time. This means that the first time is always slowest, no matter how efficient the different programs are. You can't even be sure if another student is reading the same file at the same time and hence "disturbs" your measurements.

A way around this problem is simply to use a computer with so little memory, that the file buffer system does not come into play. That is your laptop.
Try to run the scripts on different machines. As minimum you have your laptop, pupil1 and computerome. DTU's HPC system is also an option.