Difference between revisions of "Tutorial for New Users"

From Einstein Toolkit Documentation
Jump to: navigation, search
m (updated tag to reflect latest stable releaase)
Line 7: Line 7:
 
==Prepare Tools==
 
==Prepare Tools==
  
On Queen Bee (qb.loni.org), the <tt>git</tt> client may not be in your path by default. To add this type:
+
On Queen Bee (qb.loni.org), the <tt>git</tt> and <tt>hg</tt> clients may not be in your path by default. To add them type:
  
 +
soft add +python-2.6.4-gcc-4.3.2
 
  soft add +git
 
  soft add +git
 +
export PATH=$PATH:/home/eschnett/mercurial-1.9.3/bin
  
Download [https://github.com/gridaphobe/CRL/raw/ET_2011_10/GetComponents GetComponents] to checkout all the components of the Einstein Toolkit, and ensure it is executable:
+
Download [https://github.com/gridaphobe/CRL/raw/ET-2011-10/GetComponents GetComponents] to checkout all the components of the Einstein Toolkit, and ensure it is executable:
  
 
  wget --no-check-certificate https://github.com/gridaphobe/CRL/raw/ET_2011_10/GetComponents  
 
  wget --no-check-certificate https://github.com/gridaphobe/CRL/raw/ET_2011_10/GetComponents  
Line 20: Line 22:
 
Checkout the Einstein Toolkit using anonymous authentication (this may take a few minutes):
 
Checkout the Einstein Toolkit using anonymous authentication (this may take a few minutes):
  
  ./GetComponents -a http://svn.einsteintoolkit.org/manifest/branches/ET_2011_10/einsteintoolkit.th
+
  ./GetComponents -a http://svn.einsteintoolkit.org/manifest/branches/ET_2011_10/einsteintoolkit.th
  
 
This checks out Cactus, the Einstein Toolkit thorns, the Simulation Factory and example parameter files into a directory named Cactus.
 
This checks out Cactus, the Einstein Toolkit thorns, the Simulation Factory and example parameter files into a directory named Cactus.
Line 26: Line 28:
 
===Configure the Simulation Factory===
 
===Configure the Simulation Factory===
  
 +
<!--mkdir below is a workaround until simfactory creates its own simulation
 +
directory (rhaas, 2011-10-25)-->
 +
mkdir scratch/simulations
 
  cd Cactus
 
  cd Cactus
  cp simfactory/udb.example.pm simfactory/udb.pm
+
  cp simfactory/etc/defs.local.ini.simple simfactory/etc/defs.local.ini
  vi simfactory/udb.pm
+
  nano simfactory/etc/defs.local.ini
  
Edit udb.pm and replace
+
Edit defs.local.ini and replace
 
<ul>
 
<ul>
 
<li>YOUR_LOGIN with your username on Queen Bee
 
<li>YOUR_LOGIN with your username on Queen Bee
<li>YOUR@EMAIL.ADDRESS with your usual email address  
+
<li>YOUR@EMAIL.ADDRESS with your usual email address
<li>YOUR_ALLOCATION with your project allocation on Queen Bee  
+
<li>YOUR_ALLOCATION with your project allocation on Queen Bee
 +
<li>YOUR_THORNLIST with <tt>manifest/einsteintoolkit.th</tt>
 
</ul>
 
</ul>
  
 
===Compile Executable===
 
===Compile Executable===
  
  ./simfactory/sim build --thornlist=manifest/einsteintoolkit.th
+
  ./simfactory/bin/sim build
  
 
This may take a few minutes. You may receive an error message that building the utilities
 
This may take a few minutes. You may receive an error message that building the utilities
Line 48: Line 54:
 
From the Cactus directory, create a batch queue script and submit it to queue an example simulation:
 
From the Cactus directory, create a batch queue script and submit it to queue an example simulation:
 
 
  ./simfactory/sim create-submit static_tov --parfile=par/static_tov.par --procs=32 --walltime=8:0:0
+
  ./simfactory/bin/sim submit static_tov --parfile=par/static_tov.par --procs=32 --walltime=8:0:0
  
 
This parameter file sets up a static TOV star (a model of a single neutron star) with a mass of 1.4 solar masses and integrates the combined relativistic fluid dynamics and spacetime evolution equations in time. The spacetime is evolved using the BSSN 3+1 formulation of Einstein's equations and the fluid is evolved using a high resolution shock capturing method.
 
This parameter file sets up a static TOV star (a model of a single neutron star) with a mass of 1.4 solar masses and integrates the combined relativistic fluid dynamics and spacetime evolution equations in time. The spacetime is evolved using the BSSN 3+1 formulation of Einstein's equations and the fluid is evolved using a high resolution shock capturing method.
Line 54: Line 60:
 
To check the status of the simulation, use
 
To check the status of the simulation, use
  
  ./simfactory/sim list-simulations
+
  ./simfactory/bin/sim list-simulations
  
 
==Look at Results==
 
==Look at Results==
Line 63: Line 69:
  
 
When the simulation is complete, move to the output directory. On Queen Bee
 
When the simulation is complete, move to the output directory. On Queen Bee
(qb.loni.org) the command will be (replace <user> with your own login name):
+
(qb.loni.org) the command will be:
  
  cd /scratch/<user>/simulations/static_tov/output-0000/static_tov
+
  cd ~/scratch/simulations/static_tov/output-0000/static_tov
  
 
You should see a number of files with the extenstion  ''.asc''. These are 0-D  
 
You should see a number of files with the extenstion  ''.asc''. These are 0-D  
Line 100: Line 106:
 
The first (ks-mclachlan.par) evolves a single isolated rotating black hole with the initial data (M=1 and a/M=0.8) specified in Kerr-Schild coordinates. The second (qc0-mclachlan.par) evolves a binary black hole system using the moving puncture technique. The black holes start at a close separation and only complete about one half of an orbit before merging. You can run these additional parameter files using a similar command in the Cactus directory as for the TOV star above:
 
The first (ks-mclachlan.par) evolves a single isolated rotating black hole with the initial data (M=1 and a/M=0.8) specified in Kerr-Schild coordinates. The second (qc0-mclachlan.par) evolves a binary black hole system using the moving puncture technique. The black holes start at a close separation and only complete about one half of an orbit before merging. You can run these additional parameter files using a similar command in the Cactus directory as for the TOV star above:
  
  ./simfactory/sim create-submit ks-mclachlan --parfile=par/ks-mclachlan.par --procs=32 --walltime=8:0:0
+
  ./simfactory/bin/sim submit ks-mclachlan --parfile=par/ks-mclachlan.par --procs=32 --walltime=8:0:0
  
 
and
 
and
  
  ./simfactory/sim create-submit qc0-mclachlan --parfile=par/qc0-mclachlan.par --procs=32 --walltime=8:0:0
+
  ./simfactory/bin/sim submit qc0-mclachlan --parfile=par/qc0-mclachlan.par --procs=32 --walltime=8:0:0
  
 
==Additional Simulation Factory Configuration==
 
==Additional Simulation Factory Configuration==
Line 111: Line 117:
 
You may also be interested though in configuring the Simulation Factory for your
 
You may also be interested though in configuring the Simulation Factory for your
 
own machine or other Teragrid machines. In this section we provide a quick
 
own machine or other Teragrid machines. In this section we provide a quick
example of what need to be changed or considered in simfactory/udb.pm
+
example of what needs to be changed or considered in simfactory/etc/defs.local.ini
 
in order to configure Simulation Factory for your needs. More specifically
 
in order to configure Simulation Factory for your needs. More specifically
 
we are going to work out an example for the TeraGrid machine Ranger.
 
we are going to work out an example for the TeraGrid machine Ranger.
  
The first step is to set your username for the machine. This means
+
Simfactory already knows about Ranger, so we only need to provide the settings specific to your account. To do this, you create a section for Ranger machine in defs.local.ini:
to modify simfactory/udb.pm customization section to reflect
 
'YOUR_LOGIN' on Ranger, for example:
 
  
    set_option 'ranger', 'user',          'YOUR_LOGIN'
+
[ranger]
 
+
user = YOUR_RANGER_USERNAME
You also need to provide your allocation. For example, if your allocation
+
  allocation = YOUR_RANGER_ALLOCATION
on Ranger is TG-PHY0123456N, just enter:
 
 
 
    set_option 'ranger', 'allocation', 'TG-PHY0123456N'
 
  
 
Each machine has different policies on which file system to use to build
 
Each machine has different policies on which file system to use to build
 
your application and run your simulation or how the file system tree
 
your application and run your simulation or how the file system tree
 
is organized. Simulation Factory keeps a database for several different
 
is organized. Simulation Factory keeps a database for several different
machines. You can peek at simfactory/mdb.pm to have an idea of the list
+
machines. You can peek at simfactory/mdb/machines to have an idea of the list
 
of machines and what the default configuration is for each of them.
 
of machines and what the default configuration is for each of them.
 
In particular for Ranger, the configuration for the source code path and
 
In particular for Ranger, the configuration for the source code path and
Line 135: Line 136:
 
'/scratch/00507/@USER@/simulations' respectively. You may need to
 
'/scratch/00507/@USER@/simulations' respectively. You may need to
 
change it to reflect the group number (00507 here) you belong to.
 
change it to reflect the group number (00507 here) you belong to.
For example you could just set:
+
For example you could set (in the [ranger] section):
  
    set_option 'ranger' , 'sourcebasedir', '/work/05555/@USER@';
+
  sourcebasedir = /work/05555/@USER@
    set_option 'ranger' , 'basedir', '/work/05555/@USER@/simulations';
+
  basedir = /work/05555/@USER@/simulations
  
 
if your group number is '05555'. With these basic changes to
 
if your group number is '05555'. With these basic changes to
simfactory/udb.pm, you are all set to configure and build the
+
simfactory/etc/defs.local.ini you are all set to configure and build the
 
Einstein Toolkit application on Ranger as well.
 
Einstein Toolkit application on Ranger as well.
  
===New machines===
+
==Going further==
 
 
Instead of using one of the existing configurations you might want to add
 
a configuration for a new machine. udb.example.pm contains an example for
 
such an entry: udb_generic. You can either copy this entry and configure it
 
as you like, or configure this directly. Below this entry is used to add a
 
new machine to the machine database like this:
 
 
 
    $mdb::machine_database{'redshift'} = $udb_generic;
 
 
 
where you can replace 'redshift' my your machine name.    Once this is done, you
 
can ('''must?''') set various options (nickname, hostname, user, basedir, etc.) for this new
 
machine as above.  The generic configuration is supported by a generic optionlist (see <tt> simfactory/optionlists/generic.cfg </tt>).  These examples require several settings unavailable in that default configuration.  You will need to customize an optionlist and set it, either in udb.pm as
 
    set_option 'redshift', 'optionlist',  'optionlistname.cfg'
 
or on the command-line; see the [https://svn.cct.lsu.edu/repos/numrel/simfactory/doc/simfactory.pdf simfactory documentation] for more details.
 
 
 
If the machine you added is a bigger resource (e.g. more than your personal
 
laptop or workstation), or can serve as example for some particular machine type,
 
we are happy to include its configuration in the main machine database.
 
 
 
If you are using Mac OS X, then [[ConfiguringMacOSX|here]] are instructions for setting it up for Cactus.
 
 
 
==Using simfactory to manage simulations==
 
 
 
<tt> simfactory </tt>  is a wrapper to download, compile, and run code on available machines.  See [[Simulation_Factory_Advanced_Tutorial]] for more details.
 
  
 +
===Adding a new machine to Simfactory===
  
''FAQ''
+
This and other topics are explained in the [[Simulation_Factory_Advanced_Tutorial]].
* ''What if my compile fails?'': This can occur for example if your config file is improperly set up.
 
  cd Cactus/simfactory
 
  make sim-delete
 
 
 
==Going further==
 
  
===Development version===
+
===Development version of the Einstein Toolkit===
  
 
Instead of using the release version listed above, you might want the latest development version.  Proceed as above, but download from the trunk:
 
Instead of using the release version listed above, you might want the latest development version.  Proceed as above, but download from the trunk:

Revision as of 09:05, 22 November 2011

This section provides a simple guide for compiling and running an example parameter file for the Einstein Toolkit.

One complexity of high performance computing is the heterogeneous environments presented by different resources with different core software installations and local setups. For example, Einstein Toolkit codes require compiling with MPI and then running the resulting application in a batch queue. This complexity is hidden as much as possible in Cactus and accompanying tools such as the Simulation Factory.

The example worked through below assumes that you are using the NSF TeraGrid resource Queen Bee. If you don't have an existing account on Queen Bee you can request an account to use for these examples.

Prepare Tools

On Queen Bee (qb.loni.org), the git and hg clients may not be in your path by default. To add them type:

soft add +python-2.6.4-gcc-4.3.2
soft add +git
export PATH=$PATH:/home/eschnett/mercurial-1.9.3/bin

Download GetComponents to checkout all the components of the Einstein Toolkit, and ensure it is executable:

wget --no-check-certificate https://github.com/gridaphobe/CRL/raw/ET_2011_10/GetComponents 
chmod 755 GetComponents

Download, Configure, and Build

Checkout the Einstein Toolkit using anonymous authentication (this may take a few minutes):

./GetComponents -a http://svn.einsteintoolkit.org/manifest/branches/ET_2011_10/einsteintoolkit.th

This checks out Cactus, the Einstein Toolkit thorns, the Simulation Factory and example parameter files into a directory named Cactus.

Configure the Simulation Factory

mkdir scratch/simulations
cd Cactus
cp simfactory/etc/defs.local.ini.simple simfactory/etc/defs.local.ini
nano simfactory/etc/defs.local.ini

Edit defs.local.ini and replace

  • YOUR_LOGIN with your username on Queen Bee
  • YOUR@EMAIL.ADDRESS with your usual email address
  • YOUR_ALLOCATION with your project allocation on Queen Bee
  • YOUR_THORNLIST with manifest/einsteintoolkit.th

Compile Executable

./simfactory/bin/sim build

This may take a few minutes. You may receive an error message that building the utilities failed. This is fine as long as the main executable has been built correctly. You can check this with the command ls exe; if this shows a file cactus_sim, then you are fine.)

Run a Simulation

From the Cactus directory, create a batch queue script and submit it to queue an example simulation:

./simfactory/bin/sim submit static_tov --parfile=par/static_tov.par --procs=32 --walltime=8:0:0

This parameter file sets up a static TOV star (a model of a single neutron star) with a mass of 1.4 solar masses and integrates the combined relativistic fluid dynamics and spacetime evolution equations in time. The spacetime is evolved using the BSSN 3+1 formulation of Einstein's equations and the fluid is evolved using a high resolution shock capturing method.

To check the status of the simulation, use

./simfactory/bin/sim list-simulations

Look at Results

For the following make sure that you have logged in to Queen Bee with X-forwarding enabled, i.e.

ssh -Y qb.loni.org

When the simulation is complete, move to the output directory. On Queen Bee (qb.loni.org) the command will be:

cd ~/scratch/simulations/static_tov/output-0000/static_tov

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:

p 'hydrobase::rho.maximum.asc' u 2:3 w lp

This plots the data in column 3 (rho) as a function of the data in column 2 (time).

rho of time.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

Lapse of time.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.

Additional Example Parameter Files

In addition to the TOV star parameter file, we also provide a couple of vacuum parameter files: ks-mclachlan.par and qc0-mclachlan.par. The first (ks-mclachlan.par) evolves a single isolated rotating black hole with the initial data (M=1 and a/M=0.8) specified in Kerr-Schild coordinates. The second (qc0-mclachlan.par) evolves a binary black hole system using the moving puncture technique. The black holes start at a close separation and only complete about one half of an orbit before merging. You can run these additional parameter files using a similar command in the Cactus directory as for the TOV star above:

./simfactory/bin/sim submit ks-mclachlan --parfile=par/ks-mclachlan.par --procs=32 --walltime=8:0:0

and

./simfactory/bin/sim submit qc0-mclachlan --parfile=par/qc0-mclachlan.par --procs=32 --walltime=8:0:0

Additional Simulation Factory Configuration

The example worked out above works out of the box for the Queen Bee machine. You may also be interested though in configuring the Simulation Factory for your own machine or other Teragrid machines. In this section we provide a quick example of what needs to be changed or considered in simfactory/etc/defs.local.ini in order to configure Simulation Factory for your needs. More specifically we are going to work out an example for the TeraGrid machine Ranger.

Simfactory already knows about Ranger, so we only need to provide the settings specific to your account. To do this, you create a section for Ranger machine in defs.local.ini:

[ranger]
user = YOUR_RANGER_USERNAME
allocation = YOUR_RANGER_ALLOCATION

Each machine has different policies on which file system to use to build your application and run your simulation or how the file system tree is organized. Simulation Factory keeps a database for several different machines. You can peek at simfactory/mdb/machines to have an idea of the list of machines and what the default configuration is for each of them. In particular for Ranger, the configuration for the source code path and the simulation path defaults to '/work/00507/@USER@' and '/scratch/00507/@USER@/simulations' respectively. You may need to change it to reflect the group number (00507 here) you belong to. For example you could set (in the [ranger] section):

sourcebasedir = /work/05555/@USER@
basedir = /work/05555/@USER@/simulations

if your group number is '05555'. With these basic changes to simfactory/etc/defs.local.ini you are all set to configure and build the Einstein Toolkit application on Ranger as well.

Going further

Adding a new machine to Simfactory

This and other topics are explained in the Simulation_Factory_Advanced_Tutorial.

Development version of the Einstein Toolkit

Instead of using the release version listed above, you might want the latest development version. Proceed as above, but download from the trunk:

 (GetComponents from trunk)
 ....  -a http://svn.einsteintoolkit.org/manifest/trunk/einsteintoolkit.th

More about Cactus

The EinsteinToolkit is built on top of Cactus. Development requires some familiarity with it. Start reading

Any Problems?

This example should work smoothly on the TeraGrid machines Queen Bee, Ranger, Kraken and Abe. If you have any problems, please send details to users@einsteintoolkit.org.