
CSE341T/CSE549T Homework 0 Assigned: 08/25/2014 Due Date: 09/08/2014 This document contains important information that you will need to complete and turn in every assign- ment for CSE 341. 1 Overview Each homework consists of a written portion and the coding portion. The written portion should be turned in in class on the day the homework is due. The coding portion should be checked into your repository before class on the due date. This handout explains the coding mechanics. The coding portion of this course will be managed accordingly: • all code will be written in Cilk Plus, a parallel version of C++ • all code will be graded by an auto-grader • all code will distributed and submitted exclusively via svn • you will need to use the command line to check out, complete, and submit your code This document will explain a little bit more about each of these aspects of the course. However, rather than giving you an isolated, abstract tutorial on using the command line, the rest of this document will simply be written in the context of using the command line. 2 Cilk Plus Intel R CilkTM Plus (see also http://cilkplus.org) is a parallel extension to C++ that we will use to explore the serial and parallel running times of algorithms in the context of multicore and manycore processors. Cilk Plus supports a handful of new keywords (most importantly: cilk spawn and cilk sync) that provide a simple yet surprisingly powerful model for parallel programming. 2.1 Compiling and Running Cilk Plus Programs Your code will only compile on a machine that has an the appropriate compiler installed. At this point, we have installed the Cilk Plus compiler on the machines in the linux lab in Lopata 400. You can physically go into the lab (which we recommend), or remotely ssh into shell.cec.wustl.edu, which is likely to be shared by multiple people, so we don’t recommend doing timing related tasks using this method. One could also remotely ssh into one of the machines in the linux lab, which we will describe how in Section4. Because Cilk Plus is not (yet!) a standard programming language, it is not supported by common integrated development environments (IDEs) such as Eclipse. This is why you will need to become familiar 1 with the command line for this class. That said, using the command line is an important rite of passage for anyone who claims to be a computer scientist, so if you haven’t done it yet, it is about time! Once you are on one of the machines in linux lab, in order to compile and run a Cilk Plus program, you will need to update your environment variables to include the version of gcc that supports Cilk Plus as well as the Cilk Plus dynamic runtime libraries. You only have to take the following steps once, and you’ll be set. 1. Determine what shell is running when you log into cec. Do this by typing: > echo $SHELL at the command line. If you see something ending in tcsh (e.g., /usr/bin/tcsh), goto Step 2. If you see something ending in bash (e.g., /usr/bin/bash), goto Step 3. If you see neither of these, seek help. 2. Add the following line to a file called .cshrc.mine source /cluster/engine/cilk/setup-cilk.csh 3. Add the following line to a file called .bashrc source /cluster/engine/cilk/setup-cilk.sh 3 SVN We will use subversion (see also http://subversion.apache.org) to distribute assignments. Each assignment will have a written portion and a coding portion. The written portion is to be submitted in hard copy in class on the day the assignment is due. The coding portion is to be submitted via svn before class on the day the assignment is due. 3.1 Your SVN Repository Each student in the class will be given their own svn repository, which is accessible only by you, the instruc- tor, the TAs, and a few technical support folks in the department. As is standard in the CSE Department, your repository name will be of the form wustlkey. When you are prompted for a username and password in order to access this account, you should provide your wustlkey username and associated password, not your cec username and password! The most recent checked in version of your repository can always be viewed (by those with permission!) on the web at the URL (depending on which class you are registered to: https://shell.cec.wustl.edu:8443/cse341_fl14/svn/wustlkey/, or https://shell.cec.wustl.edu:8443/cse549_fl14/svn/wustlkey/. This is the version of your code and assignment that the instructor and TAs will see when they grade your assignment. After you submit your homework via svn, it is a very good idea to check out this URL and make sure that everything looks up to date. It is your responsibility to make sure that you submit your homework both punctually and successfully. One of the two is not sufficient. 2 3.2 SVN Checkout The first step is to check out your subversion directory. To achieve this you need to use the svn checkout command (or svn co, for short) in the following steps: 1. Create a directory (we’ll call it cse341) on one of the departmental cec unix machines (e.g., grid.cec.wustl.edu and shell.cec.wustl.edu) for cse341: yourhome> mkdir cse341 2. Enter said directory yourhome> cd cse341 3. checkout your repository yourhome/cse341> svn co https://shell.cec.wustl.edu:8443/cse341_fl14/ svn/wustlkey/ This will create a directory inside cse341 called wustlkey. If you go into this directory: yourhome/cse341> cd wustlkey and look at what’s inside: yourhome/cse341/wustlkey> ls hw00 you will see the directory hw00. This directory contains the files needed to complete the coding portion of the this assignment. Aside: to return to the directory 1 higher up, simply type: yourhome/cse341/wustlkey> cd .. , where the .. means the parent directory. 3.3 SVN Commit Its a good idea to commit your code at regular intervals. Svn can be a backup for you as well as a way to turn in your assignment. For example, when you finish coding up a distinct portion of the assignment, you might commit a working version of your code with the comment: yourhome/cse341/wustlkey/hw01> svn commit -m ’’naive version working’’ When youre completely finished, make sure to commit again: yourhome/cse341/wustlkey/hw01> svn commit m ’’finished HW1’’ Note that the -m flag allows you to specify a commit message. Alternatively, you can set the environ- ment variable SVN EDITOR to specify a default editor (e.g., /usr/bin/vim and /usr/bin/emacs): 3 yourhome/cse341/wustlkey/hw01> export SVN EDITOR=/usr/bin/vim (if you use bash), or yourhome/cse341/wustlkey/hw01> setenv SVN EDITOR=/usr/bin/vim (if you use tcsh). Then, when you commit without the flag, svn will bring up a buffer using your default editor, which al- lows you to write a longer commit message. 3.4 SVN Add If you create any new files inside an svn managed directory, they will not be automatically added to your svn repository. This is a good thing, since it keeps your repository from being filled with executables, .o, and ˜ files that you might generate while running and editing your code. That means, if you ever create a new file that you want to submit, you will need to explicitly add and commit it to your repository. We mention this capability for completeness only. In this course, it is not be expected that you will be creating new files in order to finish assignments. Unless you are told explicitly otherwise, you should really not need to use this command for this course. 3.5 SVN Status Another handy command to know is svn status which tells you the status of the files that svn is tracking. Let’s say you have edited the file student solution.cpp and compiled the program (which causes an executable named fib to be created). If you check the status of your repository at this point: yourhome/cse341/wustlkey/hw01> svn status ? fib M student solution.cpp , which means that the file fib is not been tracked by svn at the moment and that student solution.cpp has been modified. 3.6 SVN Revert Sometimes, it’s handy to be able to discard your changes. Since svn is a version control system, it actually stores all the older versions of code that you committed in the past. If you modify a file and want to discard the changes and not commit them, you can use the revert command to restore the file back to the most re- cently committed version: yourhome/cse341/wustlkey/hw01> svn status ? fib M student solution.cpp yourhome/cse341/wustlkey/hw01> svn revert student solution.cpp yourhome/cse341/wustlkey/hw01> svn status 4 ? fib 3.7 SVN Update At the beginning of the semester, your repository will contain only hw00. As the semester progresses, we will add new homework directories to your repository. In order to see the newly added directories, you will need to perform an svn update: yourhome/cse341/wustlkey> ls hw01 yourhome/cse341/wustlkey> svn update yourhome/cse341/wustlkey> ls hw01 hw02 yourhome/cse341> 3.8 SVN Help We encourage you to explore other functionalities supported by svn. To see what other commands are supported, use svn help. Moreover, you can see the help message for a specific command.
Details
-
File Typepdf
-
Upload Time-
-
Content LanguagesEnglish
-
Upload UserAnonymous/Not logged-in
-
File Pages7 Page
-
File Size-