ORB5  v4.9.4
Get started

How to compile and run the code.

Author
N. Ohana
Date
11/2017

How to compile the code

TLDR:

~/orb5> make dependencies; make
Note
This procedure assumes that you are compiling on a supported site, i.e. there exists a file tools/make_configs/$(SITE).inc, where $(SITE) is defined in Makefile.inc. If it is not the case, please refer to Makefiles.

Required modules

The list of required modules should be specified in your specific tools/make_configs/$(SITE).inc header.

Compiling libraries

ORB5 uses futils and SPClibs libraries. They are included in the library directory and can be installed with the command:

~/orb5> make dependencies

The default install location is specified in tools/make_configs/$(SITE).inc and can be overridden with:

~/orb5> make dependencies FUTILS_HOME=<path> SPCLIBS_HOME=<path>

Compiling ORB5 binaries

The command to compile ORB5 using default options is simply:

~/orb5> make

If libraries are installed in a non-standard location, use:

~/orb5> make FUTILS_HOME=<path> SPCLIBS_HOME=<path>

Options can be tuned using for instance:

~/orb5> make DEBUG=TRUE
#define DEBUG
Definition: precomp.h:4

or:

~/orb5> make OPENMP=TRUE PROFILE=TRUE

Available options are:

  • DEBUG: Compile with debug flags
  • OPENMP: Compile with OpenMP flags
  • PROFILE: Compile with profiler flags

The resulting binary can be found in $BINDIR (bin/ by default):

~/orb5> ls bin
orb5
orb5_dbg
orb5_v2.0.0_dbg
orb5_v2.0.0_dbg
orb5_v2.0.0_dbg
orb5_v2.0.0_opt
orb5_v2.0.0_opt_omp
orb5_v2.0.0_opt_omp_prof
orb5_v1.5.1_opt

Each make creates/updates the binary with a name containing the current git version and the options used. This explicit binary is copied to a shorter named binary orb5 or orb5_dbg so that job scripts can use a specific binary or the last generated one.

Separate corresponding object directories are used so that you can switch between versions or options without recompiling from scratch.

The current object directory can be deleted using:

~/orb5> make clean
subroutine clean(index)
Definition: examples.F90:827

All object directories can be deleted using:

~/orb5> make cleanall
See also
Makefiles

How to run the code

Normal run

ORB5's executable takes as optional argument an input file name. If this file is not found (or if the argument is absent), the code will look for a file named input in the current location.

A typical command for running the code could be:

> srun --nodes=512 --ntasks-per-node=1 --cpus-per-task=12 --cpu_bind=threads --unbuffered bin/orb5 inputs/tests/light/cyclone.in > >(tee -a stdout) 2> >(tee -a stderr >&2)

where standard output and standard error are redirected to separate files.

Note
Binding options are platform-dependent.

Dry run

The program argument --dry-run allows to read an input file and stop after the input consistency checks.

The suboption --dry-run:ntasks=N allows to run with N virtual tasks to by-pass resource allocation.

For instance, you can run locally (without srun):

> bin/orb5 --dry-run:ntasks=512 inputs/tests/light/cyclone.in

Enabling OpenMP

If your binary has been built with OpenMP, you can specify the number of threads per MPI task at run time using the input parameter nthreads in the namelist /PARALLEL/.

Note
The default value for nthreads is given by the environment variable OMP_NUM_THREADS if set, and 1 otherwise.