...
Make sure you have a version of git and python 2.7 installed and have a github account. Also install please pandoc from https://pandoc.org/installing.html (or via your operating system's package manager if such a one exists).
Download
First obtain a copy of the current Einstein Toolkit website and tool to transfer trac tickets to github:
Code Block | ||
---|---|---|
| ||
mkdir spin_exercise cd spin_exercise git clone git@bitbuckethttps://bitbucket.org:/einsteintoolkit/www.git einsteinwebsitegit clone |
mpute the array of energies and store the results in energy[index]
. Add code to WaveMoL_Energy
that
Exercise
...
website
|
which downloads a copy of the Einstein Toolkit's website.
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
Code Block language cpp
...
for (k=0; k<cctk_lsh[2]; k++)
{
for (j=0; j<cctk_lsh[1]; j++)
{
for (i=0; i<cctk_lsh[0]; i++)
{
index = CCTK_GFINDEX3D(cctkGH,i,j,k);
energy[index] = phit[index]*phit[index] +
phix[index]*phix[index] +
phiy[index]*phiy[index] +
phiz[index]*phiz[index];
}
}
}
git push --set-upstream origin gh-pages
Create a wiki for your github repo and clone the wiki repo to your laptop
Code Block language cpp git clone https://github.com/YOUR_USERNAME/et_spin2018.wiki.git
use pandoc to convert the ET wiki starting page https://docs.einsteintoolkit.org to github flavored markdown and commit and push it as a page
index.md
to the wiki repo. To do so, first copy and paste the (updated: 2018-06-27T13:17CDT) wiki (end updated: 2018-06-27T13:17CDT) source code of the wiki page into a fileindex.wiki
then run that file through pandoc.
Once done, please send me the URL of your repository on github using my rhaas@ncsa.illinois.edu email address.
Hint
pandoc can tell you what you need to do using its --help
option.
You can preview the ET website that you cloned, as well as your proposed one for gh-pages, by opening the file index.html
as a local file in your web-browser.
compute the array of energies and store the results in energy[index]
. Add code to WaveMoL_Energy
that
- computes the maximum value of
energy[index]
- writes this value as a function of time to a file
energy_maximum.xg
using the same format asphi_maximum.xg
. Time is accessible as the variablecctk_time
.
Please compile the code once more, run it and send me the modified source file as well as energy_maximum.xg
to me before the interview.
Code Block | ||
---|---|---|
| ||
./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:
...
language | bash |
---|
...
Solution
If you get stumped with the exercise, here's a worked out solutionwhat my repository looks like. Obviously you cannot send me this one before the interview .
...