Changes between Version 3 and Version 4 of Tutorials/CosmologyStepByStep

Show
Ignore:
Timestamp:
10/17/08 07:12:19 (5 years ago)
Author:
bwoshea
Comment:

--

Legend:

Unmodified
Added
Removed
Modified
  • Tutorials/CosmologyStepByStep

    v3 v4  
    3030== Compiling Enzo == 
    3131 
    32 Before we can run any tests, we need an executable. For detailed instructions on how to do this, head over to the page on BuildingEnzo. (If you do follow the detailed version, be sure you work your way through all the way to the bottom of the page, and build both {{{ring}}} and {{{inits}}}!) 
     32Before we can run any tests, we need an executable. For detailed instructions on how to do this, head over to the page on [UserGuide/BuildingEnzo building Enzo]. (If you do follow the detailed version, be sure you work your way through all the way to the bottom of the page, and build both {{{ring}}} and {{{inits}}}!) 
    3333 
    3434Here's the abbreviated version, which sets the output style to packed, builds the excutable, and drops it into a local bin directory. (The ellipsis ({{{...}}}) indicate additional output.) 
     
    121121== Running an Enzo Cosmology Simulation == 
    122122 
    123 After compiling, you should create a directory to run the simulation in.  This is because Enzo cosmology simulations create quite a few output files, so it's best to store them in their own directory.  For the purposes of this example I'm going to assume that you have created a directory called {{{EnzoTestSim}}} in your home directory.  You should then download these two files:  [source:public/trunk/doc/userguide/cookbook/Example_Cosmology_Sim.inits Example_Cosmology_Sim.inits] and  
    124 [source:public/trunk/doc/userguide/cookbook/Example_Cosmology_Sim.param? Example_Cosmology_Sim.param] which are the initial conditions parameter file and the simulation parameter file, respectively. 
    125  
    126 Let's make a directory, and pull the parameter files directly from the web site: 
    127  
    128 ''This exmample uses {{{wget}}}, an HTTP client. On DataStar, this is located at {{{/usr/local/apps/wget-1.8.1/bin/wget}}}. {{{wget}}} is included in most recent Linux distributions, and is available for OS X. Or you can download the [http://tinyurl.com/5h5btb inits parameters] and [http://tinyurl.com/6koky7 simulation parameters] from the website.'' 
    129  
    130 {{{ 
    131 #!sh 
    132 ds100 $ cd /gpfs/ux455215/Cookbook/ 
    133 ds100 $ mkdir ExampleCosmologySimulation 
    134 ds100 $ cd ExampleCosmologySimulation/ 
    135 ds100 $ wget -O Example_Cosmology_Sim.inits http://tinyurl.com/5h5btb 
    136 ds100 $ wget -O Example_Cosmology_Sim.param http://tinyurl.com/6koky7 
    137 ds100 $ ls 
    138 Example_Cosmology_Sim.inits Example_Cosmology_Sim.param 
    139 ds100 $  
    140 }}} 
     123After compiling, you should create a directory to run the simulation in.  This is because Enzo cosmology simulations create quite a few output files, so it's best to store them in their own directory.  For the purposes of this example I'm going to assume that you have created a directory called {{{EnzoTestSim}}} in your home directory.  You should then download a set of sample parameter files.  The example set used for this tutorial are [http://lca.ucsd.edu/software/enzo/data/cookbook/ available here].  Download the files called {{{Example_Cosmology_Sim.inits}}} and {{{Example_Cosmology_Sim.param}}}, which are the inits and enzo parameter files, respectively.  This tutorial assumes that you have downloaded these two files and put them on whatever computer you are using to perform your simulation. 
    141124 
    142125=== Creating Initial Conditions === 
    143126 
    144 The first step in preparing the simulation is to create the initial conditions.  The file [Example_Cosmology_Sim.inits Example_Cosmology_Sim.inits] is a text file which contains a list of parameter file names with their associated values.  These values tell the initial conditions generator useful information like the simulation box size, the cosmological parameters and the size of the root grid. The code then takes that information and creates a set of initial conditions.  {{inits}}} is run by typing this command: 
     127The first step in preparing the simulation is to create the initial conditions.  The file {{{Example_Cosmology_Sim.inits}}} is a text file that contains a list of parameter file names with their associated values.  These values tell the initial conditions generator useful information like the simulation box size, the cosmological parameters and the size of the root grid. The code then takes that information and creates a set of initial conditions.  {{inits}}} is run by typing this command: 
    145128 
    146129{{{ 
     
    160143}}} 
    161144 
    162 {{{inits}}} will produce some output to the screen to tell you what it is doing, and will write five files:  {{{GridDensity}}}, {{{GridVelocities}}}, {{{ParticlePositions}}}, {{{ParticleVelocities}}} and {{{PowerSpectrum.out}}}.  The first four files contain information on initial conditions for the baryon and dark matter componenets of the simulation, and are HDF 5 files. The last file is an ascii file which contains information on the power spectrum used to generate the initial conditions. 
     145{{{inits}}} will produce some output to the screen to tell you what it is doing, and will write five files:  {{{GridDensity}}}, {{{GridVelocities}}}, {{{ParticlePositions}}}, {{{ParticleVelocities}}} and {{{PowerSpectrum.out}}}.  The first four files contain information on initial conditions for the baryon and dark matter componenets of the simulation, and are HDF 5 files (formatted binary files). The last file is an ASCII file that contains information on the power spectrum used to generate the initial conditions. 
    163146 
    164147=== Parallel IO Using Ring === 
    165148 
    166 This simulation is quite small.  The root grid is only 32 cells on a side and we allow a maximum of three levels of mesh refinement.  Still, we will use the {{{ring}}} tool, since it is important for larger simulations of sizes typically used for doing science. 
    167  
    168 The {{{ring}}} tool is part of the Enzo parallel IO (input-output) scheme.  Examine the last section of the [Example_Cosmology_Sim.param parameter file] for this example simulation and you will see: 
     149This example simulation is very small (32^3^ root grid) so it is probably not worth using parallel IO. It is definitely important for larger simulations, though, so we show how to do it here. 
     150To turn the parallel IO on, these parameters are added into the Enzo parameter file: 
    169151 
    170152{{{ 
     
    202184For the purpose of this example, I'm going to run ring in parallel, using four MPI tasks. You run ring on the particle files by typing: 
    203185 
    204  
    205186{{{ 
    206187#!sh 
     
    243224{{{ 
    244225#!sh 
    245 ds100 $ poe hpmcount -o ExampleSimPerf /gpfs/ux455215/Cookbook/enzo/bin/enzo -d \ 
     226ds100 $ poe /gpfs/ux455215/Cookbook/enzo/bin/enzo -d \ 
    246227    Example_Cosmology_Sim.param -nodes 1 -tasks_per_node 4 > ExampleSim.log & 
    247228}}} 
    248229 
    249 The simulation will now run.  The {{{-d}}} flag ensures a great deal of output, so we redirect it into a log file called {{{output.log}}} for later examination.  This particular simulation used to take approximately ten minutes to run on 4 processors on Titan. I have no idea how long it's going to take on my laptop. When the simulation is done, enzo will display the message {{{"Successful run, exiting."}}} 
    250  
    251 Enzo is a complicated code, with a similarly complicated output format.  See the Enzo User Guide page on  [wiki:UserGuide/FileFormatSchema the Enzo output format] for more information on the data outputs. 
     230The simulation will now run.  The {{{-d}}} flag ensures a great deal of output, so we redirect it into a log file called {{{output.log}}} for later examination.  This particular simulation used to take approximately two minutes to run on 4 processors on Abe (the NCSA Linux cluster as of fall 2008).  When the simulation is done, Enzo will display the message {{{"Successful run, exiting."}}} 
     231 
     232Enzo is a complicated code, with a similarly complicated output format.  See the Enzo User Guide page on  [wiki:UserGuide/EnzoOutputFormat the Enzo output format] for more information on the data outputs. 
    252233 
    253234Congratulations!  If you've made it this far, you have now successfully run a simulation using Enzo!