Simplified Tutorial for New Users
Here you will find a step by step guide to downloading, installing, and running the Einstein Toolkit. This tutorial is aimed at Cactus beginners that have never used Cactus before. As such it does not expect any familiarity with Cactus terms and is intended to work on a newly installed workstation or laptop. If you find something that does not work, please feel free to edit the wiki or mail email@example.com. For a more detailed tutorial, view the Tutorial for New Users.
You will need a number of packages installed in order to download the Einstein Toolkit components. On a Debian, Ubuntu, Linux-Mint, Fedora or Mac OSX-based system, install them as follows:
# Debian (stretch, buster) su -c 'apt-get install build-essential pkg-config libopenmpi-dev openmpi-bin gfortran git subversion curl gnuplot gnuplot-x11' # Ubuntu (16.04.2, 17.04, 17.10) sudo apt-get install build-essential pkg-config mpich2? python libmpich2?-dev gfortran git subversion curl gnuplot gnuplot-x11 # Fedora (FC 25, 27) su -c ' yum -y install mpich2 python pkg-config mpich2-devel gsl gsl-devel libjpeg-devel hdf5 hdf5-mpich-devel gcc gcc-c++ gcc-gfortran patch numactl-devel numactl hwloc subversion git openssl-devel lapack-static gnuplot' # Mac OS (High Sierra), MacPorts sudo port -N install pkgconfig gcc7 openmpi fftw-3 gsl jpeg zlib hdf5 +fortran +gfortran openssl # Mac OS (High Sierra), Homebrew brew install gnuplot pkg-config gcc fftw gsl hdf5 --with-fortran hwloc jpeg openssl pkg-config szip open-mpi
For Windows 10, please install the Ubuntu Linux subsystem, then follow the instructions for a Ubuntu system. These are Microsoft's official instructions on how to do so, these are less official but slightly easier to read instructions to do the same. You may also want to install an X11 server to provide graphical output.
# Windows 10: https://www.howtogeek.com/249966/how-to-install-and-use-the-linux-bash-shell-on-windows-10/ https://sourceforge.net/projects/vcxsrv/
Speed up installation by using native packages
Installing in addition packages for (these are Debian package names, so your mileage may vary)
libfftw3-dev libgsl-dev libatlas-base-dev libjpeg-dev libssl-dev libhdf5-serial-dev libhwloc-dev hwloc-nox liblorene-dev libpapi-dev libpfm4-dev
debian/jessie (obsolete as of June 2017):
libfftw3-dev libgsl0-dev libatlas-base-dev libjpeg-dev libssl-dev libhdf5-serial-dev libhwloc-dev hwloc-nox
can speed up the compilation, since Cactus will try and use the system provided versions rather than compile its own. Once you have downloaded the Einstein Toolkit, you can inspect the option list files in simfactory/mdb/optionlists/ which often contain a list of recommended packages at the top of the files.
Please make sure all required packages are correctly installed before proceeding with the next step.
A script called GetComponents is used to fetch the components of the Einstein Toolkit. GetComponents serves as convenient wrapper around lower level tools like git and svn to download the codes that make up the Einstein toolkit from their individual repositories. You may download and make it executable it as follows:
curl -O -L https://raw.githubusercontent.com/gridaphobe/CRL/ET_2018_09/GetComponents chmod u+x GetComponents
GetComponents accepts a thorn list as an argument. To check out the needed components:
which downloads the master thorn list from the Einstein toolkit server and proceeds to download all thorns. This thornlist checks out Cactus, the Einstein Toolkit, and Simulation Factory.
You may proceed to configure Simfactory which requires some changes for some OS.
# for Debian ./simfactory/bin/sim setup-silent --optionlist=debian.cfg --runscript debian.sh # for Ubuntu, Mint ./simfactory/bin/sim setup-silent --optionlist=ubuntu.cfg --runscript debian.sh # for Fedora (you may have to log out and back in if you have just intalled mpich to make the module command work) module load mpi ./simfactory/bin/sim setup-silent --optionlist=fedora.cfg --runscript debian.sh # OSX+MacPorts ./simfactory/bin/sim setup-silent --optionlist=osx-macports.cfg --runscript osx-macports.run # OSX+Homebrew ./simfactory/bin/sim setup-silent --optionlist=osx-homebrew.cfg --runscript generic-mpi.run
After this step is complete you will find your machine's default setup under ./repos/simfactory2/mdb/machines/<hostname >.ini
You can edit some of these settings freely, such as "description", "basedir" etc. Some entry edits could result in simulation start-up warnings and/or errors such as "ppn" (processor-per-node meaning number of cores per cpu), "num-threads" (number of threads per MPI rank) so such edits must be done with some care.
Now that you have configured Simfactory, you may build Cactus:
./simfactory/bin/sim build --mdbkey make 'make -j2' --thornlist=manifest/einsteintoolkit.th sim
which will compile Cactus into an executable
Adjust -j2 to match the number of cores your machine possesses if you want to use more or less than 2 parallel build processes. This may take a while, as it compiles all the thorns specified in manifest/einsteintoolkit.th.
The example files provided are mostly too large to run on a single machine. You can try however to run the static_tov example which is smallest and requires about 1.3GB of RAM to run and will run for about 24 hours using a single core. To speed up the run, you can try and reduce the resolution by increasing the parameters "CoordBase::dx", "CoordBase::dy", and "CoordBase::dz" from 8 to 12 which will reduce runtime to roughly 5 hours and memory consumption to 800MB.
# modify parameter file for smaller memory footprint using sed by changing CoordBase::dx from 8 to 12 sed '/CoordBase::d[xyz]/s/8/12/' <par/static_tov.par >par/static_tov_small.par # start simulation, watch log output ./simfactory/bin/sim submit static_tov --parfile=par/static_tov_small.par --num-threads=1 --procs=1 --walltime=8:0:0 ./simfactory/bin/sim show-output --follow static_tov
Cactus will use a sinlge MPI process and a single OpenMP thread.
Look at Results
When the simulation is complete (ie. when "All done" appears in the output), stop simfactory by pressing CTRL-C and move to the output directory. The command should be:
cd ~/simulations/static_tov/output-0000/static_tov_small ls
You should see a number of files with the extenstion .asc. These are 0-D (reductions of 3-D grid functions to scalar values) and 1-D ASCII output files that can be plotted with gnuplot.
In this case it's interesting to look at the maximum of the density (in the file hydrobase-rho.maximum.asc). Start gnuplot with the command:
and at the gnuplot prompt type:
plot 'hydrobase-rho.maximum.asc' using 2:3 with linespoints
This plots the data in column 3 (rho) as a function of the data in column 2 (time).
As can be seen from the plot, the maximum of the density oscillates with decreasing amplitude around the initial value with a small drift upwards. Even though the initial model is supposed to be in equilibrium, numerical errors means that the numerical model is not exactly in equilibrium and it starts to oscillate. The oscillation energy is slowly dissipated by shocks, decreasing the oscillation amplitude, while the star contracts in response, increasing the maximum density.
A consistent picture can be seen by plotting the minimum of the lapse:
p 'admbase-lapse.minimum.asc' u 2:3 w lp
The quantity shows the same features as the maximum of the density, except the drift is downwards. The downwards trend stems from the contraction of the star. As the star contracts, the curvature of spacetime increases slightly. In response, the singularity avoiding lapse condition used here decreases the lapse.
As the oscillations and subsequent drift of the density and the lapse are caused by numerical error, increasing the numerical resolution will decrease these effects.
The following resources provide more in-depth explanations of the tools and concepts used in this tutorial
- Cactus users guide containing detailed information on a thorn structure and the support routines offered by Cactus. Also available in the 'doc' folder of your Cactus checkout in the file 'doc/UsersGuide.pdf'
- Simfactory users guide which describes the available command for simfactory
- visualization the visualization lecture of the new user's tutorial held at the APS meeting in Atlanta 2012
- course page of the new user's tutorial held at the APS meeting in Atlanta 2012
- The Documentation section of the wiki