COMPARATIVE LANGUAGES
Fall 2005
C Programming

  • Starter program for vectors and matrices in C: vectors1.c, vector1B.c - version with subroutines

  • C programming assignment 1: dot product (vectors), addition (matrices), multiplication (matrices)

  • We have C on the our workstations (gcc) and on the Cray (cc).

  • You can do these C programs on both the workstations and the Cray.
    Try your matrix programs on large matrices and compare the speeds of

  • Workstations: compile this with: "gcc prog.c" (generates a.out as an executable)
    or "gcc -o prog prog.c (generates "prog" as an executable)
    ARRAY ELEMENTS START ON INDEX 0

  • To use the Cray SV1:
    1. ssh cray, your passwd should be astudentnum
    2. The only editor is vim. If you want to use the workstation's editor,
      use gftp (with SSH) to connect to the Cray and copy files back and forth)
    3. Starter program for vectors and matrices in C: vectors1.c, vector1B.c - version with subroutines
    4. On the Cray: compile this with "cc prog.c" (generates a.out as an executable)
      or "cc -o prog prog.c (generates "prog" as an executable)

  • Complete coding the program for: