LLNL/benchpark

spack concretize gets confused by one meta package providing two (or more) packages

Closed this issue · 3 comments

fujitsu-ssl2 includes many features, among them blas, lapack, and fft functions

fujitsu-ssl2:
externals:
- spec: "fujitsu-ssl2@4.8.1%fj@4.8.1 arch=linux-rhel8-a64fx"

hence, i specified it to provide all of them

blas:
spack_spec: fujitsu-ssl2@{default_fj_version} arch=linux-rhel8-a64fx
lapack:
spack_spec: fujitsu-ssl2@{default_fj_version} arch=linux-rhel8-a64fx
fftw:
spack_spec: fujitsu-ssl2@{default_fj_version} arch=linux-rhel8-a64fx

gromacs needs lapack and fft:

gromacs:
packages:
- lapack
- default-mpi
- fftw

this situaltion cases benchpark (or ramble) to create the following

spack:
  concretizer:
    unify: true
  specs:
  - fujitsu-ssl2@4.8.1 arch=linux-rhel8-a64fx
  - fujitsu-mpi@4.8.1%gcc@12.2.0 arch=linux-rhel8-a64fx
  - fujitsu-ssl2@4.8.1 arch=linux-rhel8-a64fx %gcc@12.2.0
  - gromacs@main +mpi+openmp~hwloc %gcc@12.2.0
  include:
  - /vol0005/mdt3/data/ra000020/u10016/benchpark.gnu/test.gnu/gromacs/openmp/RCCS-Fugaku-Fujitsu-A64FX-TofuD/workspace/software/gromacs.water_gmx50_adac/compilers.yaml
  - /vol0005/mdt3/data/ra000020/u10016/benchpark.gnu/test.gnu/gromacs/openmp/RCCS-Fugaku-Fujitsu-A64FX-TofuD/workspace/software/gromacs.water_gmx50_adac/packages.yaml

as you can see, fujitsu-ssl2 is listed twice, and oddly enough, it is listed 1x without compiler and 1x with compiler which then leads to the following error with spack's concretize command

==> Concretizing Spack environment
==> 
==> *******************************************
==> ********** Running Spack Command **********
==> **     command: /vol0005/mdt3/data/ra000020/u10016/benchpark.gnu/test.gnu/spack/bin/spack concretize
==> **     with args: ['-U', '-f']
==> *******************************************
==> 
==> Error: concretization failed for the following reasons:

   1. cannot satisfy a requirement for package 'fujitsu-ssl2'.. You could consider setting `concretizer:unify` to `when_possible` or `false` to allow multiple versions of some packages.
==> Error: Command exited with status 1:
    '/vol0005/mdt3/data/ra000020/u10016/benchpark.gnu/test.gnu/spack/bin/spack' 'concretize' '-U' '-f'

i'm not sure which tool is incorrect in this case, but i'm sure someone with deeper benchpark and spack knowledge with figure it out. for now i uncomment the fft support for ssl2 as local workaround

fftw:
spack_spec: fujitsu-ssl2@{default_fj_version} arch=linux-rhel8-a64fx

fujitsu-ssl2 includes many features, among them blas, lapack, and fft functions
hence, i specified it to provide all of them

Note this cannot be enforced with benchpark/configs/RCCS-Fugaku-Fujitsu-A64FX-TofuD/spack.yaml: the only way Spack will think that fujitsu-ssl2 provides fftw is to put provides("fftw") in the package.py for fujitsu-ssl2 (from looking at the package.py for fujitsu-ssl2, I see this is already true for blas/lapack). Once you do, this error should be resolved.

Generally it would be good to submit this as a PR to the Spack repository (and when Benchpark starts using the merged branch from Spack, it will automatically be resolved in Benchpark also).

Generally it would be good to submit this as a PR to the Spack repository (and when Benchpark starts using the merged branch from Spack, it will automatically be resolved in Benchpark also).

In the meantime, you can spack edit fujitsu-ssl2 for the given Benchpark experiments root (i.e. 3rd arg to benchpark setup).

i think its better to not assume that ssl2 provides fft. while i have found a few functions for fft, it still lacks headers and most build systems will fail if they don't find the fftw.h. i'll revise the yaml files for fugaku in the near future.