Week 4

  • Written HW: Ben-Ari p. 39:
    • Exercises 2, 3, and 4
    • Due: today (11:59pm, if that helps)
  • UPC Exercises 1.1 through 1.7
  • Due: Wed, Feb 20
  • Here's a link to a PDF of Ch. 1: private
  • Hints
    • For timing your C/UPC programs, add the following to your code
            #include <time.h>
       
            int main()
            {
              clock_t startTime = clock();
              // your code to compute the C->F temperature conversions here
              // .
              // .
              clock_t endTime = clock();
              double cpuTime = ((double) (endTime - startTime)) / CLOCKS_PER_SEC;
              // print cpu time used
              // .
              // .
            }
       
  • Unified Parallel C
  • see resources in sidebar
  • tutorial introduction
  • you need to set up your accounts for ssh'ing between workstations without password prompts
  • follow these steps to establish a trust connection for your account among our workstations
    1. $ ssh-keygen
      hit enter through all the prompts
    2. $ cd ~/.ssh
    3. then type this command:
      $ cat id_rsa.pub >> authorized_keys
  • for more information about ssh and public key authentication, see: Secure_Shell
  • workstations in Asprey Lab: al101al124
  • ssh into other workstations to test your ssh keys
    • first time you ssh to workstation you will be prompted to confirm it's okay: yes
    • subsequent logins to that workstation should be without passwords or prompts!
    • this is what you need to do before attempting to run your UPC programs
  • create a bin directory if you don't already have one:
    • $ cd
    • $ mkdir bin
  • copy my setup script into your bin directory:
    • $ cp ~mlsmith/bin/set-upc-env ~/bin
  • run your setup script:
    • $ source ~/bin/set-upc-env
  • copy the tutorial programs to your account under your course directory:
    • $ cd ~/cs377
    • $ cp -r ~mlsmith/cs377-examples/upc ./
      this will create a upc directory under your course directory
  • now you're ready to compile and run! (see sidebar technical reference)
  • Ben-Ari Ch's 1 and 2
    • Ben-Ari slides: PDF
      • resume slide 50
    • Formula(number of possible interleavings):
      • # interleavings = (nk)! / (k!)^n = $\frac{(nk)!} {(k!)^n}$
      • where n = # processes and k = # steps / process