Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Building parts of Spack environments on different nodes: option1 (include other concretised environments) #58

Open
ccaefch0523 opened this issue Jun 14, 2024 · 68 comments

Comments

@ccaefch0523
Copy link

I created a new spacksite in Myriad using Spack 0.22 on the build01 node:

[ccspapp@build01 hpc-spack]$ spacksites/spacksites create fc-myriad-s0.22-test
/spack/0.22/fc-myriad-s0.22-test/spack/share/spack/setup-env.sh spack compiler find --scope=site
# SPACKSITES: have set SPACK_DISABLE_LOCAL_CONFIG=1
# SPACKSITES: have set HPC_SPACK_ROOT=/lustre/scratch/scratch/ccspapp/spack/0.22/hpc-spack
# SPACKSITES: Have set spacks's external compiler and python dependencies - now calling spack compiler find --scope=site
==> Added 3 new compilers to /lustre/shared/ucl/apps/spack/0.22/fc-myriad-s0.22-test/spack/etc/spack/compilers.yaml
    [email protected]  [email protected]  [email protected]
==> Compilers are defined in the following files:
    /lustre/shared/ucl/apps/spack/0.22/fc-myriad-s0.22-test/spack/etc/spack/compilers.yaml
# SPACKSITES: Now calling: #######
 source /lustre/scratch/scratch/ccspapp/spack/0.22/hpc-spack/spacksites/process-env-scripts/spack-deps-rhel-7.8.sh

source  /shared/ucl/apps/spack/0.22/fc-myriad-s0.22-test/spack/share/spack/setup-env.sh
spack config --scope=site get config
# SPACKSITES: ####################
# SPACKSITES: site.build_stage set to:  /shared/ucl/apps/spack/0.22/fc-myriad-s0.22-test/spack/../build_stage

gpg key trust done so I can use the buildcache

(spacksite: fc-myriad-s0.22-test) [ccspapp@build01 hpc-spack]$ spack gpg trust /shared/ucl/apps/spack/0.22/buildcache/build_cache/_pgp/8AD9CBD92CD2A4AEB15F3458969BB097C2225210.pub
gpg: key C2225210: public key "ARCHPCSolutions (GPG created for Spack) <[email protected]>" imported
gpg: Total number processed: 1
gpg:               imported: 1  (RSA: 1)
gpg: inserting ownertrust of 6

but then I had an empty list of the buildcache:

(spacksite: fc-myriad-s0.22-test) [ccspapp@build01 hpc-spack]$ spack buildcache list --allarch
==> 0 cached builds.

so I tried updating the indexing without the flag -d and it works!

(spacksite: fc-myriad-s0.22-test) [ccspapp@build01 hpc-spack]$ spack buildcache update-index -d /shared/ucl/apps/spack/0.22/buildcache
==> Error: unrecognized arguments: -d
(spacksite: fc-myriad-s0.22-test) [ccspapp@build01 hpc-spack]$ spack buildcache update-index /shared/ucl/apps/spack/0.22/buildcache
(spacksite: fc-myriad-s0.22-test) [ccspapp@build01 hpc-spack]$ spack buildcache list --allarch
==> 134 cached builds.
-- linux-rhel7-cascadelake / [email protected] -------------------------
[email protected]        [email protected]         [email protected]       [email protected]        [email protected]  [email protected]       [email protected]
[email protected]      [email protected]       [email protected]  [email protected]    [email protected]       [email protected]  [email protected]
[email protected]  [email protected]     [email protected]      [email protected]  [email protected]     [email protected]   [email protected]
[email protected]        [email protected]  [email protected]     [email protected]    [email protected]     [email protected]

-- linux-rhel7-cascadelake / [email protected] -------------------------
[email protected]                           [email protected]          ...

Experimenting with the myriad.yaml generated by Heather see https://github.com/UCL-ARC/hpc-spack/issues/56

(spacksite: fc-myriad-s0.22-test) [ccspapp@build01 hpc-spack]$ spack env create -d myproject  $HPC_SPACK_ROOT/spacksites/spack-env-templates/dev1/build/myriad.yaml
==> Created independent environment in: /lustre/scratch/scratch/ccspapp/spack/0.22/hpc-spack/myproject
==> Activate with: spack env activate myproject

I activated my env myproject

(spacksite: fc-myriad-s0.22-test) [ccspapp@build01 hpc-spack]$  spack env activate -p myproject
[myproject] (spacksite: fc-myriad-s0.22-test) [ccspapp@build01 hpc-spack]$ spack find 
==> In environment /lustre/scratch/scratch/ccspapp/spack/0.22/hpc-spack/myproject
==> 19 root specs
-- no arch / [email protected] -----------------------------------------
 -  [email protected]%[email protected]
 -  [email protected]%[email protected]
 -  [email protected]%[email protected]
 -  [email protected]%[email protected]
 -  [email protected]%[email protected] +cuda+mpi+openmp~sirius build_system=cmake cuda_arch=80
 -  [email protected]%[email protected]
 -  [email protected]%[email protected]
 -  [email protected]%[email protected]
 -  [email protected]%[email protected]
 -  [email protected]%[email protected] +cxx+fortran+hl~mpi
 -  [email protected]%[email protected] +fortran+hl+mpi
 -  [email protected]%[email protected]
 -  [email protected]%[email protected] ~mpi
 -  [email protected]%[email protected]
 -  [email protected]%[email protected]  fabrics=cma,knem,ofi,psm2,ucx,xpmem schedulers=sge
 -  [email protected]%[email protected]
 -  [email protected]%[email protected]
 -  [email protected]%[email protected]
 -  [email protected]%[email protected]

==> 0 installed packages

Adding Gromacs to the spec in my env myprojectand then concretise

spack add [email protected]%[email protected]+double ^[email protected]%[email protected] 
==> Adding [email protected]%[email protected]+double ^[email protected]%[email protected] to environment /lustre/scratch/scratch/ccspapp/spack/0.22/hpc-spack/myproject

Gromacs is added to the root specs

I need to define a rule to exclude installing/concretising cp2k in my env ???

@heatherkellyucl
Copy link
Collaborator

heatherkellyucl commented Jun 17, 2024

You don't need to have a rule excluding cp2k - instead it ought to be in the gpu environment.

Don't use my myriad.yaml directly, instead you need to modify it to use include_concrete instead of

  include:
  - $HPC_SPACK_ROOT/spacksites/spack-env-templates/dev1/build/base.yaml
  - $HPC_SPACK_ROOT/spacksites/spack-env-templates/dev1/build/gpu.yaml
  - $HPC_SPACK_ROOT/spacksites/spack-env-templates/dev1/build/gpu-on-gpu.yaml

so that you make separate concretised environments for base, gpu-on-gpu, gpu and then include those in myriad.yaml.

@heatherkellyucl
Copy link
Collaborator

(There's a question about which of the environments should include_concrete which others - so it ends up more like the chaining than what I did).

@heatherkellyucl heatherkellyucl changed the title Spack 0.22 environments option2 Building parts of Spack environments on different nodes: option1 (include other concretised environments) Jun 17, 2024
@heatherkellyucl
Copy link
Collaborator

For example, you concretise and build the base environment, then the gpu-on-gpu environment separately (and on a gpu node), then the gpu environment that includes the gpu-on-gpu environment, and finally the myriad environment that includes everything and which has anything extra that is only for myriad.

That's if we keep the split of how the environments are divided up the same as I initially did - if another split makes more sense, do that instead.

CPU Gromacs should go in base if we're keeping the split the same since CPU Gromacs gets installed everywhere.

@heatherkellyucl
Copy link
Collaborator

I got the most recent gromacs from spack develop: #44 (comment)

so we can have

[email protected] +double
[email protected] +cuda cuda_arch=80 
gromacs@2023 +double +plumed
gromacs@2023 +cuda cuda_arch=80 +plumed

@ccaefch0523
Copy link
Author

Testing --include-concrete

I created a base environment added perl and python concretised and then created another environment testincluded that includes base

spack env create --include-concrete base testincluded

Spack env list
==> 3 environments
    base  base_env1  testincluded

Deleted base_env1

 spack env remove base_env1
==> Really remove environment base_env1? [y/N] y
==> Successfully removed environment 'base_env1'
spack env list
==> 2 environments
    base  testincluded

Added nedit and zlib to env base but did not concretise nedit it

spack -e base find -c

==> In environment base
==> 4 root specs
 -  nedit  [+] perl  [+] python  [+] zlib

==> Concretized roots
-- linux-rhel7-cascadelake / [email protected] -------------------------
[email protected]  [email protected]

-- linux-rhel7-cascadelake / [email protected] -------------------------
[email protected]

==> Installed packages
-- linux-rhel7-cascadelake / [email protected] -------------------------
[email protected]  [email protected]  [email protected]     [email protected]  [email protected]       [email protected]
[email protected]          [email protected]           [email protected]    [email protected]     [email protected]  [email protected]
[email protected]        [email protected]      [email protected]  [email protected]     [email protected]   [email protected]

-- linux-rhel7-cascadelake / [email protected] -------------------------
ca-certificates-mozilla@2023-05-30  [email protected]  [email protected]  [email protected]
[email protected]                         [email protected]   [email protected]     [email protected]
[email protected]                  [email protected]    [email protected]
==> 29 installed packages

After concretising the base, I still don't see zlib and nedit in testincluded env . So the change is not reflected in the included environment testincluded

I need to reconcretize the env testincluded

 spack -e testincluded  concretize
(spacksite: fc-myriad-s0.22-test) [ccspapp@build01 hpc-spack]$ spack -e testincluded  find -c
==> In environment testincluded
==> No root specs

==> Included specs
nedit  perl  python  zlib

==> Concretized roots

==> Installed packages
-- linux-rhel7-cascadelake / [email protected] -------------------------
[email protected]         [email protected]          [email protected]         [email protected]      [email protected]         [email protected]
[email protected]       [email protected]    [email protected]      [email protected]        [email protected]            [email protected]
[email protected]          [email protected]  [email protected]          [email protected]     [email protected]       [email protected]
[email protected]   [email protected]           [email protected]         [email protected]     [email protected]        [email protected]
[email protected]           [email protected]      [email protected]  [email protected]     [email protected]
[email protected]  [email protected]          [email protected]       [email protected]          [email protected]
[email protected]         [email protected]         [email protected]           [email protected]    [email protected]
[email protected]       [email protected]           [email protected]         [email protected]  [email protected]
[email protected]        [email protected]    [email protected]          [email protected]        [email protected]

-- linux-rhel7-cascadelake / [email protected] -------------------------
[email protected]                         [email protected]   [email protected]  [email protected]
ca-certificates-mozilla@2023-05-30  [email protected]        [email protected]      [email protected]
[email protected]                        [email protected]         [email protected]    [email protected]
[email protected]                          [email protected]  [email protected]
[email protected]                         [email protected]          [email protected]
[email protected]                     [email protected]        [email protected]
==> 70 installed packages

I need to test removing a spec from base

Testing creating an independent environment via an environment files ../spack.yam placed in a directory.

 spack env create -d new-code ../spack.yaml
==> Updating view at /lustre/scratch/scratch/ccspapp/spack/0.22/hpc-spack/fctestenv/new-code/.spack-env/view
==> Created independent environment in: /lustre/scratch/scratch/ccspapp/spack/0.22/hpc-spack/fctestenv/new-code
==> Activate with: spack env activate new-code
(spacksite: fc-myriad-s0.22-test) [ccspapp@build01 fctestenv]$ spack env list
==> 3 environments
    base  base_env1  testincluded

(spacksite: fc-myriad-s0.22-test) [ccspapp@build01 fctestenv]$ ls
new-code

the new env in the directory new-code exists

(spacksite: fc-myriad-s0.22-test) [ccspapp@build01 fctestenv]$ spack -e new-code find
==> In environment /lustre/scratch/scratch/ccspapp/spack/0.22/hpc-spack/fctestenv/new-code
==> No root specs

==> Included specs
perl  python

==> Installed packages
-- linux-rhel7-cascadelake / [email protected] -------------------------
[email protected]  [email protected]  [email protected]     [email protected]  [email protected]       [email protected]
[email protected]          [email protected]           [email protected]    [email protected]     [email protected]  [email protected]
[email protected]        [email protected]      [email protected]  [email protected]     [email protected]   [email protected]

-- linux-rhel7-cascadelake / [email protected] -------------------------
ca-certificates-mozilla@2023-05-30  [email protected]  [email protected]  [email protected]
[email protected]                         [email protected]   [email protected]     [email protected]
[email protected]                  [email protected]    [email protected]
==> 29 installed packages


@heatherkellyucl
Copy link
Collaborator

heatherkellyucl commented Aug 8, 2024

Our existing specs are split into four parts (myriad, base, gpu, gpu-on-gpu). The process for doing this and yaml files for these four parts need to be created, and the yaml files added to the repo.

Q: which environments should include which of the others to completely create this structure?

@heatherkellyucl
Copy link
Collaborator

Once this is working, then we can add the final packages to whichever of those files is appropriate.

@ccaefch0523
Copy link
Author

Creating an env for Gromacs/plumed/ GPU (versions are listed below) that included base (needs editing)
spacksites/spack-env-templates/dev1/build/myriad.yaml

[email protected] +cuda cuda_arch=80 +plumed
gromacs@2023 +cuda cuda_arch=80 +plumed
 spack env create --include-concrete base  gromacsgpu
==> Updating view at /lustre/shared/ucl/apps/spack/0.22/fc-myriad-s0.22-test/spack/var/spack/environments/gromacsgpu/.spack-env/view

==> Created environment gromacsgpu in: /lustre/shared/ucl/apps/spack/0.22/fc-myriad-s0.22-test/spack/var/spack/environments/gromacsgpu
==> Activate with: spack env activate gromacsgpu

adding Gromacs

spack -e gromacsgpu add gromacs@2023 +cuda+plumed cuda_arch=80
spack -e gromacsgpu find -c
==> In environment gromacsgpu
==> 1 root specs
 -  gromacs@2023 +cuda+plumed cuda_arch=80

==> Included specs
-- no arch / [email protected] -----------------------------------------
[email protected]%[email protected]      [email protected]%[email protected]                        [email protected]%[email protected] ~mpi                                     [email protected]%[email protected]
[email protected]%[email protected]  [email protected]%[email protected] +cxx+fortran+hl~mpi  [email protected]%[email protected]                                    [email protected]%[email protected]
[email protected]%[email protected]        [email protected]%[email protected] +fortran+hl+mpi      [email protected]%[email protected]  fabrics=cma,ofi,psm2,ucx schedulers=sge  [email protected]%[email protected]
[email protected]%[email protected]      [email protected]%[email protected]                      [email protected]%[email protected]

==> Concretized roots
-- linux-rhel7-cascadelake / [email protected] -------------------------
gromacs@2023

==> Installed packages
-- linux-rhel7-cascadelake / [email protected] -------------------------
[email protected]    [email protected]  [email protected]    [email protected]  [email protected]  [email protected]    [email protected]  [email protected]  [email protected]  [email protected]       [email protected]  [email protected]
[email protected]  [email protected]          [email protected]  [email protected]           [email protected]      [email protected]  [email protected]    [email protected]       [email protected]  [email protected]  [email protected]      [email protected]

-- linux-rhel7-cascadelake / [email protected] -------------------------
[email protected]                         [email protected]  [email protected]         [email protected]  [email protected]       [email protected]  [email protected]    [email protected]           [email protected]
ca-certificates-mozilla@2023-05-30  [email protected]    [email protected]  [email protected]   [email protected]  [email protected]   [email protected]  [email protected]
==> 41 installed packages

@heatherkellyucl
Copy link
Collaborator

I have altered these yaml files to be the include_concrete versions:

	modified:   spacksites/spack-env-templates/dev1/build/base.yaml
	modified:   spacksites/spack-env-templates/dev1/build/gpu-on-gpu.yaml
	modified:   spacksites/spack-env-templates/dev1/build/gpu.yaml
	modified:   spacksites/spack-env-templates/dev1/build/myriad.yaml

Right now I have myriad.yaml including all of the other envs, but gpu including base and gpu-on-gpu including gpu. Need to test how that works.

I have also added the casteps and cpu gromacses to base.yaml and the gpu gromacses to gpu.yaml. (Don't know if that needs to be gpu-on-gpu.yaml).

@heatherkellyucl
Copy link
Collaborator

heatherkellyucl commented Sep 19, 2024

Starting with (in existing hk-initial-stack site):

spack env create base /home/ccspapp/Scratch/spack/0.22/hpc-spack/spacksites/spack-env-templates/dev1/build/base.yaml
==> Created environment base in: /lustre/shared/ucl/apps/spack/0.22/hk-initial-stack/spack/var/spack/environments/base
==> Activate with: spack env activate base

spack -e base concretize -f
...

spack -e base install

castep and gromacs aren't in the build cache yet so there are some things to build, starting with gsl.

==> Installing gsl-2.7.1-efih7w3hrez4pzjrvad5m3qsxks5suk4 [15/98]
==> No binary for gsl-2.7.1-efih7w3hrez4pzjrvad5m3qsxks5suk4 found: installing from source
==> Fetching https://mirror.spack.io/_source-cache/archive/dc/dcb0fbd43048832b757ff9942691a8dd70026d5da0ff85601e52687f6deeb34b.tar.gz
==> No patches needed for gsl
==> gsl: Executing phase: 'autoreconf'
==> gsl: Executing phase: 'configure'
==> gsl: Executing phase: 'build'
==> gsl: Executing phase: 'install'
==> gsl: Successfully installed gsl-2.7.1-efih7w3hrez4pzjrvad5m3qsxks5suk4
  Stage: 3.84s.  Autoreconf: 0.00s.  Configure: 23.99s.  Build: 1m 47.60s.  Install: 4.36s.  Post-install: 1.65s.  Total: 2m 22.14s

@heatherkellyucl
Copy link
Collaborator

GROMACS 2024.2 on its own and Plumed 2.9.0 were fine.

==> Installing gromacs-2024.2-twuqinqf5khu2f33546sglpff5d5n6lj [93/98]
==> No binary for gromacs-2024.2-twuqinqf5khu2f33546sglpff5d5n6lj found: installing from source
==> Fetching https://mirror.spack.io/_source-cache/archive/80/802a7e335f2e895770f57b159e4ec368ebb0ff2ce6daccf706c6e8025c36852b.tar.gz
==> Ran patch() for gromacs
==> gromacs: Executing phase: 'cmake'
==> gromacs: Executing phase: 'build'
==> gromacs: Executing phase: 'install'
==> gromacs: Successfully installed gromacs-2024.2-twuqinqf5khu2f33546sglpff5d5n6lj
  Stage: 13.22s.  Cmake: 1m 10.63s.  Build: 5m 8.55s.  Install: 6.87s.  Post-install: 3.51s.  Total: 6m 59.72s
==> Installing plumed-2.9.0-qfmsmjb6zdox6u5unwdkosxgn3bzqoul [95/98]
==> No binary for plumed-2.9.0-qfmsmjb6zdox6u5unwdkosxgn3bzqoul found: installing from source
==> Fetching https://mirror.spack.io/_source-cache/archive/61/612d2387416b5f82dd8545709921440370e144fd46cef633654cf0ee43bac5f8.tar.gz
==> Ran patch() for plumed
==> plumed: Executing phase: 'autoreconf'
==> plumed: Executing phase: 'configure'
==> plumed: Executing phase: 'build'
==> plumed: Executing phase: 'install'
==> plumed: Successfully installed plumed-2.9.0-qfmsmjb6zdox6u5unwdkosxgn3bzqoul
  Stage: 14.17s.  Autoreconf: 7.77s.  Configure: 56.21s.  Build: 17m 59.95s.  Install: 45.18s.  Post-install: 1.76s.  Total: 20m 7.35s

Need to check on the patches for GROMACS 2023 (looks minor):

==> Installing gromacs-2023-i3nsau23qwhkg3c44ehsor3izfiacdqf [97/98]
==> No binary for gromacs-2023-i3nsau23qwhkg3c44ehsor3izfiacdqf found: installing from source
==> Fetching https://mirror.spack.io/_source-cache/archive/ac/ac92c6da72fbbcca414fd8a8d979e56ecf17c4c1cdabed2da5cfb4e7277b7ba8.tar.gz
NOTE: shell only version, useful when plumed is cross compiled
NOTE: shell only version, useful when plumed is cross compiled
PLUMED patching tool

MD engine: gromacs-2023
PLUMED location: /lustre/shared/ucl/apps/spack/0.22/hk-initial-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/linux-rhel7-cascadelake/gcc-12.3.0/plumed-2.9.0-qfmsmjb6zdox6u5unwdkosxgn3bzqoul/lib/plumed
diff file: /lustre/shared/ucl/apps/spack/0.22/hk-initial-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/linux-rhel7-cascadelake/gcc-12.3.0/plumed-2.9.0-qfmsmjb6zdox6u5unwdkosxgn3bzqoul/lib/plumed/patches/gromacs-2023.diff
sourcing config file: /lustre/shared/ucl/apps/spack/0.22/hk-initial-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/linux-rhel7-cascadelake/gcc-12.3.0/plumed-2.9.0-qfmsmjb6zdox6u5unwdkosxgn3bzqoul/lib/plumed/patches/gromacs-2023.config
Executing plumed_before_patch function
PLUMED can be incorporated into gromacs using the standard patching procedure.
Patching must be done in the gromacs root directory  _before_ the cmake command is invoked.

On clusters you may want to patch gromacs using the static version of plumed, in this case
building gromacs can result in multiple errors. One possible solution is to configure gromacs
with these additional options:

cmake -DBUILD_SHARED_LIBS=OFF -DGMX_PREFER_STATIC_LIBS=ON  

To enable PLUMED in a gromacs simulation one should use
mdrun with an extra -plumed flag. The flag can be used to  
specify the name of the PLUMED input file, e.g.:

gmx mdrun -plumed plumed.dat

For more information on gromacs you should visit http://www.gromacs.org

Linking Plumed.h, Plumed.inc, and Plumed.cmake (shared mode)
Patching with on-the-fly diff from stored originals
patching file ./cmake/gmxVersionInfo.cmake
Hunk #1 FAILED at 257.
1 out of 1 hunk FAILED -- saving rejects to file ./cmake/gmxVersionInfo.cmake.rej
patching file ./src/gromacs/CMakeLists.txt
patching file ./src/gromacs/mdlib/expanded.cpp
patching file ./src/gromacs/mdlib/expanded.h
patching file ./src/gromacs/mdlib/sim_util.cpp
patching file ./src/gromacs/mdrun/legacymdrunoptions.cpp   
patching file ./src/gromacs/mdrun/legacymdrunoptions.h
patching file ./src/gromacs/mdrun/md.cpp
patching file ./src/gromacs/mdrun/minimize.cpp
patching file ./src/gromacs/mdrun/replicaexchange.cpp
patching file ./src/gromacs/mdrun/replicaexchange.h
patching file ./src/gromacs/mdrun/rerun.cpp
patching file ./src/gromacs/mdrun/runner.cpp
patching file ./src/gromacs/modularsimulator/expandedensembleelement.cpp
patching file ./src/gromacs/taskassignment/decidegpuusage.cpp
patching file ./src/gromacs/taskassignment/include/gromacs/taskassignment/decidegpuusage.h

PLUMED is compiled with MPI support so you can configure gromacs-2023 with MPI
==> Ran patch() for gromacs
==> gromacs: Executing phase: 'cmake'
==> gromacs: Executing phase: 'build'
==> gromacs: Executing phase: 'install'
==> gromacs: Successfully installed gromacs-2023-i3nsau23qwhkg3c44ehsor3izfiacdqf
  Stage: 12.95s.  Cmake: 49.70s.  Build: 4m 56.29s.  Install: 6.54s.  Post-install: 1.67s.  Total: 6m 8.45s

@heatherkellyucl
Copy link
Collaborator

Plumed 2.9.0: "Patch for GROMACS 2023 (preliminary, in particular for replica-exchange, expanded ensemble, hrex features)."
Plumed 2.9.2: "Patch for GROMACS 2023 updated to the latest version"

=> we want the 2.9.2 plumed for GROMACS 2023.x instead.

The actual failure was only the version patching in cmake as in plumed/plumed2#960 (comment) but other functionality may not be there.

@heatherkellyucl
Copy link
Collaborator

Have added a repos/ucl package for most recent plumed, updated the gromacs one in there and added knowledge of plumed 2.9.2 to it.

Now want these:

      - [email protected] +double
      - [email protected] +double +plumed

@heatherkellyucl
Copy link
Collaborator

Ok, we now have these in my base packages:

==> plumed: Successfully installed plumed-2.9.2-gf2kz5qj4deszk3dtpqvsaaq7uio3a45
  Stage: 1m 54.07s.  Autoreconf: 13.22s.  Configure: 4m 25.75s.  Build: 20m 29.53s.  Install: 1m 19.79s.  Post
-install: 5.50s.  Total: 28m 53.62s
==> gromacs: Successfully installed gromacs-2024.3-ngcyv5lxlqtz4dkmsbwhsjd74qu3xjia
  Stage: 3m 19.39s.  Cmake: 2m 18.77s.  Build: 5m 32.52s.  Install: 36.05s.  Post-install: 8.22s.  Total: 11m 59.54s
==> gromacs: Successfully installed gromacs-2023.5-hh7utvxt52oak37vwcbyayu3sdlhv2bf
  Stage: 1m 23.56s.  Cmake: 1m 59.95s.  Build: 5m 21.73s.  Install: 35.91s.  Post-install: 3.51s.  Total: 9m 27.45s

No patching issues.

@heatherkellyucl
Copy link
Collaborator

heatherkellyucl commented Oct 15, 2024

LAMMPS:

      - lammps@20240829 +mpi +python +amoeba +asphere +bocs +body +bpm +brownian +cg-dna +cg-spica +class2 +colloid +colvars +compress +coreshell +dielectric +diffraction +dipole +dpd-basic +dpd-meso +dpd-react +dpd-smooth +drude +eff +electrode +extra-compute +extra-dump +extra-fix +extra-molecule +extra-pair +fep +granular +interlayer +kspace +lepton +machdyn +manybody +mc +meam +mesont +misc +ml-iap +ml-pod +ml-snap +ml-uf3 +mofff +molecule +openmp +opt +orient +peri +phonon +plugin +poems +qeq +reaction +reaxff +replica +rigid +rheo +shock +sph +spin +srd +tally +uef +voronoi +yaff

Added +ml-uf3 and +rheo since available in 2024

Check if want +kokkos for CUDA version or +gpu (or both as two separate installs, since we have had requests for how to build lammps+kokkos):

        if "~kokkos" in spec:
            # LAMMPS can be build with the GPU package OR the KOKKOS package
            # Using both in a single build is discouraged.
            # +cuda only implies that one of the two is used
            # by default it will use the GPU package if kokkos wasn't enabled

NAMD:

Default is the TCL interface rather than python and that is how we currently build.

CUDA:

# myriad
[email protected] +cuda cuda_arch="70,80" +single_node_gpu

@heatherkellyucl
Copy link
Collaborator

heatherkellyucl commented Oct 15, 2024

CPU lammps built, CPU NAMD 2.14 built (with charmpp 6.10.2), but charmpp 7.0.0 for NAMD 3.0 failed:

==> Installing charmpp-7.0.0-ajpis4lxw5ielvvr22qcbakeby4va4xt [70/100]
==> No binary for charmpp-7.0.0-ajpis4lxw5ielvvr22qcbakeby4va4xt found: installing from source
==> Using cached archive: /lustre/shared/ucl/apps/spack/0.22/hk-initial-stack/spack/var/spack/cache/_source-ca
che/archive/9c/9c247b421bb157bdf9bc0ced3e25738c7a1dc1f7ec57b7943a7faf97f7e4fb2e.tar.gz
==> No patches needed for charmpp
==> charmpp: Executing phase: 'install'
==> Error: ProcessError: Command exited with status 2:
    './build' 'LIBS' 'netlrts-linux-x86_64' 'gcc' 'gfortran' '-j6' '--destination=/lustre/shared/ucl/apps/spac
k/0.22/hk-initial-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_pla
ceholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_place
holder__/linux-rhel7-cascadelake/gcc-12.3.0/charmpp-7.0.0-ajpis4lxw5ielvvr22qcbakeby4va4xt' 'smp' '--build-sha
red' '--with-production'

7 errors found in build log:
     1528    [ 96%] Building CXX object src/libs/ck-libs/ampi/CMakeFiles/moduleampif.dir/ddt.C.o
     1529    [ 96%] Building CXX object src/libs/ck-libs/ampi/CMakeFiles/moduleampif.dir/mpich-alltoall.C.o
     1530    [ 96%] Building CXX object src/libs/ck-libs/ampi/CMakeFiles/moduleampif.dir/ampi_mpix.C.o
     1531    [ 96%] Building CXX object src/libs/ck-libs/ampi/CMakeFiles/moduleampif.dir/ampi_noimpl.C.o
     1532    [ 96%] Linking CXX static library ../../../../lib/libmoduleampi.a
     1533    [ 96%] Linking CXX static library ../../../../lib/libmoduleampif.a
  >> 1534    Fatal Error by charmc in directory /lustre/shared/ucl/apps/spack/0.22/hk-initial-stack/spack/opt
             /spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_
             path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholde
             r__/linux-rhel7-cascadelake/gcc-12.3.0/charmpp-7.0.0-ajpis4lxw5ielvvr22qcbakeby4va4xt/src/libs/c
             k-libs/ampi
     1535       Trying to link, but no object files or library archives were specified
     1536    charmc exiting...
     1535       Trying to link, but no object files or library archives were specified
     1536    charmc exiting...
  >> 1537    make[2]: *** [src/libs/ck-libs/ampi/CMakeFiles/moduleampi.dir/build.make:547: lib/libmoduleampi.
             a] Error 1
  >> 1538    make[1]: *** [CMakeFiles/Makefile2:3470: src/libs/ck-libs/ampi/CMakeFiles/moduleampi.dir/all] Er
             ror 2
     1539    make[1]: *** Waiting for unfinished jobs....  
  >> 1540    Fatal Error by charmc in directory /lustre/shared/ucl/apps/spack/0.22/hk-initial-stack/spack/opt
             /spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_
             path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholde
             r__/linux-rhel7-cascadelake/gcc-12.3.0/charmpp-7.0.0-ajpis4lxw5ielvvr22qcbakeby4va4xt/src/libs/c
             k-libs/ampi
     1541       Trying to link, but no object files or library archives were specified
     1542    charmc exiting...
  >> 1543    make[2]: *** [src/libs/ck-libs/ampi/CMakeFiles/moduleampif.dir/build.make:579: lib/libmoduleampi
             f.a] Error 1
  >> 1544    make[1]: *** [CMakeFiles/Makefile2:3501: src/libs/ck-libs/ampi/CMakeFiles/moduleampif.dir/all] E
             rror 2
  >> 1545    make: *** [Makefile:136: all] Error 2
See build log for details:
  /lustre/shared/ucl/apps/spack/0.22/hk-initial-stack/build_stage/ccspapp/spack-stage-charmpp-7.0.0-ajpis4lxw5ielvvr22qcbakeby4va4xt/spack-build-out.txt

==> Warning: Skipping build of namd-3.0-sthub4raczji5xmf63ngdux3lzrmtpea since charmpp-7.0.0-ajpis4lxw5ielvvr22qcbakeby4va4xt failed

@heatherkellyucl
Copy link
Collaborator

This is what we got for the charmpp 6.10.2 built for namd 2.14:

[email protected]~cuda~omp~papi+production~pthreads+shared+smp~syncft~tcp~tracing backend=netlrts build-target=LIBS build_system=generic pmi=none

I think if we want the backend to be netlrts on Myriad but ofi on the OmniPath machines then namd needs to be in the machine-specific file rather than base.yaml.

You can also choose backend=ucx which should be more generalisable and work on both (and our openmpi install depends on pmix which it requires - https://charm.readthedocs.io/en/latest/charm++/manual.html#ucx). So that might work better as one install?

I will change the base.yaml namds to use that, add in the charmpp 8.0.0 package for namd 3.0, and will need to run test jobs on Myriad and one of Young/Kathleen/Michael to make sure that works.

@heatherkellyucl
Copy link
Collaborator

==> Installing charmpp-6.10.2-qpjdrloy2fmppytxlbmnsxrhu3spbfbr [49/100]
==> No binary for charmpp-6.10.2-qpjdrloy2fmppytxlbmnsxrhu3spbfbr found: installing from source
==> Using cached archive: /lustre/shared/ucl/apps/spack/0.22/hk-initial-stack/spack/var/spack/cache/_source-ca
che/archive/7a/7abb4cace8aebdfbb8006eac03eb766897c009cfb919da0d0a33f74c3b4e6deb.tar.gz
==> No patches needed for charmpp
==> charmpp: Executing phase: 'install'
==> Error: InstallError: The UCX/OFI/GNI backends need                                     PMI to run. Please 
add pmi=...                                     Note that PMIx is the preferred                               
      option.

/lustre/scratch/scratch/ccspapp/spack/0.22/hpc-spack/repos/ucl/packages/charmpp/package.py:293, in install:
        290            or ("backend=gni" in self.spec)
        291        ):
        292            if self.spec.satisfies("pmi=none"):
  >>    293                raise InstallError(
        294                    "The UCX/OFI/GNI backends need \
        295                                    PMI to run. Please add pmi=... \
        296                                    Note that PMIx is the preferred \

See build log for details:
  /lustre/shared/ucl/apps/spack/0.22/hk-initial-stack/build_stage/ccspapp/spack-stage-charmpp-6.10.2-qpjdrloy2
fmppytxlbmnsxrhu3spbfbr/spack-build-out.txt

==> Warning: Skipping build of namd-2.14-zglyymqqhavkpcfunqlligfc5h3htch5 since charmpp-6.10.2-qpjdrloy2fmppyt
xlbmnsxrhu3spbfbr failed

Also needs pmi=pmix.

@heatherkellyucl
Copy link
Collaborator

Still issue with charmpp 8.0.0:

==> Installing charmpp-8.0.0-kftou6wlhw7qppuoxyiwb6t66bdf45sy [88/100]
==> No binary for charmpp-8.0.0-kftou6wlhw7qppuoxyiwb6t66bdf45sy found: installing from source
==> Using cached archive: /lustre/shared/ucl/apps/spack/0.22/hk-initial-stack/spack/var/spack/cache/_source-ca
che/archive/e3/e30fc1e921e5cbf3406e792d5b0ca5f211c5d8ffbfc56e56d5501d8118abcaf6.tar.gz
==> No patches needed for charmpp
==> charmpp: Executing phase: 'install'
==> Error: ProcessError: Command exited with status 2:
    './build' 'LIBS' 'ucx-linux-x86_64' 'gcc' 'gfortran' '-j6' '--destination=/lustre/shared/ucl/apps/spack/0.
22/hk-initial-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeho
lder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placehold
er__/linux-rhel7-cascadelake/gcc-12.3.0/charmpp-8.0.0-kftou6wlhw7qppuoxyiwb6t66bdf45sy' 'ompipmix' '--basedir=
/lustre/shared/ucl/apps/spack/0.22/hk-initial-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_pl
aceholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_plac
eholder__/__spack_path_placeholder__/linux-rhel7-cascadelake/gcc-12.3.0/openmpi-4.1.6-vfg7lekutaiginlgvs57titv
pvnjgys5' '--basedir=/lustre/shared/ucl/apps/spack/0.22/hk-initial-stack/spack/opt/spack/__spack_path_placehol
der__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholde
r__/__spack_path_placeholder__/__spack_path_placeholder__/linux-rhel7-cascadelake/gcc-12.3.0/ucx-1.16.0-xrxjlo
wa7a3vqa3qt4n74ojkd4dz5ybh' 'smp' '--build-shared' '--with-production'

7 errors found in build log:
     1460    [ 95%] Building CXX object src/libs/ck-libs/ampi/CMakeFiles/moduleampif.dir/ampif.C.o
     1461    [ 95%] Building CXX object src/libs/ck-libs/ampi/CMakeFiles/moduleampif.dir/ddt.C.o
     1462    [ 95%] Building CXX object src/libs/ck-libs/ampi/CMakeFiles/moduleampif.dir/mpich-alltoall.C.o
     1463    [ 95%] Building CXX object src/libs/ck-libs/ampi/CMakeFiles/moduleampif.dir/ampi_mpix.C.o
     1464    [ 95%] Building CXX object src/libs/ck-libs/ampi/CMakeFiles/moduleampif.dir/ampi_noimpl.C.o
     1465    [ 95%] Linking CXX static library ../../../../lib/libmoduleampi.a
  >> 1466    Fatal Error by charmc in directory /lustre/shared/ucl/apps/spack/0.22/hk-initial-stack/spack/opt
             /spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_
             path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholde
             r__/linux-rhel7-cascadelake/gcc-12.3.0/charmpp-8.0.0-kftou6wlhw7qppuoxyiwb6t66bdf45sy/src/libs/c
             k-libs/ampi
     1467       Trying to link, but no object files or library archives were specified
     1468    charmc exiting...
  >> 1469    make[2]: *** [src/libs/ck-libs/ampi/CMakeFiles/moduleampi.dir/build.make:547: lib/libmoduleampi.
             a] Error 1
  >> 1470    make[1]: *** [CMakeFiles/Makefile2:3301: src/libs/ck-libs/ampi/CMakeFiles/moduleampi.dir/all] Er
             ror 2
     1471    make[1]: *** Waiting for unfinished jobs....
     1472    [ 96%] Linking CXX static library ../../../../lib/libmoduleampif.a
  >> 1473    Fatal Error by charmc in directory /lustre/shared/ucl/apps/spack/0.22/hk-initial-stack/spack/opt
             /spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_
             path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholde
             r__/linux-rhel7-cascadelake/gcc-12.3.0/charmpp-8.0.0-kftou6wlhw7qppuoxyiwb6t66bdf45sy/src/libs/c
             k-libs/ampi
     1474       Trying to link, but no object files or library archives were specified
     1475    charmc exiting...
  >> 1476    make[2]: *** [src/libs/ck-libs/ampi/CMakeFiles/moduleampif.dir/build.make:562: lib/libmoduleampi
             f.a] Error 1
  >> 1477    make[1]: *** [CMakeFiles/Makefile2:3331: src/libs/ck-libs/ampi/CMakeFiles/moduleampif.dir/all] E
             rror 2
  >> 1478    make: *** [Makefile:136: all] Error 2

See build log for details:
  /lustre/shared/ucl/apps/spack/0.22/hk-initial-stack/build_stage/ccspapp/spack-stage-charmpp-8.0.0-kftou6wlhw7qppuoxyiwb6t66bdf45sy/spack-build-out.txt

==> Warning: Skipping build of namd-3.0-j734m3yspeb36zqw763k2swznx3yw7kv since charmpp-8.0.0-kftou6wlhw7qppuoxyiwb6t66bdf45sy failed

@heatherkellyucl
Copy link
Collaborator

namd 2.14 still fine. Needed to run spack -e base module tcl refresh after to generate new modulefiles since we'd already built one.

@heatherkellyucl
Copy link
Collaborator

/lustre/shared/ucl/apps/spack/0.22/hk-initial-stack/build_stage/ccspapp/spack-stage-charmpp-8.0.0-kftou6wlhw7qppuoxyiwb6t66bdf45sy/spack-build-out.txt is not particularly more helpful:

[ 93%] Building CXX object src/libs/ck-libs/ampi/CMakeFiles/ampif.dir/ampif.C.o
[ 93%] Building CXX object src/libs/ck-libs/ampi/CMakeFiles/moduleampi.dir/ampiMisc.C.o
[ 93%] Building Fortran object src/libs/ck-libs/ampi/CMakeFiles/ampimod.dir/ampimod.f90.o
[ 94%] Building CXX object src/libs/ck-libs/ampi/CMakeFiles/moduleampi.dir/ampi.C.o
[ 94%] Building CXX object src/libs/ck-libs/ampi/CMakeFiles/moduleampi.dir/ampiOneSided.C.o
[ 94%] Building CXX object src/libs/ck-libs/ampi/CMakeFiles/moduleampi.dir/ampif.C.o
[ 94%] Built target ampimod
[ 94%] Building CXX object src/libs/ck-libs/ampi/CMakeFiles/moduleampi.dir/ddt.C.o
[ 94%] Building CXX object src/libs/ck-libs/ampi/CMakeFiles/moduleampi.dir/mpich-alltoall.C.o
[ 94%] Built target ampif
[ 94%] Building CXX object src/libs/ck-libs/ampi/CMakeFiles/moduleampi.dir/ampi_mpix.C.o
[ 94%] Building Fortran object src/libs/ck-libs/ampi/CMakeFiles/moduleampif.dir/ampimod.f90.o
[ 95%] Building CXX object src/libs/ck-libs/ampi/CMakeFiles/moduleampif.dir/ampi.C.o
[ 95%] Building CXX object src/libs/ck-libs/ampi/CMakeFiles/moduleampi.dir/ampi_noimpl.C.o
[ 95%] Building CXX object src/libs/ck-libs/ampi/CMakeFiles/moduleampif.dir/ampiMisc.C.o
[ 95%] Building CXX object src/libs/ck-libs/ampi/CMakeFiles/moduleampif.dir/ampiOneSided.C.o
[ 95%] Building CXX object src/libs/ck-libs/ampi/CMakeFiles/moduleampif.dir/ampif.C.o
[ 95%] Building CXX object src/libs/ck-libs/ampi/CMakeFiles/moduleampif.dir/ddt.C.o
[ 95%] Building CXX object src/libs/ck-libs/ampi/CMakeFiles/moduleampif.dir/mpich-alltoall.C.o
[ 95%] Building CXX object src/libs/ck-libs/ampi/CMakeFiles/moduleampif.dir/ampi_mpix.C.o
[ 95%] Building CXX object src/libs/ck-libs/ampi/CMakeFiles/moduleampif.dir/ampi_noimpl.C.o
[ 95%] Linking CXX static library ../../../../lib/libmoduleampi.a
Fatal Error by charmc in directory /lustre/shared/ucl/apps/spack/0.22/hk-initial-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/linux-rhel7-cascadelake/gcc-12.3.0/charmpp-8.0.0-kftou6wlhw7qppuoxyiwb6t66bdf45sy/src/libs/ck-libs/ampi
   Trying to link, but no object files or library archives were specified
charmc exiting...
make[2]: *** [src/libs/ck-libs/ampi/CMakeFiles/moduleampi.dir/build.make:547: lib/libmoduleampi.a] Error 1
make[1]: *** [CMakeFiles/Makefile2:3301: src/libs/ck-libs/ampi/CMakeFiles/moduleampi.dir/all] Error 2

There is no charmpp-8.0.0-anything in /lustre/shared/ucl/apps/spack/0.22/hk-initial-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/linux-rhel7-cascadelake/gcc-12.3.0/ after the build fails.

@heatherkellyucl
Copy link
Collaborator

heatherkellyucl commented Oct 28, 2024

/lustre/shared/ucl/apps/spack/0.22/hk-initial-stack/build_stage/ccspapp/spack-stage-charmpp-8.0.0-kftou6wlhw7qppuoxyiwb6t66bdf45sy/spack-src/ has symlinks to now-nonexistent locations.

lrwxrwxrwx  1 ccspapp legadf   342 Oct 28 13:57 lib -> /lustre/shared/ucl/apps/spack/0.22/hk-initial-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/linux-rhel7-cascadelake/gcc-12.3.0/charmpp-8.0.0-kftou6wlhw7qppuoxyiwb6t66bdf45sy/lib

lrwxrwxrwx  1 ccspapp legadf   345 Oct 28 13:57 lib_so -> /lustre/shared/ucl/apps/spack/0.22/hk-initial-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/linux-rhel7-cascadelake/gcc-12.3.0/charmpp-8.0.0-kftou6wlhw7qppuoxyiwb6t66bdf45sy/lib_so

(and bin, include, tmp)

@heatherkellyucl
Copy link
Collaborator

heatherkellyucl commented Oct 29, 2024

Trying outside Spack to see what gets created in src/libs/ck-libs/ampi/CMakeFiles/moduleampi.dir/.

Charmpp has a build command that runs buildcmake for this version.

The build command from the log was

'./build' 'LIBS' 'ucx-linux-x86_64' 'gcc' 'gfortran' '-j6' '--destination=/lustre/shared/ucl/apps/spack/0.22/hk-initial-stack/spack/opt/spack/[padded-to-256-chars]/linux-rhel7-cascadelake/gcc-12.3.0/charmpp-8.0.0-kftou6wlhw7qppuoxyiwb6t66bdf45sy' 'ompipmix' '--basedir=/lustre/shared/ucl/apps/spack/0.22/hk-initial-stack/spack/opt/spack/[padded-to-256-chars]/linux-rhel7-cascadelake/gcc-12.3.0/openmpi-4.1.6-vfg7lekutaiginlgvs57titvpvnjgys5' '--basedir=/lustre/shared/ucl/apps/spack/0.22/hk-initial-stack/spack/opt/spack/[padded-to-256-chars]/linux-rhel7-cascadelake/gcc-12.3.0/ucx-1.16.0-xrxjlowa7a3vqa3qt4n74ojkd4dz5ybh' 'smp' '--build-shared' '--with-production'

Going to add -v for verbose make and not do -j6.

'./build' 'LIBS' 'ucx-linux-x86_64' 'gcc' 'gfortran' '--destination=/home/ccspapp/Scratch/charmpp/charm-8.0.0_install' 'ompipmix' '--basedir=/lustre/shared/ucl/apps/spack/0.22/hk-initial-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/linux-rhel7-cascadelake/gcc-12.3.0/openmpi-4.1.6-vfg7lekutaiginlgvs57titvpvnjgys5/' '--basedir=/lustre/shared/ucl/apps/spack/0.22/hk-initial-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/linux-rhel7-cascadelake/gcc-12.3.0/ucx-1.16.0-xrxjlowa7a3vqa3qt4n74ojkd4dz5ybh' 'smp' '--build-shared' '--with-production' -v

@heatherkellyucl
Copy link
Collaborator

src/libs/ck-libs/ampi/CMakeFiles/moduleampi.dir/build.make:547 is the cd in

src/libs/ck-libs/ampi/CMakeFiles/moduleampi.dir/depend:
        cd /home/ccspapp/Scratch/charmpp/charm-8.0.0_install && $(CMAKE_COMMAND) -E cmake_depends "Unix Makefiles" /home/ccspapp/Scratch/charmpp/charm-8.0.0 /home/ccspapp/Scratch/charmpp/charm-8.0.0/src/libs/ck-libs/ampi /home/ccspapp/Scratch/charmpp/charm-8.0.0_install /home/ccspapp/Scratch/charmpp/charm-8.0.0_install/src/libs/ck-libs/ampi /home/ccspapp/Scratch/charmpp/charm-8.0.0_install/src/libs/ck-libs/ampi/CMakeFiles/moduleampi.dir/DependInfo.cmake "--color=$(COLOR)"
.PHONY : src/libs/ck-libs/ampi/CMakeFiles/moduleampi.dir/depend

@heatherkellyucl
Copy link
Collaborator

heatherkellyucl commented Nov 1, 2024

Testing the build outside Spack but using Spack's modules, you need to add in a --basedir entry for pmix or it fails at 9% because it can't find pmix.h.

'./build' 'LIBS' 'ucx-linux-x86_64' 'gcc' 'gfortran' '-j6' '--destination=/home/ccspapp/Scratch/charmpp/charm-8.0.0_install' 'ompipmix' '--basedir=/lustre/shared/ucl/apps/spack/0.22/hk-initial-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/linux-rhel7-cascadelake/gcc-12.3.0/openmpi-4.1.6-vfg7lekutaiginlgvs57titvpvnjgys5/' '--basedir=/lustre/shared/ucl/apps/spack/0.22/hk-initial-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/linux-rhel7-cascadelake/gcc-12.3.0/ucx-1.16.0-xrxjlowa7a3vqa3qt4n74ojkd4dz5ybh' --basedir=/lustre/shared/ucl/apps/spack/0.22/hk-initial-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/linux-rhel7-cascadelake/gcc-12.3.0/pmix-5.0.1-w5bqx7e24eqivi55mkp7fchr45sjt6dv/ 'smp' '--build-shared' '--with-production' -v

(Apparently I left in the -j6 that time, but did include -v).

@heatherkellyucl
Copy link
Collaborator

That build succeeded...

@heatherkellyucl
Copy link
Collaborator

heatherkellyucl commented Nov 1, 2024

The part that failed before is:

[ 95%] Linking CXX static library ../../../../lib/libmoduleampi.a
cd /home/ccspapp/Scratch/charmpp/charm-8.0.0_install/src/libs/ck-libs/ampi && /lustre/shared/ucl/apps/spack/0.
22/hk-initial-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeho
lder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placehold
er__/linux-rhel7-cascadelake/gcc-12.3.0/cmake-3.27.9-iluq3vuls24uvvls4eemtkhsrk3affln/bin/cmake -P CMakeFiles/
moduleampi.dir/cmake_clean_target.cmake
cd /home/ccspapp/Scratch/charmpp/charm-8.0.0_install/src/libs/ck-libs/ampi && /lustre/shared/ucl/apps/spack/0.
22/hk-initial-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeho
lder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placehold
er__/linux-rhel7-cascadelake/gcc-12.3.0/cmake-3.27.9-iluq3vuls24uvvls4eemtkhsrk3affln/bin/cmake -E cmake_link_
script CMakeFiles/moduleampi.dir/link.txt --verbose=1
/home/ccspapp/Scratch/charmpp/charm-8.0.0_install/bin/charmc -build-shared CMakeFiles/moduleampi.dir/ampi.C.o 
CMakeFiles/moduleampi.dir/ampiMisc.C.o CMakeFiles/moduleampi.dir/ampiOneSided.C.o CMakeFiles/moduleampi.dir/am
pif.C.o CMakeFiles/moduleampi.dir/ddt.C.o "CMakeFiles/moduleampi.dir/mpich-alltoall.C.o" CMakeFiles/moduleampi
.dir/ampi_mpix.C.o CMakeFiles/moduleampi.dir/ampi_noimpl.C.o "romio-prefix/src/romio/adio/ad_nfs/ad_nfs.o" "ro
mio-prefix/src/romio/adio/ad_nfs/ad_nfs_done.o" "romio-prefix/src/romio/adio/ad_nfs/ad_nfs_fcntl.o" "romio-pre
fix/src/romio/adio/ad_nfs/ad_nfs_features.o" "romio-prefix/src/romio/adio/ad_nfs/ad_nfs_getsh.o" "romio-prefix
/src/romio/adio/ad_nfs/ad_nfs_iread.o" "romio-prefix/src/romio/adio/ad_nfs/ad_nfs_iwrite.o" "romio-prefix/src/
romio/adio/ad_nfs/ad_nfs_open.o" "romio-prefix/src/romio/adio/ad_nfs/ad_nfs_read.o" "romio-prefix/src/romio/adio/ad_nfs/ad_nfs_resize.o" "romio-prefix/src/romio/adio/ad_nfs/ad_nfs_setsh.o" "romio-prefix/src/romio/adio/ad_nfs/ad_nfs_wait.o" "romio-prefix/src/romio/adio/ad_nfs/ad_nfs_write.o" "romio-prefix/src/romio/adio/ad_testfs/ad_testfs.o" "romio-prefix/src/romio/adio/ad_testfs/ad_testfs_close.o" "romio-prefix/src/romio/adio/ad_testfs/ad_testfs_delete.o" "romio-prefix/src/romio/adio/ad_testfs/ad_testfs_done.o" "romio-prefix/src/romio/adio/ad_testfs/ad_testfs_fcntl.o" "romio-prefix/src/romio/adio/ad_testfs/ad_testfs_flush.o"
[huge list of object files continues] "romio-prefix/src/romio/mpi-io/write_sh.o" -o ../../../../lib/libmoduleampi.a

Once it all finishes, there is a tmp -> /home/ccspapp/Scratch/charmpp/charm-8.0.0_install/include symlink left in the install location, where tmp was its build location, but bin, lib etc are not symlinks.

@heatherkellyucl
Copy link
Collaborator

Fails same way with builtin.charmpp

==> Concretized [email protected]%[email protected] backend=ucx pmi=pmix
 -   pk5hjxq  [email protected]%[email protected]~cuda~omp~papi+production~pthreads+shared+smp~syncft~tcp~tracing backend
=ucx build-target=LIBS build_system=generic pmi=pmix arch=linux-rhel7-cascadelake
==> Error: ProcessError: Command exited with status 2:
    './build' 'LIBS' 'ucx-linux-x86_64' 'gcc' 'gfortran' '-j6' '--destination=/lustre/shared/ucl/apps/spack/0.
22/hk-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/_
_spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__s
pack/linux-rhel7-cascadelake/gcc-12.3.0/charmpp-8.0.0-pk5hjxqntzc6uftgncpjafejw3ewwhyr' 'ompipmix' '--basedir=
/lustre/shared/ucl/apps/spack/0.22/hk-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholde
r__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder_
_/__spack_path_placeholder__/__spack/linux-rhel7-cascadelake/gcc-12.3.0/openmpi-4.1.6-vfg7lekutaiginlgvs57titv
pvnjgys5' '--basedir=/lustre/shared/ucl/apps/spack/0.22/hk-stack/spack/opt/spack/__spack_path_placeholder__/__
spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__sp
ack_path_placeholder__/__spack_path_placeholder__/__spack/linux-rhel7-cascadelake/gcc-12.3.0/ucx-1.16.0-xrxjlo
wa7a3vqa3qt4n74ojkd4dz5ybh' 'smp' '--build-shared' '--with-production'

7 errors found in build log:
     1463    [ 95%] Building CXX object src/libs/ck-libs/ampi/CMakeFiles/moduleampif.dir/ampif.C.o
     1464    [ 95%] Building CXX object src/libs/ck-libs/ampi/CMakeFiles/moduleampif.dir/ddt.C.o
     1465    [ 95%] Building CXX object src/libs/ck-libs/ampi/CMakeFiles/moduleampif.dir/mpich-alltoall.C.o
     1466    [ 95%] Building CXX object src/libs/ck-libs/ampi/CMakeFiles/moduleampif.dir/ampi_mpix.C.o
     1467    [ 95%] Building CXX object src/libs/ck-libs/ampi/CMakeFiles/moduleampif.dir/ampi_noimpl.C.o
     1468    [ 95%] Linking CXX static library ../../../../lib/libmoduleampi.a
  >> 1469    Fatal Error by charmc in directory /lustre/shared/ucl/apps/spack/0.22/hk-stack/spack/opt/spack/_
             _spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_pla
             ceholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__sp
             ack/linux-rhel7-cascadelake/gcc-12.3.0/charmpp-8.0.0-pk5hjxqntzc6uftgncpjafejw3ewwhyr/src/libs/c
             k-libs/ampi
     1470       Trying to link, but no object files or library archives were specified
     1471    charmc exiting...

Confirmed which version was used spack -e base spec -N:

Input spec
--------------------------------
 -   [email protected]%[email protected] backend=ucx pmi=pmix

Concretized
--------------------------------
 -   [email protected]%[email protected]~cuda~omp~papi+production~pthreads+shared+smp~syncft~tcp~tracing backend=
ucx build-target=LIBS build_system=generic pmi=pmix arch=linux-rhel7-cascadelake
[+]      ^[email protected]%[email protected]~doc+ncurses+ownlibs build_system=generic build_type=Release arch=lin
ux-rhel7-cascadelake
...

Input spec
--------------------------------
 -   [email protected]%[email protected]
 -       ^.charmpp backend=ucx pmi=pmix

Concretized
--------------------------------
 -   [email protected]%[email protected]~avxtiles~cuda~memopt~rocm~single_node_gpu build_system=makefile fftw=3 in
terface=tcl arch=linux-rhel7-cascadelake
 -       ^[email protected]%[email protected]~cuda~omp~papi+production~pthreads+shared+smp~syncft~tcp~tracing bac
kend=ucx build-target=LIBS build_system=generic pmi=pmix arch=linux-rhel7-cascadelake
...

@heatherkellyucl
Copy link
Collaborator

heatherkellyucl commented Nov 8, 2024

Need to go back and look at cmake -E cmake_link_script CMakeFiles/moduleampi.dir/link.txt --verbose=0 (which helpfully unverboses itself) and see what cmake_link_script is meant to be.

@heatherkellyucl
Copy link
Collaborator

The actual error we are getting comes from line 2046 of charmc:

if [[ -z "$OBJECT" || -n "$SKIPLINK" ]]
then
        [[ ${#PASSTHROUGH_COMPILER_OPTIONS[@]} -ne 0 ]] && $CHARM_CXX "${PASSTHROUGH_COMPILER_OPTIONS[@]}"
# We have no target object, or are playing preprocessor tricks-- just end
        Debugf "No target object-- finished"
        Success
fi

Debug "About to link..."

if [[ "$INPUT_GIVEN" != '1' ]]
then
    Abort "Trying to link, but no object files or library archives were specified"
fi

Above that, there's a MakeSO() function and up at 1967 there is this comment:

##############################################################################
#
#                        POSSIBLY, SKIP LINK-STEP
#
# 1. No $OBJECT may be specified at all --- its just a compilation.
# 2. If $OBJECT is a ".a" file, a library is created from ${OBJECTFILES[@]}.
# 3. If $OBJECT is a ".o" file, then an "LDRO" is created from ${OBJECTFILES[@]}.
# 4. Language may be sequential.  Do a quick and easy linkage.
#
#               in any of these cases, the full link step is skipped.
#
##############################################################################

That's what is supposed to be happening here.

@heatherkellyucl
Copy link
Collaborator

$INPUT_GIVEN" is set to "" at the top of the script.
then in processArgs()

        "-module"|"-modules")
                local mod=($(echo "$1" | sed -e 's/,/ /g'))
                for module in "${mod[@]}"; do
                        module="$(filterLegacyLB "$module" "0")"
                        AddModules "$module"
                done
                INPUT_GIVEN="1"
                shift
                ;;

        -l)
                [[ -n "$POST_LANGUAGE" ]] && POST_LIBRARIES+=("$arg" "$1") || PRE_LIBRARIES+=("$arg" "$1")
                shift
                INPUT_GIVEN='1'
                ;;
        -l*|*.a|*.so|*.so.*|*.dylib|*.dylib.*)
                [[ -n "$POST_LANGUAGE" ]] && POST_LIBRARIES+=("$arg") || PRE_LIBRARIES+=("$arg")
                INPUT_GIVEN='1'
                ;;

        -clear-input)
                INPUT_GIVEN=''
                FILES=()
                PRE_LIBRARIES=()
                POST_LIBRARIES=()
                ;;

        *.*)
                [[ -n "$VERBOSE" ]] && echo "Adding file $arg..."
                FILES+=("$arg")
                INPUT_GIVEN="1"
                ;;

@heatherkellyucl
Copy link
Collaborator

I found what is happening when this fails, though I don't know why.

I made an environment just for the charmpp install to hopefully make it easier to clean up and I kept the install prefix:

spack env create --include-concrete base charmpp
# edit for our module projections
vim /lustre/shared/ucl/apps/spack/0.22/hk-stack/spack/var/spack/environments/charmpp/spack.yaml 
spack -e charmpp add [email protected] backend=ucx pmi=pmix
spack -e charmpp concretize -f
spack -e charmpp install --keep-prefix 

In these lines:

cd src/libs/ck-libs/ampi
cmake -P CMakeFiles/moduleampi.dir/cmake_clean_target.cmake
cmake -E cmake_link_script CMakeFiles/moduleampi.dir/link.txt --verbose=0

cmake_link_script is a builtin that does linking.

In the failing case, src/libs/ck-libs/ampi/CMakeFiles/moduleampi.dir/link.txt contains:

/lustre/shared/ucl/apps/spack/0.22/hk-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack/linux-rhel7-cascadelake/gcc-12.3.0/charmpp-8.0.0-3zgwzwfpvpt6ri32iirr2agelnfxix2w/bin/charmc -build-shared @CMakeFiles/moduleampi.dir/objects1.rsp -o ../../../../lib/libmoduleampi.a

where objects1.rsp is a one line, 8510 character file with all the .o files.

In the situations where the build works, link.txt contains the inserted .o files instead of @CMakeFiles/moduleampi.dir/objects1.rsp and that file is not there. (The resulting link.txt was an 8707 character single-line file in one of those).

@heatherkellyucl
Copy link
Collaborator

Ignoring namd 3.0.0 for a bit, adding cp2k.

@heatherkellyucl
Copy link
Collaborator

Hmm, that gave me a

 -   btot272 [email protected]%[email protected]~cosma~cuda~dlaf~elpa~enable_regtests~ipo+libint~libvori+libxc+mpi~mpi_f08+openmp~pexsi~plumed~pytorch+quip~rocm~sirius~spglib~spla build_system=cmake build_type=Release generator=make lmax=5 patches=37f4f1a,cf8e9cf smm=libxsmm arch=linux-rhel7-cascadelake

which in turn uses this openblas and fftw

 -   k5nvvel      ^[email protected]%[email protected]+mpi+openmp~pfft_patches+shared build_system=autotools patches=872cff
9 precision=double,float arch=linux-rhel7-cascadelake
 -   am4wyud      ^[email protected]%[email protected]~bignuma~consistent_fpcsr+dynamic_dispatch+fortran~ilp64+locking+
pic+shared build_system=makefile patches=d0b9276 symbol_suffix=none threads=openmp arch=linux-rhel7-cascadelak
e

and flips castep 24 to use them too, whereas castep 23.1 is unchanged.

[+]  x6rjjfw  [email protected]%[email protected]+dlmg+grimmed3+grimmed4~ipo+libxc+mpi+openmp build_system=cmake build_type
=Release generator=make patches=14256dd,7fecedd,a7860dc arch=linux-rhel7-cascadelake
[+]  xx7y6ye      ^[email protected]%[email protected]~doc+ncurses+ownlibs~qtgui build_system=generic build_type=Release p
atches=dbc3892 arch=linux-rhel7-cascadelake
[+]  rbeftq3      ^[email protected]%[email protected]+mpi~openmp~pfft_patches+shared build_system=autotools patches=872cff
9 precision=double,float arch=linux-rhel7-cascadelake
[+]  32pp2i6      ^[email protected]%[email protected]~bignuma~consistent_fpcsr+dynamic_dispatch+fortran~ilp64+locking+
pic+shared build_system=makefile patches=d0b9276 symbol_suffix=none threads=none arch=linux-rhel7-cascadelake
[+]  h3bp6r4      ^[email protected]%[email protected] build_system=autotools arch=linux-rhel7-cascadelake
[+]  l2c6k7a          ^[email protected]%[email protected]+pic build_system=makefile libs=shared,static arch=linux-rhel7-cas
cadelake
[+]  57rmvx7          ^[email protected]%[email protected] build_system=autotools arch=linux-rhel7-cascadelake
[+]  bco2kga          ^[email protected]%[email protected] build_system=makefile arch=linux-rhel7-cascadelake
 -   tdyavu7  [email protected]%[email protected]+dlmg+grimmed3+grimmed4~ipo+libxc+mpi+openmp build_system=cmake build_type
=Release generator=make patches=f08f6b4 arch=linux-rhel7-cascadelake
 -   k5nvvel      ^[email protected]%[email protected]+mpi+openmp~pfft_patches+shared build_system=autotools patches=872cff
9 precision=double,float arch=linux-rhel7-cascadelake
 -   am4wyud      ^[email protected]%[email protected]~bignuma~consistent_fpcsr+dynamic_dispatch+fortran~ilp64+locking+
pic+shared build_system=makefile patches=d0b9276 symbol_suffix=none threads=openmp arch=linux-rhel7-cascadelak
e

Need to check on whether that's sensible, because openblas from threads=none to threads=openmp can make thread numbers explode if the user is unaware.

@heatherkellyucl
Copy link
Collaborator

It doesn't say in the CASTEP docs and I wasn't finding anything recent in the mailing list archives, but the makefiles do not mention any openmp related to the BLAS libraries. For the gfortran builds, openmp comes in as an option for the FFTW libraries. For MKL it links -mkl=sequential. So I think we specify an openblas dependency with threads=none for CASTEP in Spack to avoid bad things happening unexpectedly if a job is run in an smp environment where OMP_NUM_THREADS is set.

If there's a use case for it, we can add a different one in future.

@heatherkellyucl
Copy link
Collaborator

Ok, now just CP2K depends on the fftw and openblas with openmp. I will go with that.

 -   btot272  [email protected]%[email protected]~cosma~cuda~dlaf~elpa~enable_regtests~ipo+libint~libvori+libxc+mpi~mpi_f08
+openmp~pexsi~plumed~pytorch+quip~rocm~sirius~spglib~spla build_system=cmake build_type=Release generator=make
 lmax=5 patches=37f4f1a,cf8e9cf smm=libxsmm arch=linux-rhel7-cascadelake
 -   2soqxxo      ^[email protected]%[email protected]~cuda~cuda_arch_35_k20x~examples~g2g~ipo+mpi~mpi_f08~opencl+openmp~ro
cm+shared build_system=cmake build_type=Release generator=ninja smm=libxsmm arch=linux-rhel7-cascadelake
 -   k5nvvel      ^[email protected]%[email protected]+mpi+openmp~pfft_patches+shared build_system=autotools patches=872cff
9 precision=double,float arch=linux-rhel7-cascadelake
 -   c4oigne      ^[email protected]%[email protected]~debug~fma+fortran build_system=autotools tune=cp2k-lmax-5 arch=linu
x-rhel7-cascadelake
 -   nxco4r5          ^[email protected]%[email protected]+atomic~charconv+chrono~clanglibcpp~cobalt~container~context~con
tract~coroutine+date_time~debug+exception~fiber+filesystem+graph~graph_parallel+icu+iostreams~json+locale+log+
math~mpi+multithreaded~nowide~numpy~pic+program_options~python+random+regex+serialization+shared+signals~singl
ethreaded~stacktrace+system~taggedlayout+test+thread+timer~type_erasure~url~versionedlayout+wave build_system=
generic cxxstd=11 patches=a440f96,b8569d7 visibility=hidden arch=linux-rhel7-cascadelake
 -   l266s7u              ^[email protected]%[email protected] build_system=autotools cxxstd=11 arch=linux-rhel7-cascadelake
[+]  qp6b37w          ^[email protected]%[email protected]+cxx build_system=autotools libs=shared,static patches=69ad2e2 arch
=linux-rhel7-cascadelake
 -   uu4e5xx      ^[email protected]%[email protected]~cuda~kxc~lxc+shared build_system=autotools arch=linux-rhel7-cascadel
ake
 -   vfjuwve      ^[email protected]%[email protected]~debug~generator~header-only~large_jit_buffer~shared blas=default build_system=makefile arch=linux-rhel7-cascadelake
[+]  nuo2sl5          ^[email protected]%[email protected]+gas~gold~gprofng~headers~interwork+ld~libiberty~lto~nls~pgo+plugins build_system=autotools compress_debug_sections=zlib libs=shared,static arch=linux-rhel7-cascadelake
 -   rrczsij      ^[email protected]%[email protected]~ipo~pic+shared build_system=cmake build_type=Release generator=make patches=072b006,1c9ce5f,244a9aa arch=linux-rhel7-cascadelake
 -   am4wyud      ^[email protected]%[email protected]~bignuma~consistent_fpcsr+dynamic_dispatch+fortran~ilp64+locking+pic+shared build_system=makefile patches=d0b9276 symbol_suffix=none threads=openmp arch=linux-rhel7-cascadelake
[+]  k6f6iwn      ^[email protected]%[email protected] build_system=autotools arch=linux-rhel7-cascadelake
 -   khhyqya      ^[email protected]%[email protected] build_system=python_pip arch=linux-rhel7-cascadelake 

@heatherkellyucl
Copy link
Collaborator

Likely going to need an omp module-naming rule for only those packages, by name (since we don't need to specify if we only have one install and it is on).

@heatherkellyucl
Copy link
Collaborator

heatherkellyucl commented Nov 29, 2024

Testing

  modules:
    default:
      tcl:
        projections:
          all:  '{name}/{version}/{compiler.name}-{compiler.version}'
          ^mpi: '{name}/{version}-{^mpi.name}/{compiler.name}-{compiler.version}'
          ^cuda: '{name}/{version}-cuda/{compiler.name}-{compiler.version}'
          ^cuda ^mpi: '{name}/{version}-{^mpi.name}-cuda/{compiler.name}-{compiler.version}'

          # Named packages where we have more than one installed so need different module names. 
          # Add omp for openmp variants.
          fftw +mpi +openmp: '{name}/{version}-{^mpi.name}-omp/{compiler.name}-{compiler.version}'
          openblas threads=openmp: '{name}/{version}-omp/{compiler.name}-{compiler.version}'

@heatherkellyucl
Copy link
Collaborator

heatherkellyucl commented Nov 29, 2024

Can't get the modules to regenerate without clashes.

spack -e base module tcl refresh
==> You are about to regenerate tcl module files for:
<list>

==> Do you want to proceed? [y/n] y
==> Error: Name clashes detected in module files:

file: /lustre/shared/ucl/apps/spack/0.23/hk-stack/modules/lustre/shared/ucl/apps/spack/0.23/hk-stack/spack/var/spack/environments/base/linux-rhel7-cascadelake/fftw/3.3.10-openmpi/gcc-12.3.0
spec: fftw@=3.3.10%gcc@=12.3.0/rbeftq3 +mpi~openmp~pfft_patches+shared build_system=autotools patches=872cff9 precision=double,float arch=linux-rhel7-cascadelake
spec: fftw@=3.3.10%gcc@=12.3.0/k5nvvel +mpi+openmp~pfft_patches+shared build_system=autotools patches=872cff9 precision=double,float arch=linux-rhel7-cascadelake

==> Error: Operation aborted

I tried with fftw +mpi +openmp: and fftw ^mpi ^openmp: and the first all in quotes, and with adding the fftw with just mpi rule above or below so it had both, having this section above the more general cases and none have worked.

@heatherkellyucl
Copy link
Collaborator

The openblas ones are fine (and I can just regenerate for specific packages too):

spack -e base module tcl refresh openblas
==> You are about to regenerate tcl module files for:

-- linux-rhel7-cascadelake / [email protected] -------------------------
32pp2i6 [email protected]  am4wyud [email protected]

==> Do you want to proceed? [y/n] y
==> Regenerating tcl module files
ls /shared/ucl/apps/spack/0.23/hk-stack/modules/lustre/shared/ucl/apps/spack/0.23/hk-stack/spack/var/spack/environments/base/linux-rhel7-cascadelake/openblas/0.3.28
0.3.28/     0.3.28-omp/

@heatherkellyucl
Copy link
Collaborator

heatherkellyucl commented Nov 29, 2024

fftw +openmp +mpi: '{name}/{version}-{^mpi.name}-omp/{compiler.name}-{compiler.version}'

or

fftw +openmp ^mpi: '{name}/{version}-{^mpi.name}-omp/{compiler.name}-{compiler.version}'

needs to be above the ^mpi entry. I'd tried putting it above already, but I assume it was with ^openmp instead.

So generally we want the more specific ones together at the top.

@heatherkellyucl
Copy link
Collaborator

[email protected] +quip failed with error where it can't find quip:

  >> 74    CMake Error at cmake/modules/FindQuip.cmake:14 (cp2k_set_default_paths):
     75      cp2k_set_default_paths Function invoked with incorrect arguments for
     76      function named: cp2k_set_default_paths
     77    Call Stack (most recent call first):
     78      CMakeLists.txt:691 (find_package)
     79
     80
     81    -- Checking for one of the modules 'quip;Quip'
  >> 82    CMake Error at /lustre/shared/ucl/apps/spack/0.23/hk-stack/spack/opt/spack/__spack_path_placeholde
           r__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_
           placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack/linux-rhel7-cascadelak
           e/gcc-12.3.0/cmake-3.30.5-xx7y6ye3pocuicgx6x4mfieefzuqoluh/share/cmake-3.30/Modules/FindPackageHan
           dleStandardArgs.cmake:233 (message):
     83      Could NOT find Quip (missing: CP2K_LIBQUIP_INCLUDE_DIRS
     84      CP2K_QUIP_LINK_LIBRARIES)
     85    Call Stack (most recent call first):
     86      /lustre/shared/ucl/apps/spack/0.23/hk-stack/spack/opt/spack/__spack_path_placeholder__/__spack_p
           ath_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__
           /__spack_path_placeholder__/__spack_path_placeholder__/__spack/linux-rhel7-cascadelake/gcc-12.3.0/
           cmake-3.30.5-xx7y6ye3pocuicgx6x4mfieefzuqoluh/share/cmake-3.30/Modules/FindPackageHandleStandardAr
           gs.cmake:603 (_FPHSA_FAILURE_MESSAGE)
     87      cmake/modules/FindQuip.cmake:22 (find_package_handle_standard_args)
     88      CMakeLists.txt:691 (find_package)

See build log for details:
  /lustre/shared/ucl/apps/spack/0.23/hk-stack/build_stage/ccspapp/spack-stage-cp2k-2024.3-btot272tnmfwy6kariznvh6cchjuw4ba/spack-build-out.txt

Support for QUIP is being deprecated in CP2K (cp2k/cp2k#3600 and cp2k/cp2k#3424), leave it out. Our older builds have it so someone asked for it in the past which is why I included it.

@heatherkellyucl
Copy link
Collaborator

Added ORCA binaries to source mirrors. Note for 6.0.1 there is a separate avx2-6.0.1 binary. So orca-5.0.4 is in base, whereas a version of 6.0.1 will either be in <system>.yaml or avx2.yaml.

@heatherkellyucl
Copy link
Collaborator

heatherkellyucl commented Dec 2, 2024

Hmm, orca 5.0.4 depends on openmpi 4.1.2 (4.1.1 but Spack alters that to 4.1.2 to avoid pmix issues). This means I have to tell everything else to either prefer or require openmpi 4.1.6 - which needs to be either in a packages.yaml or packages section of spack.yaml to avoid having to specify per package.

https://spack.readthedocs.io/en/latest/packages_yaml.html#package-requirements
https://spack.readthedocs.io/en/latest/packages_yaml.html#package-preferences

I think preferences like this might do, so it prefers them in this order:

packages:
  openmpi:
    version: [4.1.6, 4.1.2]

For right now I'm testing in my base env's spack.yaml - at the end this should possibly come out into packages.yaml and the modules out into modules.yaml. Maybe. It would prevent duplication across several environments, but require you to look at more files to see the whole specification.

@heatherkellyucl
Copy link
Collaborator

No, then it makes castep 23.1 use openmpi 4.1.2 instead... And gromacs 2023.5.

@heatherkellyucl
Copy link
Collaborator

heatherkellyucl commented Dec 2, 2024

I think what I actually want here is an ompi412 environment that include_concrete: base and does not affect the concretisation of anything in base.

@heatherkellyucl
Copy link
Collaborator

^ This is all ok.

With the exception of namd 3.0 which I will leave out until later, all the cpu software is sorted, now looking at the gpu parts.

(This should mean that Kathleen's initial stack is fully defined).

@heatherkellyucl
Copy link
Collaborator

GPU builds

spack env create gpu_first /home/ccspapp/Scratch/spack/0.23/hpc-spack/spacksites/spack-env-templates/dev1/build/gpu_first.yaml 
==> Error: Unable to find env at ${SPACK_ROOT}/var/spack/environments/base

echo $SPACK_ROOT
/shared/ucl/apps/spack/0.23/hk-stack/spack

Yeah, doesn't like the environment variable like Owain found, I was sure this worked at some point previously.

  include_concrete:
  - ${SPACK_ROOT}/var/spack/environments/base

If $SPACK_ROOT is expanded to actual value it is ok, but then we need to update the 0.23 each time the major version of Spack changes.

@heatherkellyucl
Copy link
Collaborator

heatherkellyucl commented Dec 3, 2024

Using the expanded value, my gpu_first.yaml concretises with these new versions that we didn't explicitly ask for:

 -   2ppcwo4      ^[email protected]%[email protected]+mpi~openmp~pfft_patches+shared build_system=autotools patches=872cff9 precision=double,float arch=linux-rhel7-cascadelake
 -   c4dszdi      ^[email protected]%[email protected]~cairo+cuda~gl~libudev+libxml2~nvml~oneapi-level-zero~opencl+pci~rocm build_system=autotools cuda_arch=none libs=shared,static arch=linux-rhel7-cascadelake
 -   m5sfsjd      ^[email protected]%[email protected]+gsl+mpi+shared arrayfire=none build_system=autotools optional_modules=all arch=linux-rhel7-cascadelake
 -   jz7y55b      ^[email protected]%[email protected]~munge~python~restful build_system=autotools arch=linux-rhel7-cascadelake

Checking with spack -e gpu_first find -cd fftw for example (or -cvd to include all variants for everything):

fftw depends on the new openmpi, hwloc is now +cuda, plumed depends on the new openmpi, pmix depends on the new hwloc. That's all fine but fftw, plumed and pmix are going to have naming clashes. (I think - not sure how far the ^mpi ^cuda goes up the stack for module naming because it is openmpi that depends on those not those directly).

Anyway, now building so I will find out.

Module naming was fine using the current rules. plumed/2.9.2-openmpi-cuda, fftw/3.3.10-openmpi-cuda, pmix/5.0.3-cuda.

@heatherkellyucl
Copy link
Collaborator

[email protected] +cuda requires cuda 11 not 12 because it uses deprecated texture functions: https://forums.developer.nvidia.com/t/cudabindtexture2d-other-tex-functions-marked-deprecated-in-toolkit-11/182481

  >> 455    src/ComputeNonbondedCUDAKernel.cu(12): error: texture is not a template
     456      texture<unsigned int, 1, cudaReadModeElementType> tex_exclusions;
     457      ^
     458
  >> 459    src/ComputeNonbondedCUDAKernel.cu(44): error: identifier "cudaBindTexture" is undefined
     460        cudaBindTexture(
     461        ^

That's... inconvenient.

Oh, but namd 3.0.1 is released too though I don't think it'll help with the charm++ issue: https://www.ks.uiuc.edu/Research/namd/3.0.1/announce.html

@heatherkellyucl
Copy link
Collaborator

Ignoring all the namds, uncommented py-alphafold from gpu_first to try a build.

@heatherkellyucl
Copy link
Collaborator

heatherkellyucl commented Dec 11, 2024

No, py-tensorflow runs into tensorflow/tensorflow#62497 for lack of a /usr/bin/python3 on build01, though we do have one on the Myriad login nodes now. (Bazel resets path so can't find Spack's python3).

ETA: It was added to build01, trying again.

@heatherkellyucl
Copy link
Collaborator

Tensorflow ok, now Aria2 issue:

==> Installing aria2-1.37.0-bzeug47k5p62x6wql4oetcwiyjvopdfx [89/216]
==> No binary for aria2-1.37.0-bzeug47k5p62x6wql4oetcwiyjvopdfx found: installing from source
==> Using cached archive: /lustre/shared/ucl/apps/spack/0.23/hk-stack/spack/var/spack/cache/_source-cache/arch
ive/8e/8e7021c6d5e8f8240c9cc19482e0c8589540836747744724d86bf8af5a21f0e8.tar.gz
==> No patches needed for aria2
==> aria2: Executing phase: 'autoreconf'
==> aria2: Executing phase: 'configure'
==> aria2: Executing phase: 'build'
==> Error: ProcessError: Command exited with status 2:
    '/lustre/shared/ucl/apps/spack/0.23/hk-stack/spack/opt/spack/__spack_path_placeholder__/__spack_path_place
holder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeholder__/__spack_path_placeho
lder__/__spack_path_placeholder__/__spack/linux-rhel7-cascadelake/gcc-11.2.1/gmake-4.4.1-mdbzk23bg5ywzqeapoyio
kykdtdj2gl3/bin/make' '-j6' 'V=1'

     1285    In file included from SimpleRandomizer.cc:49:
  >> 1286    /usr/include/gnutls/crypto.h:35:24: error: 'gnutls_cipher_algorithm_t' has not been declared
     1287       35 |                        gnutls_cipher_algorithm_t cipher,
     1288          |                        ^~~~~~~~~~~~~~~~~~~~~~~~~
  >> 1289    /usr/include/gnutls/crypto.h:36:30: error: 'gnutls_datum_t' does not name a type
     1290       36 |                        const gnutls_datum_t * key,
     1291          |                              ^~~~~~~~~~~~~~
  >> 1292    /usr/include/gnutls/crypto.h:37:30: error: 'gnutls_datum_t' does not name a type
     1293       37 |                        const gnutls_datum_t * iv);
     1294          |                              ^~~~~~~~~~~~~~
  >> 1295    /usr/include/gnutls/crypto.h:59:34: error: 'gnutls_cipher_algorithm_t' was not declared in this 
             scope; did you mean 'gnutls_cipher_hd_t'?
...
  >> 1358    /usr/include/gnutls/crypto.h:87:68: error: expression list treated as compound expression in ini
             tializer [-fpermissive]
     1359       87 |                      const void *text, size_t textlen, void *digest);
     1360          |                                                                    ^
...
     1368    make[1]: Leaving directory '/lustre/shared/ucl/apps/spack/0.23/hk-stack/build_stage/ccspapp/spac
             k-stage-aria2-1.37.0-bzeug47k5p62x6wql4oetcwiyjvopdfx/spack-src'
  >> 1369    make: *** [Makefile:469: all] Error 2

See build log for details:
  /lustre/shared/ucl/apps/spack/0.23/hk-stack/build_stage/ccspapp/spack-stage-aria2-1.37.0-bzeug47k5p62x6wql4oetcwiyjvopdfx/spack-build-out.txt

==> Warning: Skipping build of py-alphafold-2.2.4-c7glokekqjlc5rj6prswoejwlyhkhqq7 since aria2-1.37.0-bzeug47k5p62x6wql4oetcwiyjvopdfx failed

@heatherkellyucl
Copy link
Collaborator

GnuTLS has precedence over OpenSSL if both libraries are installed. If you prefer OpenSSL, run configure with --without-gnutls --with-openssl

My best guess is it was using OpenSSL before. Recipe doesn't currently have any variants.

@heatherkellyucl
Copy link
Collaborator

Aria2 package now has variants and lists gnutls and openssl as conditional dependencies: https://github.com/UCL-ARC/hpc-spack/blob/0.23/repos/dev/packages/aria2/package.py

py-alphafold now built.

@heatherkellyucl
Copy link
Collaborator

heatherkellyucl commented Dec 13, 2024

Got some module clashes to sort out in gpu_first:

spack -e gpu_first module tcl refresh -y
file: /lustre/shared/ucl/apps/spack/0.23/hk-stack/modules/lustre/shared/ucl/apps/spack/0.23/hk-stack/spack/var/spack/environments/gpu_first/linux-rhel7-cascadelake/fftw/3.3.10-openmpi-cuda/gcc-12.3.0
spec: fftw@=3.3.10%gcc@=12.3.0/rbeftq3 +mpi~openmp~pfft_patches+shared build_system=autotools patches=872cff9 precision=double,float arch=linux-rhel7-cascadelake
spec: fftw@=3.3.10%gcc@=12.3.0/2ppcwo4 +mpi~openmp~pfft_patches+shared build_system=autotools patches=872cff9 precision=double,float arch=linux-rhel7-cascadelake

file: /lustre/shared/ucl/apps/spack/0.23/hk-stack/modules/lustre/shared/ucl/apps/spack/0.23/hk-stack/spack/var/spack/environments/gpu_first/linux-rhel7-cascadelake/git/2.46.2/gcc-12.3.0
spec: git@=2.46.2%gcc@=12.3.0/pyo35o5 +man+nls+perl+subtree~svn~tcltk build_system=autotools arch=linux-rhel7-cascadelake
spec: git@=2.46.2%gcc@=12.3.0/7a7ywuq +man+nls+perl+subtree~svn~tcltk build_system=autotools arch=linux-rhel7-cascadelake

file: /lustre/shared/ucl/apps/spack/0.23/hk-stack/modules/lustre/shared/ucl/apps/spack/0.23/hk-stack/spack/var/spack/environments/gpu_first/linux-rhel7-cascadelake/plumed/2.9.2-openmpi-cuda/gcc-12.3.0
spec: plumed@=2.9.2%gcc@=12.3.0/m5sfsjd +gsl+mpi+shared arrayfire=none build_system=autotools optional_modules=all arch=linux-rhel7-cascadelake
spec: plumed@=2.9.2%gcc@=12.3.0/zvy6qn5 +gsl+mpi+shared arrayfire=none build_system=autotools optional_modules=all arch=linux-rhel7-cascadelake

file: /lustre/shared/ucl/apps/spack/0.23/hk-stack/modules/lustre/shared/ucl/apps/spack/0.23/hk-stack/spack/var/spack/environments/gpu_first/linux-rhel7-cascadelake/py-setuptools-scm/8.0.4/gcc-12.3.0
spec: py-setuptools-scm@=8.0.4%gcc@=12.3.0/ipjgm3i +toml build_system=python_pip arch=linux-rhel7-cascadelake
spec: py-setuptools-scm@=8.0.4%gcc@=12.3.0/thle7no +toml build_system=python_pip arch=linux-rhel7-cascadelake

Thought I'd sorted out the fftw but appears not. rbeftq3 is the non-cuda stack fftw, so I don't know why that is in fftw/3.3.10-openmpi-cuda. If I look at spack -e gpu_first find -cvdl fftw/rbeftq3 it is all ~cuda things.

plumed/zvy6qn5 is also not-cuda.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants