Difference between revisions of "Simplified Tutorial for New Users"

From Einstein Toolkit Documentation
Jump to: navigation, search
(add science tap to brew instructions)
 
(46 intermediate revisions by 9 users not shown)
Line 1: Line 1:
Here you will find a step by step guide to downloading, installing, and running the Einstein Toolkit. For a more detailed tutorial, view the [[Tutorial for New Users]].
+
Please see https://github.com/nds-org/jupyter-et/blob/master/CactusTutorial.ipynb for build instructions on Linux, OSX and Windows.
 
 
==Prerequisites==
 
 
 
You will need a number of packages installed in order to download the Einstein Toolkit components, and if you follow the instructions in this tutorial. On a Debian, Ubuntu, Linux-Mint or Fedora-based system, install them as follows:
 
 
 
# Debian (wheezy, jessie)
 
su -c 'apt-get install build-essential libopenmpi-dev openmpi-bin gfortran git subversion curl gnuplot gnuplot-x11'
 
# Ubuntu (14.04, 15.04), Linux Mint 13
 
sudo apt-get install build-essential mpich2 libmpich2?-dev gfortran git subversion curl gnuplot gnuplot-x11
 
# Fedora (FC 20, 21)
 
su -c ' yum -y install mpich2 mpich2-devel gsl gsl-devel libjpeg-devel hdf5 hdf5-devel gcc gcc-c++ gcc-gfortran patch numactl-devel numactl hwloc subversion git openssl-devel lapack-static'
 
# OSX+MacPorts (Yosemite)
 
sudo port install subversion git gnuplot szip jpeg gcc46 fftw fftw-3 gsl openssl hdf5 +fortran +gcc46 -universal zlib openmpi +gcc46
 
# OSX+Homebrew (Yosemite)
 
brew tap homebrew/science
 
brew install subversion git gnuplot fftw gcc gsl hdf5 --enable-fortran jpeg openssl szip open-mpi
 
 
 
Installing in addition packages for
 
  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.
 
 
 
==Downloading==
 
 
 
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_2015_11/GetComponents
 
chmod a+x GetComponents
 
 
 
GetComponents accepts a thorn list as an argument. To check out the needed components:
 
 
 
./GetComponents --parallel https://bitbucket.org/einsteintoolkit/manifest/raw/ET_2015_11/einsteintoolkit.th
 
 
 
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.
 
 
 
==Configuring==
 
 
 
You may proceed to configure Simfactory which requires some changes for some OS.
 
 
 
cd Cactus
 
 
 
# for Debian
 
./simfactory/bin/sim setup --optionlist=debian.cfg --runscript debian.sh
 
# for Ubuntu, Mint
 
./simfactory/bin/sim setup --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 --optionlist=fedora.cfg --runscript debian.sh
 
 
 
# OSX+MacPorts (last tested with Yosemite)
 
./simfactory/bin/sim setup --optionlist=osx-macports.cfg --runscript osx-macports.run
 
# OSX+Homebrew (last tested with Yosemite)
 
export CPATH=/usr/local/include LIBRARY_PATH=/usr/local/lib
 
./simfactory/bin/sim setup --optionlist=osx-homebrew.cfg --runscript generic-mpi.run
 
 
 
Accept the default values for all options.
 
 
 
==Building==
 
 
 
Now that you have configured Simfactory, you may build:
 
 
 
./simfactory/bin/sim build --mdbkey make 'make -j2' --thornlist=manifest/einsteintoolkit.th
 
 
 
Adjust <nowiki>-j2</nowiki> 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.
 
 
 
==Running==
 
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
 
  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 --procs=1 --walltime=8:0:0
 
  ./simfactory/bin/sim show-output --follow static_tov
 
 
 
Cactus will use a sinlge MPI process and (unless you have set OMP_NUM_THREADS) will use as many OpenMP threads as you have cores on your computer. Under Linux use can use <code>top -H</code> to show all running threads.
 
 
 
==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
 
 
 
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:
 
 
 
gnuplot
 
 
 
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).
 
 
 
[[Image:Rho_of_time_lowres.png]]
 
 
 
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
 
 
 
[[Image:Lapse_of_time_lowres.png]]
 
 
 
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.
 
 
 
==Further reading==
 
The following resources provide more in-depth explanations of the tools and concepts used in this tutorial
 
* [http://einsteintoolkit.org/documentation/UsersGuide/UsersGuide.html 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'
 
* [http://simfactory.org/info/documentation/ Simfactory users guide] which describes the available command for simfactory
 
* [https://svn.einsteintoolkit.org/documents/Workshop_Spring_2012/handson_viz/handson_viz.pdf visualization] the visualization lecture of the new user's tutorial held at the APS meeting in Atlanta 2012
 
* [[ET_Workshop_Spring_2012|course page]] of the new user's tutorial held at the APS meeting in Atlanta 2012
 

Latest revision as of 15:12, 24 July 2020

Please see https://github.com/nds-org/jupyter-et/blob/master/CactusTutorial.ipynb for build instructions on Linux, OSX and Windows.