CS 575 Xterm Lab Instruction/Use of Timers
Lab 1 BAM 113
SEPT. 11, 2002 (updated)

Dr. Kris Stewart (stewart@sdsu.edu)
San Diego State Univeristy

This handout is stewart.sdsu.edu/cs575/labs/l1_xtermtimer.html

Computational experiments consist of coding in C (C++) or Fortran along with WRITTEN lab reports. Some of the useful tools are introduced in this lab today.

Distribute Class Rohan Accounts and Hardcopy Instructions

Contents:
0: Login
1: Change password/finger
2: Unix timer
3: Email using pine (includes email assignment today
4: Lab Assignment for Today - Results Due 25Sept02 midnight<
5: Customize browser
6: System References

Task Zero (logon to the Xterm)

When in the Xterm Lab (BA113 or BA110 or other campus Xterm labs) you will see an entry on the screen giving a list of computers to login on. Use the mouse to move the cursor to the rohan.sdsu.edu entry and press the left mouse button.

and "double click" with the left mouse button. The screen will clear and a new window will open that will prompt for your
Login:
Password:.

Your class account is the standard "Xterm" window. The Xterm window has the Unix prompt
rohan%
If you are familiar with UNIX and Xwindows, please feel free to customize your environment.

Back to Contents

Task One (a little UNIX) Perform these tasks in an Xterm Window

Open New Xterm window commands at the command line:
xterm -sb&
This command opens an X-terminal window with a scrollbar (-sb). This command is executed in the "background" & so that you should get the UNIX prompt back immediately in your current window.
Change your password:
In an Xterm Window at the UNIX prompt, type
passwd
You will be asked for your current password and then asked for the new one. It should be at least 6 characters long and include at least onek upper case letter (A-Z), digit (0-9) or punctuation character (such as . , or -). It should not be a word easily found in the dictionary.
Change your finger:
In an Xterm Window at the UNIX prompt, type
chfn
and change your identity to the system from being "Generic Account" to be your name. Use your own name to help me learn everyone's name in the class.

Back to Contents

Task Two - Using the System Timers - dtime


We will examine the System Timers, mentioned in lecture Monday and more detailed later ( Ch. 6 Text - only the beginning material, on Overview of the System Timer). In this lab, I would like you to obtain the sample programs (in C and/or Fortran) that actually using the timer.
Obtain sample codes
Run the sample codes
For the C sample
For the Fortram sample

Back to Contents

Task Three (using pine) - start in an Xterm window

Use pine send mail to yourself
In an Xterm window, type

pine

and fill in the "blanks" so the To: field will be masc0430, but use your own class account here.
NOTE: pine will have to initialize itself the first time you use it, so watch the messages at the bottom of the the bottom of your screen and accept all the defaults. A welcome message is displayed and the instructions (at bottom on screen) will tell you how to exit the greeting.
If you wish to use a different mail program, that is your choice, but students have told me they find pine easy to use. NOTE: pine is a text-based mail program which means that it will not respond to your mouse, as Xwindows applications do.
Send email to stewart
It is required that you use cs575 as the first phrase in your subject field on any email you send to me, the instructor.
In the body of the mail message, please send me a simple note so that I can check that your identity has been changed by performing Task 1 above.

Back to Contents

Task Four - Email timing results to instructor - Due 25 Sept02

You should capture the output from running the timing examples above, examine and interpret these results and write a short report on your discoveries. This should be a ascii text file which you will email to your instructor by 25 Sept 02 midnight. You will find the following UNIX commands handy for gathering timing data from your experiments.
Capture output
At the UNIX prompt, issue the command and use the redirect symbol (>) to indicate to UNIX that the output should be placed in the file you choose, e.g.
csample 8 > file1
or
fsample > file2
8
You can examine the contents of these files using the pico editor, or more simply, with the UNIX command
less file1
Append the output of a run to an existing file
csample 16 >> file1 will append the results from the example above and similarly for the Fortran example. If you haven't worked much with Unix, I suggest you try things out until you are comfortable, and confident that you are successful.
Write and then Email your report to stewart
Your assignment is to examine the timing data you are able to collect from either the C or Fortran sample code, whichever language you feel most comfortable withn now.
You are expected to examine the source code to learn what is being computed and how the timing information is being generated. I suggest you use pico to create your report to gain more familiarity with UNIX and editting ascii text files.
pine stewart
will put you in the pine email mail system. You should enter an appropriate subject field, which must begin CS575, for example,
Subject: cs575 First Experiment
and then scroll to the --Message Text-- portion of the screen. Look at the menu of pine commands at the bottom of your screen and see that ^R Read File will allow you to include the data file you have just created into your mail message. If you were in the subdirectory timers, not in your Home directory, I would recommend selecting the ^T To Files command and then using the arrow keys to navigate to the directory containing your data file. NOTE: ^R means to depress the Ctrl key and at the same time depress the R (either upper case, R, or lower case, r).
Back to Contents

Task Five using Netscape Communicator

In an Xterm window, at the UNIX prompt type
netscape& [Note: netscape6 is available on Rohan now]
  1. Open the location for this courses notes (File/Open Location) http://www.stewart.cs.sdsu.edu/cs575/
  2. Save this link as a bookmark (see toolbar for Bookmarks)

Back to Contents

Task Six - Explore the Answerbook, vi, UNIX, Fortran 90 and C

You might find the following documents useful:
Quick Introduction to the VI editor Unix Editor
UNIX Minimal Unix OS
Back to this lab contents
Back to CS575 Class Home Page