Advanced Compilation Options - galacticusorg/galacticus GitHub Wiki

Notes

If all you want to do is run Galacticus, you may not need to compile it at all - take a look at the instructions for using a pre-compiled binary.

Basic compilation instructions can be found here - the instructions below assume that you're familiar with the basics of how to compile Galacticus.

MPI Parallelism

...

Profiling

Profiling with gprof

...

Profiling the ODE Solver

...

Profiling compile times

...

Profiling OpenMP Critical Section Wait Times

...

Debugging Options

Thread Analyzing

Before running Galacticus inside a thread analyzer (such as DRD or Helgrind) you should:

  1. Configure GCC with with --disable-linux-futex option and recompile it - this is necessary since those thread analyzers don't correctly handle Linux futexes.

  2. Compile Galacticus with the -DTHREADSAFEIO option, which forces I/O operations to be compiled inside OpenMP critical sections - this is necessary because thread analyzers (rightly or wrongly) claim that gfortran I/O operations are not thread safe.

"functionClass" Object Management

...

Compiling for "Unclean Exit"

...

Selecting Components to Build

In Galacticus, the content of each node of a merger tree is represented by a collection of "components" (e.g. a galactic disk, a supermassive black hole, etc.). Normally, Galacticus is built with support for all defined components. However, this means that (even if you set some component to "null" at run time) there is some memory usage associated with the component in each node. For memory-heavy situations (such as running very high resolution merger trees) this extra memory can be a problem.

Therefore, it is possible to specify a list of "active" components at build time. Support for other, inactive, components is then not built, reducing the memory overhead at runtime. The list of active components is specified as a space-separated list of component names in the GALACTICUS_ACTIVE_COMPONENTS environment variable. For example:

export GALACTICUS_ACTIVE_COMPONENTS="basic darkMatterProfile satellite"

would cause Galacticus to be built with support for only the basic, darkMatterProfile, and satellite components.

Note that if any physical process attempts to access an unsupported component at run time, Galacticus will exit with an error message.