Week 3
Lecture Notes
- Ben-Ari Ch's 1 and 2
- Ben-Ari slides: PDF
- Formula(number of possible interleavings):
- # interleavings = (nk)! / (k!)^n
- where n = # processes and k = # steps / process
- assumes all n processes have same number of steps (k)
Homework
- Written HW: Ben-Ari p. 39:
- Exercises 2, 3, and 4
- Due: Wed, Sep 16
- submit via Moodle
Programming Assignment 2
- UPC Exercises 1.1 through 1.7
- Due: Wed, Sep 23
- Here's a link: 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 // . // . }
- Here's another reference:
http://www.gnu.org/software/libc/manual/html_node/CPU-Time.html
UPC
- Unified Parallel C
- see resources in sidebar
- tutorial introduction (see recorded zoom lecture from Monday)
ssh keys
- if you haven't already done so, 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
$ ssh-keygen
hit enter through all the prompts$ cd ~/.ssh
- 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:
al101
–al124
- 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
setup
- 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 aupc
directory under your course directory
- now you're ready to compile and run! (see sidebar technical reference)