Skip to content

Flatiron Quickstart

wadsley edited this page Jun 27, 2022 · 18 revisions

This is a Quick Start guide to support the Gasoline/ChaNGa tutoral on June 22, 2022 at the NBSE workshop at the Flatiron Institute. It assumes that you are running on the VM supplied and documented by Phil Chang.

Obtaining and Building Charm++

ChaNGa is built on the Charm++ parallel library and runtime system. Version 7.0.0 is assumed for this workshop. It can be downloaded directly from the Charm group's source archive using the Git version control system.

Check out the latest development version of Charm++ from the repository:

    $ git clone https://github.com/UIUC-PPL/charm

This will create a directory named charm. Move to this directory:

$ cd charm

To obtain the current stable release, 7.0.0, checkout the v7.0.0 tag:

$ git checkout v7.0.0

And now build Charm with the netlrts-linux machine layer:

$ ./build ChaNGa netlrts-linux-x86_64 --with-production

Note: the ''ChaNGa'' argument in the above build script is an instruction to build all the charm++ libraries on which ChaNGa depends. ChaNGa itself is built in the next step. C++ is compute intensive to compile; appending a ''-jN'' where N is the number of cores on your system can significantly speed up the build process by compiling in parallel.

Obtaining and Building ChaNGa

ChaNGa itself can also be downloaded from the N-Body Shop source archive using ''git''. ChaNGa depends on a utility module which also needs to be downloaded.

git clone https://github.com/N-BodyShop/changa.git
git clone https://github.com/N-BodyShop/utility.git

This will create a directories named changa and utility. Move to the changa directory:

$ cd changa

Now configure ChaNGa for the science you are simulating, for the AGORA disk, we will choose GASOLINE2 SPH (hydrodynamics): Geometric Density Force, Diffusion, dt Adjusting and the Wendland kernel, the metal cooling module and superbubble feedback (note that Geometric Densisty Forces, Diffusion, and dt Adjusting are enabled by default, you do not need to use --enable-diffusion --enable-dtadjust --enable-gdforce )

./configure --enable-cooling=metal --enable-superbubble --enable-wendland 

A summary of the compile flags will be displayed when configure is finished. Look out for ''WARNING''s which usually indicate a mis-typed option. Now compile:

make

Again, a ''-j'' option will rung the compile in parallel. The result will be two executables: ''charmrun'' and ''ChaNGa''. ''charmrun'' is a helper program to start all parallel instances of ''ChaNGa'' and start them communicating with each other.

Basic Tests

The changa source directory contains a number of basic tests. These include a Sod shock tube, ''testshock'', a King model, ''teststep'', an Evrard collapse, ''testcollapse'' and a low resolution cosmological volume, ''testcosmo''.

As an example, run the ''teststep'' King model by changing directories.

cd teststep

and running changa in parallel, in this example on 4 processors.

../charmrun +p 4 ++local ../ChaNGa test_pg.param

The ''++local'' flag tells charmrun to run all 4 processes on the local machine. Otherwise it will attempt to ssh to machines, including the localhost, to start the parallel processes.

Basic Visualization: Building Tipsy

Tipsy is a program that can be used to quickly visualize ChaNGa/Gasoline output. To build it, additional development libraries are needed. Install them with the following:

sudo apt-get install libx11-dev
sudo apt-get install libxt-dev
sudo apt-get install libxaw7-dev
sudo apt-get install libncurses5-dev

Obtain Tipsy using ''git'':

git clone https://github.com/N-BodyShop/tipsy.git

Move to the tipsy code directory:

cd tipsy/code

Configure and make:

./configure; make

This will build an executable ''tipsy''. Move this executable to where you can easily find it. To quickly visualize the ''teststep'' I.C.s:

$ tipsy
openb king_soft.bin 
loads 0
zall

Use the left mouse button to zoom in and the center mouse button to zoom out.