Getting Started with Tolosa-lib
Download
Section titled “Download”The library alone
Section titled “The library alone”cd 'working directory'git clone https://github.com/TolosaProject/Tolosa-lib.gitcd Tolosa-libA dependant Tolosa package
Section titled “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-sw.gitcd Tolosa-swThe --recursive option enables one to download the Tolosa package with the library it depends on, Tolosa-lib.
Compile
Section titled “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. […]
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 :
make C=gnu- Parallel :
make MPI=yes extlibmake C=gnu MPI=yesCompile a library case example
Section titled “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 extlibmake C=gnu MPI=yes DSRC=examplesAfter 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 runIf 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 ./exeClean generated files
Section titled “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
Section titled “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 extlibmake C=gnu MPI=yes NP=4 cleanmakeandrunmake MPI=yes extlibmake C=gnu MPI=yes NP=4 DSRC=examples CASE=sw cleanmakeandrun