We will use an [OpenMP](https://en.wikipedia.org/wiki/OpenMP) job as example, you can create a [openmp.cpp](https://gitlab.oca.eu/DSI/HPC/blob/master/SLURM/multithread/openmp.cpp) test program and compile it with:
```
$icpc -qopenmp ./openmp.cpp -o openmp
$
```
the '-qopenmp' option will tell the compiler to recognize the [OpenMP pragmas](https://en.wikipedia.org/wiki/OpenMP#Clauses).
This OpenMP example will automatically read the **OMP_NUM_THREADS** environment variable to detect the number of thread to use. Other multitread programs may have other ways to get that information.
### Slurm script
We will use the [multithread.slurm](https://gitlab.oca.eu/DSI/HPC/blob/master/SLURM/multithread/multithread.slurm) script to dispatch our job. Slurm option will be provided on the command line for flexibility, but would typically be specified in the script through the `#SBATCH <option>` directive