390 likes | 481 Views
Getting Started with Linux. Douglas Thain thain@cs.wisc.edu University of Wisconsin, Computer Sciences Condor Project October 2000. Who are we?. Mr. Douglas Thain (thain@cs.wisc.edu) University of Wisconsin (Formerly University of Minnesota) I/O in widely distributed systems
E N D
Getting Started with Linux Douglas Thain thain@cs.wisc.edu University of Wisconsin, Computer Sciences Condor Project October 2000
Who are we? • Mr. Douglas Thain (thain@cs.wisc.edu) • University of Wisconsin • (Formerly University of Minnesota) • I/O in widely distributed systems • Dr. Patrick Schelling (schelling@anl.gov) • Argonne National Labs • (Formerly University of Minnesota) • Atomic modeling • Both resident at NCST October 15-27
Lectures and Workshops • “Getting Started with Linux” • Editing, compiling, and graphing on the new Linux machines. • “Condor by Example” • Managing 100s of jobs over weeks or months with Condor. • “Installing and Managing Condor” • Technical matters of running Condor.
Overview • Lecture • Cluster Overview • What is Linux? • Software • Workshop • Logging In and Getting Help • Compiling a Program • Graphing Results
Linux Cluster • One large server • 800 MHz CPU, 512 MB memory, 20 GB disk • Five smaller client machines • 666 MHz CPU, 128 MB memory, 10 GB disk • All run the Linux operating system • Managed by Condor software
Cluster Overview • People may sit and work at any client. • Condor software will make use of clients that are not in use. • Jobs restarted after power failures. • Jobs moved to idle machines. • Jobs run in the middle of the night. • More about Condor at 2nd lecture.
Cluster Overview Server Work managed by Condor Client Client Client Client Client
Cluster Overview Server Work managed by Condor Client Client Client Client Client
Cluster Overview Server Work managed by Condor Client Client Client Client Client
What is Linux? • Linux is a free operating system. • An operating system is the basic software which manages a computer. • Windows NT • Macintosh OS • Linux is a variant of the UNIX operating system. • Solaris • IRIX
Advantages of Linux • Linux is free: • Price is zero. • Unlimited copies permitted. • Read and change source code. • Manuals are on-line. • Common in scientific circles. • Text interface is good for batch processing and management.
Disadvantages of Linux • Text interface is not as user-friendly as Windows. • But, has StarOffice software which is looks much like Windows. • Less commercial software available. • But, more scientific software available. • More difficult to set up. • But, once set up, easy to manage.
Available Software • Most software for Linux is also free! • The GNU project is the source of much free software: gcc, g77, emacs • Workshop will concentrate on these text-based programs.
Available Software • Compilers: • G77 (FORTRAN 77) • Gcc ( C ) • g++ (C++) • Text editors • Emacs • Typesetting • Troff, TeX • Graphing • Gnuplot
Available Software • StarOffice provides a Windows-like environment: • Word processor • Spreadsheet • Overhead slide designer • Can load and save existing files created on a Windows computer.
Workshop • Logging In • Running a FORTRAN Program • Graphing and Printing Results • Managing Files • Logging Out
Create a Shell Window • Press the _____ button to create a shell window. • To move the window, grab the top. • To resize the window, grab the corners.
Create Another • You will type commands into a shell. • If you like, you may do several things at once. • Make another shell and arrange them side by side.
Create a Program • Three steps to creating a program • Create a source file • Compile the source into a program • Run the program
Create a Source File • Let’s write a simple FORTRAN program and store it in the file “simple.f”. • Type: • emacs simple.f & • In the new window, enter the simple program on the next page:
Create a Source File PROGRAM SIMPLE REAL I DO I=1, 100 PRINT *, I, SIN(I)*(I**2) END DO END Important: Indent 7 spaces Type in all CAPITALS
Create a Source File • When you are done typing, click “files” then “save buffer”.
Compile the Source • Use the GNU FORTRAN 77 compiler to convert the source file into an executable program. • In the shell window, type: • g77 simple.f -o simple Run the FORTRAN compiler. Read the source from “simple.f” Create the program in “simple”
Run the Program • Type ./ and the name of the program: • ./simple • It will display a table of x2sin(x) for all x from 1 to 100: 1. 0.842470957 2. 3.63718963 3. 1.27007997 …
Saving the Output • To save the output in a file: • ./simple > output • To look at the output later: • cat output • The output is very long! To look at it slowly: • cat output | more • To print out the output: • lpr output • To print out the source: • lpr simple.f
Graphing Results • To graph the output of our simple program, start gnuplot and then direct it to the output file: • gnuplot • plot “output” • There are many different options for plotting: • plot “output” with lines • plot “output” with dots • When done plotting, quit gnuplot: • quit
Graphing Results • To save a graph in a file: • gnuplot • set terminal postscript • set output “graph.ps” • plot “output” • Quit • To view the graph later: • gv graph.ps • To print the graph: • lpr graph.ps
Managing Files • To list files: • ls • To move files: • mv • To copy files: • cp • To remove files: • rm
Managing Files • Look at all your files: • ls simple.f simple output graph.ps Source code Output file Saved graph Compiled program
Managing Files • Try moving one file to another name: • mv output oldoutput • Now list again to see the results: • ls simple.f simple oldoutput graph.ps
Managing Files • Make a copy of the saved graph: • cp graph.ps graph2.ps • Now list again to see the results: • ls simple.f simple oldoutput graph.ps graph2.ps
Managing Files • Remove the output file: (be careful!) • rm oldoutput • Now list again to see the results: • ls simple.f simple graph.ps graph2.ps
Online Manuals • Each of these commands has many different options. Use the “man” command to read online manuals: • man ls • man g77 • If you don’t know exactly what command to use, use “apropos” to propose man pages: • man -k delete
Logging Out • When done, you must log out of the machine so others may use it. • Quit all open programs: • In gnuplot, type “quit”. • In emacs, select “files” then “exit” • In a shell window, type “exit” • Finally, press the “logout” button.
More Things to Try • The StarOffice tools: • soffice • Online manuals: • man ls • Help with gnuplot options: • gnuplot • help
Change to Workshop • Meet in room ____ at _____ • Bring printouts to follow along.