Note: Coursera homework is not submitted or graded.
The goals of this homework are to:
- Make sure you are familiar with basic Unix commands (see Unix, Linux, and OS X) and an editor, (see Text editors),
- Start using git (Git) to download course materials,
- Create your own bitbucket repository to keep your coursework
- Make sure you have some necessary software installed.
Before tackling this homework, you should read some of the class notes and links they point to. In particular, the following sections are relevant:
For UW students, a primary goal of this homework is to create a bitbucket repository to add files to that can be graded by the course instructors.
Homework done by Coursera students will not be viewed or graded but you may still want to follow these instructions to get yourself set up. Parts not relevant have been deleted from the assignment.
See also the Bitbucket 101 instructions that for more tips on setting up bitbucket accounts and using git.
Make sure you have access to git on the computer you plan to use (see Downloading and installing software for this class). Read the section Git and the documentation linked from there in order to get a sense of how it works.
Clone the class repository following the Instructions for cloning the class repository.
Make sure you have set the environment variable UWHPSC since this is used below.
Set up your own personal repository on Bitbucket, by carefully following all of the instructions at Creating your own Bitbucket repository. By following these instructions you will also create a clone of the repository and add some files to it.
Make sure you have set the environment variable MYHPSC since this is used below.
In the clone of your repository, create a subdirectory homework1:
$ cd $MYHPSC $ mkdir homework1You should now be able to cd into this directory:
$ cd homework1or later you can get there from anywhere via:
$ cd $MYHPSC/homework1Copy some files from the class repository to your own repository by:
$ cp $UWHPSC/codes/homework1/* $MYHPSC/homework1
- This should create the files
- test1.py
- test2.sh
- test3.f90
in the directory $MYHPSC/homework1.
Use git add and git commit to add these three files and commit a snapshot.
Modify test1.py as instructed in the docstring at the top of the file. Try running it via:
$ python test1.pyIt should give results like the following:
Code run by Your Name Environment variable UWHPSC is /somepath/uwhpsc Environment variable MYHPSC is /somepath/myhpsc Imported numpy ok Imported matplotlib ok Imported pylab okFollowing the instructions, you will add and commit to files, a modified version of test1.py and the output file test1output.txt.
Modify test2.sh as instructed in the comments at the top of the file.
Run this bash shell script via:
$ bash test2.shThis should give output something like the following:
Environment variable UWHPSC is /somepath/uwhpsc Environment variable MYHPSC is /somepath/myhpsc which ipython returns... /somepath/ipython which gfortran returns... /usr/local/bin/gfortran gfortran --version returns... GNU Fortran (Ubuntu/Linaro 4.6.3-1ubuntu5) 4.6.3 [more stuff] Compiling and running a Fortran code... Code run by Your Name Successfully ran Fortran 90 programNow run it again and redirect the output to a file:
$ bash test2.sh > test2output.txtAdd and commit the modified test2.sh and the output files to your repository.
Note: At the end you should have the following files committed to your repository:
- $MYHPSC/testfile.txt (created when following Creating your own Bitbucket repository)
- $MYHPSC/homework1/test1.py
- $MYHPSC/homework1/test1output.txt
- $MYHPSC/homework1/test2.sh
- $MYHPSC/homework1/test2output.txt
- $MYHPSC/homework1/test3.f90
Do not check in the file a.out, which was created when the Fortran code was compiled.
Push them to bitbucket via:
$ git pushThese files should then also be visible from your bitbucket webpage, by clicking on the “Source” tab, see Bitbucket repositories: viewing changesets, issue tracking.