CCL Home Software Community Operations |
Homework 2: Learning Work Queue
This homework has two options. Please pick one option that you are comfortable with to complete this homework. Note: Only *ONE* of the two options needs to be submitted. Use the instructions in the Work Queue user manual to install, setup, and learn more about Work Queue. Option AWrite a Work Queue program to check if "Shakespeare speak" still existsPrerequisites
ObjectivesAt the conclusion of this assignment, students will be able to:
The AssignmentThis assignment is similar to the homework for September 11. In this assignment, you will write a Work Queue program to compare the words seen in the works of Shakespeare with the words currently in use in the English language and identify those words that are still in use. You will compare the words of Shakespeare listed in each of these text files:
Each file contains all the words found in a work of Shakespeare that is identified in the filename. For your convenience, each word is listed in a separate line to make it easier to scan and read them. You will compare the words in each of these files with the dictionary provided in Unix systems (/usr/share/dict/words or /usr/dict/words). If a word is found to exist in the dictionary, you should print the word followed by the string "Art spoken ever and anon!". If not, you should print the word followed by the string "Ne'er spoken ever!". To complete this assignment, you will write a Work Queue program that decomposes the problem into concurrent tasks. Your program should create and submit 5 tasks, each describing a search of the dictionary for the words in a file, or in other words, one task per file. You will run this master program on one of the Future Grid head nodes as described here. Finally, you will then submit five Work Queue workers on the Future Grid Torque
batch submission system as follows:
Hint: To read each file and compare the words listed in it against the dictionary, you can use this simple python program: shakespeare-compare.py. You will then have this program executed remotely by specifying the filename containing the words to check. For example, to check if the words in hamlet.txt exist in the dictionary, run: python shakespeare_compare.py hamlet.txt
Create concurrent tasks that check each of the files by executing this program. DeliverablesYou are required to submit the following for this option in the homework:
Option BConfigure Work Queue to run on multiple cloud platformsPrerequisites
ObjectivesAt the conclusion of this assignment, students will be able to:
The AssignmentFor this assigment, you will need to download the following files:
You will run the Work Queue master program on multiple platforms. The master program creates and submits 20 tasks that invoke simulation.py with different parameters for concurrent execution. To execute the 20 tasks created and submitted by the Work Queue master, you will start one worker on each of these platforms: Future Grid, HPC cluster at UA, iPlant, Amazon EC2, and personal laptop. In this assignment, you will use the catalog server and project name feature to have the workers automatically find their master and establish connection. To do this, the master needs to be provided with a project name that will be advertised to the catalog server. You will modify the Work Queue master program to use the catalog server by enabling the catalog mode using the specify_master_mode() API. Similarly, you will modify the program to specify a project name using the specify_name() API. An example of their usage is given below: try:
Q = WorkQueue(port = 0)
except:
sys.exit(1)
Q.specify_master_mode(WORK_QUEUE_MASTER_MODE_CATALOG)
Q.specify_name("dinesh-wq")
You will then start workers for your Work Queue master by specifying the option to use the catalog server (-a option) and the project name of your master (-N option). Example: work_queue_worker -d all -a -N dinesh-wq
To successfully run Work Queue workers on multiple platforms, you may need to build and install CCTools on those platforms. So please start early. Follow these instructions to download and install CCTools. DeliverablesYou are required to submit the following for this option in the homework:
|