Skip to content

Getting started

Download

The library alone

cd 'working directory'
git clone https://github.com/TolosaProject/Tolosa-lib.git
cd Tolosa-lib

A dependant Tolosa package

As mentionned in the introduction, Tolosa-lib encapsulates the main features of any Tolosa-XXXX package. Therefore, the package is fully dependant on the library, and needs to be downloaded by writting :

cd 'working directory'
git clone --recursive https://github.com/TolosaProject/Tolosa-lib.git
cd Tolosa-lib
The --recursive option enables one to download the Tolosa package with the library it is dependant to, Tolosa-lib.

Compile

As mentionned in the introduction, Tolosa-lib encapsulates the main features of Tolosa, but cannot be run by itself. Therefore, one needs to compile and run Tolosa-lib with a case example or another Tolosa package resolving a specific set of equations (Tolosa-sw, Tolosa-lct, etc.).

To be able to run Tolosa, one need to compile. In fact, the compilation uses some flags to optimize the computation speed depending on the characteristics of the machine. [...]

Warning

Compiling is different depending on whether one chooses to run Tolosa sequentially or in parallel. One should make sure to clean compilation files (see Clean generated files) and recompile if switching to parallel or sequential mode.

Compile the library or a dependant Tolosa package

To compile the library only, or a Tolosa package dependant on the library, one needs to write the following command(s) in a terminal.

  • Sequential :
make C=gnu
  • Parallel :
make MPI=yes extlib
make C=gnu MPI=yes

Compile a library case example

To compile a case example (here a shallow water case example), one need to write the following command(s) in a terminal.

  • Sequential :
make C=gnu DSRC=examples CASE=sw
  • Parallel :
make MPI=yes extlib
make C=gnu MPI=yes DSRC=examples

Info

make help can be used to see all basic compilation options.

Run

After establishing one's working directory and compiling the code, one can run his case. If one is working in the Tolosa package directory (the code executable is in a bin subdirectory), the commands to run Tolosa are the following :

  • In serial :
make run
  • In parallel (4 proc.):
make MPI=yes NP=4 run

If the working directory is elsewhere, copy the executable file bin/exe in the working directory. Commands to run in this directory are the following :

  • In serial :
./exe
  • In parallel (4 proc.):
mpirun -np 4 ./exe

Clean generated files

Delete Command
All compilation files make clean
Tolosa library make cleanlib
External libraries make cleanextlib
Simulation generated files make cleanres
Mesh files make cleanmsh
Compilation, Tolosa library, mesh, and simulation generated files make cleanall
All generated files make superclean

N.B.: The commands to clean generated files, mesh files, simulation files, etc. will only allow to delete those files if the working directory is bin.

Shortcuts to clean, compile and run

To compile and run : makeandrun or mrun.

To clean compilation, mesh and simulation generated files, compile and run : cleanmakeandrun or cmrun.

Examples:

make MPI=yes extlib
make C=gnu MPI=yes NP=4 cleanmakeandrun
make MPI=yes extlib
make C=gnu MPI=yes NP=4 DSRC=examples CASE=sw cleanmakeandrun
Back to top