Homework 1 Solution


Category: Tag:


  • Preliminaries

To work on this assignment, you need to have a DevCloud account. You can register through this link. Once your account is activated, you will receive an email with a link to your account as well as the information on how to setup your account, connect to DevCloud through Terminal, upload les and run jobs. You should go over these information to be able to do the rest of the homework.

  • Ray Framework Tutorial (75 points)

The objective of this section is to get you started with Ray Framework. You are provided with a skeleton code ray tutorial.py. This le contains explanation on Ray framework. You should go over the le, read the comments and complete the sections annotated as EXERCISE. To complete this part:

  1. Copy ray tutorial.py to your home directory on DevCloud:

scp /path/to/local/file colfax:/path/to/remote/directory/.

  1. Connect to DevCloud login node: ssh colfax

  1. Connect to a compute node: qsub -I -lselect=1

  1. Implement the exercises in ray tutorial.py

  1. Test your code: python ray tutorial.py

The nal implementation should execute successfully and pass all the assertions.

  • Evaluating The Performance of Ray (25 points)

The objective of this section is to measure the performance of Ray for a simple parallel program. A python le named map reduce.py is provided with this homework. This program generates an array of size 8, increments each element by one, computes the sum of the elements and nally outputs the running time of the program. The only input of the program is the number of the CPUs


that it can use. In this part, you should run this program with di erent CPU numbers (1, 2, 4, 8) and report the running time of the program. The running time is printed to the output as total time: xxx.

  • Deliverables

You should submit a zip le containing 1) completed ray tutorial.py le, 2) a graph of time against number of CPUs for map reduce.py program (this can be in png or jpeg format) .


error: Content is protected !!