[Spack](https://github.com/spack/spack) is a package management tool designed for HPC, allowing to easily build optimized software in multiple versions and configurations. Many packages are supported (see the [package list](https://spack.readthedocs.io/en/latest/package_list.html)), among them the fenicsx/dolfinx package [py-fenics-dolfinx](https://spack.readthedocs.io/en/latest/package_list.html#py-fenics-dolfinx).
...
...
@@ -64,39 +66,58 @@ Let Spack detect all additional system modules:
spack external find
```
To install newly released package versions, Spack has to be updated with a `git pull` in the Spack repository.
## dolfinx installation
### Environment setup
Create a new Spack environment, for instance with the name `fenicsx` and activate it:
This will select the latest development versions of the FEniCS ecosystem, corresponding to the `main` branches. To install the latest stable release (at the time of writing `v0.6.0`, see the list of tags [here](https://spack.readthedocs.io/en/latest/package_list.html#py-fenics-dolfinx)), use
This will select the latest stable release (at the time of writing `v0.6.0`, see the list of tags [here](https://spack.readthedocs.io/en/latest/package_list.html#py-fenics-dolfinx)). To install the development version, use `py-fenics-dolfinx@main`.
Our codes require the development version.
The -O3 compiler flags optionally apply level 3 optimization (https://github.com/FEniCS/dolfinx#spack).
The `arch` setting specifies the [microarchitecture](https://spack.readthedocs.io/en/latest/basic_usage.html#support-for-specific-microarchitectures) to determine the optimal compiler flags.
Usually Spack will detect the correct settings automatically, if not compiling for a different machine.
Because the login node and the compute nodes use different processors, in the command above we enforce the target archictecture for the compute nodes (`zen3`). (Confirm with `srun -n 1 spack arch`.)
Because the login node and the compute nodes use different processors, in the command above we enforce the target architecture for the compute nodes (`zen3`). (Confirm with `srun -n 1 spack arch`.)
This setting may not be necessary if we compile the packages on a compute node instead of the login node (strongly recommended).
**NOTE** (31-05-2023): To install `dolfinx@main` with ADIOS2 support for visualization, the following works:
**NOTE**: Optional dependencies
To install dolfinx with ADIOS2 support for visualization, the optional `adios2` dependency must be activated in the `fenics-dolfinx` package (a dependency of `py-fenics-dolfinx`).
dolfinx should now be installed. Check the logs if openmpi and openblas were correctly picked up from the system instead of compiling them from source.
and run the job with
```sh
sbatch job.sh
```
dolfinx should now be installed. Check the logs if OpenMPI and OpenBLAS were correctly picked up from the system instead of compiling them from source.