Running Programs on the Cray SV1
(More information on the SV1: Introduction to
the SV1 - ppt, and
SGI/Cray SV1 from Top500.org)
or
this link and
here by Jack Dongarra
- ssh cray (or cray.tjhsst.edu or seymour.tjhsst.edu)
From home:
- 1. ssh remote.tjhsst.edu
- 2. ssh cray.tjhsst.edu from remote
- Use putty.exe for an xterm connection from home
- Use Winscp for a window ftp connection to transfer files
- Same system commands as the workstations, for example:
- ls lists files
- pwd shows the directory path - yours should be /local/yourname
- mkdir directory creates directories (folders) to categorize your files
- cd directory - puts you into directory
- cd ../ moves back one directory
- Transfer files from a workstation to the SV1:
- run gftp from another xterm
- choose SSH2 from the upper right of the gftp window and connect to the Cray with username/password
- For a non-window file transfer use ftp cray
put file transfers your file from our lab to the SV1
get file gets the files from the SV1 to the workstation
Note: you can use "ls", "cd" inside ftp
- Editing programs - the SV1 has only emacs or vim
- Workstation option: use an editor on the workstation. Transfer the source file to the SV1 using gftp or ftp
- vim filename
- You start out in "command" mode
- : linenumber
goes to a line number
- :i
Enters "insert" mode - use this mode to type into your file
:a is similar, appends to the end of a line
- ESC
goes back to "command" mode
- In command mode:
x - deletes one char
dd - deletes one line
- :w saves the file
- :wq saves and quits
- :q! quits without saving
- emacs filename
- CTRL x CTRL s
saves your file, no exit
- CTRL x CTRL c
exits emacs, asks if you want to save
- CTRL x CTRL h
Gets a preliminary help file
q - quits the help
t - gives you a tutorial
space bar scrolls
- C and C++
Specifying the name of your executable:
- cc -o filename filename.c
("-o filename" generates the output/executable file)
- ./filename
(runs the executable)
Not specifying the name of your executable:
- cc filename.c generates the generic a.out as an executable
- use ./a.out to run the executable
C++
- CC -o filename filename.cpp
- ./filename
(runs the executable)
- CC filename.cpp for a.out as the executable
- Fortran 90
- f90 -o filename filename.f90 or f90 filename.f90 for a.out
- ./filename or ./a.out
(runs the executable)
- MPI (Message Passing Interface) (SV1 has the C and Fortran versions of MPI, no C++ version for MPI)
- cc -o filename filename.c
- mpirun -np 4 filename
(runs the executable with 4 processes, "np" = number of processes)
- mpirun -nt 4 filename
(runs the executable with 4 tasks, "nt" = number of tasks,
tasks use shared memory, may be faster than processes)
- OpenMP (Fortran 90 version, no C version)
Example file:
- omp_hello.f90 from
OpenMP exercises (scroll down to "Fortran files")
- f90 omp_hello.f90 compiles an a.out executable
./a.out runs the executable
- OMP_NUM_THREADS=8 changes the number of threads to 8 from the default (probably 4 threads default)
- PVM - for any interested, the SV1 also has Parallel Virtual Machine. This is similar to MPI; we won't be using it in class
MPI Resources