Skip to content

Getting Started with Tolosa-lib

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

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 :

Terminal window
cd 'working directory'
git clone --recursive https://github.com/TolosaProject/Tolosa-sw.git
cd Tolosa-sw

The --recursive option enables one to download the Tolosa package with the library it depends on, Tolosa-lib.

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. […]

Compile the library or a dependant Tolosa package

Section titled “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 :
Terminal window
make C=gnu
  • Parallel :
Terminal window
make MPI=yes extlib
make C=gnu MPI=yes

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

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

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 :
Terminal window
make run
  • In parallel (4 proc.):
Terminal window
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
DeleteCommand
All compilation filesmake clean
Tolosa librarymake cleanlib
External librariesmake cleanextlib
Simulation generated filesmake cleanres
Mesh filesmake cleanmsh
Compilation, Tolosa library, mesh, and simulation generated filesmake cleanall
All generated filesmake 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.

To compile and run : makeandrun or mrun.

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

Examples:

Terminal window
make MPI=yes extlib
make C=gnu MPI=yes NP=4 cleanmakeandrun
Terminal window
make MPI=yes extlib
make C=gnu MPI=yes NP=4 DSRC=examples CASE=sw cleanmakeandrun