Running C, C++, and MPI Programs on the Cray SV1
- ssh cray
- enter the password - "a" + student number
- To copy the necessary files from your regular account use ftp:
- ftp cray, enter your password
- "put file.c"
- "ls" - this will list the files in your directory on the Cray
- "bye" - exits ftp
- Compile your program:
- For c: "cc -o filename filename.c"
- For C++: "CC -o filename filename.cpp"
- Fortran 90: "f90 filename.f90" or "f90 -o filename filename.f90"
- Without the -o option creates an executable as a.out
- Run mpi:
- mpirun -np 5 file (we have up to 16 processors you can use)
- Editing your files - Use emacs or vi, otherwise edit on your workstation
- To Run C/C++ on the Cray SV1:
- cc -o filename filename.c -O 3
- The "-O 3" above optimizes the C compiler
- C++: CC -o filename filename.c -O 3
- running the program: filename (this runs the executable)
- To compile and run an MPI program: (only C or Fortran MPI programs will
work)
- compile your MPI program: cc -o myprog myprog.c
This creates an output, executable file called "myprog"
- Run your MPI program: mpirun -np 5 myprog
This runs myprog with 5 processes
- Put these results on your portfolio webpage:
- Include a description what you've done, which program(s)
- Screenshot(s) of your output of running programs on the Cray
- Links to code that you ran on the Cray (try to save a copy as "txt"
-
this makes it easier to load and view in a browser)