Prerequisites
Make sure you have a version of git and python 2.7 installed and have a github account
Download
First obtain a copy of the current Einstein Toolkit website and tool to transfer trac tickets to github:
mkdir spin_exercise cd spin_exercise virtualenv -p python2.7 $PWD source bin/activate pip install PyGithub git clone https://bitbucket.org/einsteintoolkit/www.git website git clone https://github.com/behrisch/migrate-trac-issues-to-github.git
which downloads a copy of the Einstein Toolkit's website as well as tools to transfer ticktets from trac to github. I have put everything into a python virtualenv to avoid adding extra software outside of the spin_exercise directory.
Exercise
The exercise is to re-create the front-page of the Einstein Toolkit website as a github pages page in a repository of your own on github and to transfer some tickets from trac to github's issue system.
- First create a new github repository
et_spin2018
in your account, - clone it to your laptop and
- copy and commit the files required to render the Einstein Toolkit front page http://www.einsteintoolkit.org into a branch gh-pages.
Push your gh-pages branch to github using
git push --set-upstream origin gh-pages
modify the foo loop in
migrate-trac-issues-to-github/migrate.py
in line 276 by adding a break so that only one ticket is processed (instead of all of them)run the migration script with your new repository as the target
migrate-trac-issues-to-github/migrate.py --trac-url=https://trac.einsteintoolkit.org --github-api-url=https://github.com/api/v3 --github-project=YOURGITHUBUSERNAME/et_spin2018
./simfactory/bin/sim build --mdbkey make 'make -j2'
exe/cactus_sim arrangements/CactusExamples/WaveMoL/par/gaussian.par
Hint
You can access the value of phi
as phi[index]
and check that your code produces the same results as found in phi_maximum.xg
.
If you prefer to use C++ instead of plain C you can rename the file WaveMoL.c
to WaveMoL.cc
, update the file arrangements/CactusExamples/WaveMoL/src/make.code.defn
to list WaveMoL.cc
and recompile.
This fragment outputs time:
printf("Current time: %g\n", cctk_time);
Solution
If you get stumped with the exercise, here's a worked out solution. Obviously you cannot send me this one before the interview .