Skip to content

Commit e36eaba

Browse files
updates to address comments
1 parent 3b47ef6 commit e36eaba

File tree

1 file changed

+30
-83
lines changed

1 file changed

+30
-83
lines changed

docs/software/sciapps/lammps.md

Lines changed: 30 additions & 83 deletions
Original file line numberDiff line numberDiff line change
@@ -45,21 +45,29 @@ uenv start --view kokkos lammps/2024:v2
4545
You can load the `kokkos` or `gpu` view from the uenv to make the `lmp` executable available.
4646
The executable in both these views support GPUs:
4747

48-
```bash
49-
#lammps +kokkos package
50-
uenv start --view kokkos lammps/2024:v2
51-
#lammps +gpu package, Kokkos disabled
52-
uenv start --view gpu lammps/2024:v2
53-
```
48+
=== "Kokkos"
49+
```bash
50+
#lammps +kokkos package
51+
uenv start --view kokkos lammps/2024:v2
52+
```
53+
=== "GPU"
54+
```bash
55+
#lammps +gpu package
56+
uenv start --view gpu lammps/2024:v2
57+
```
5458

5559
A development view is also provided, which contains all libraries and command-line tools necessary to build LAMMPS from source, without including the LAMMPS executable:
5660

57-
```bash
58-
# build environment for lammps +kokkos package, without providing lmp executable
59-
uenv start --view develop-kokkos lammps/2024:v2
60-
# build environment for lammps +gpu package, without providing lmp executable
61-
uenv start --view develop-gpu lammps/2024:v2
62-
```
61+
=== "Kokkos"
62+
```bash
63+
# build environment for lammps +kokkos package, without providing lmp executable
64+
uenv start --view develop-kokkos lammps/2024:v2
65+
```
66+
=== "GPU"
67+
```bash
68+
# build environment for lammps +gpu package, without providing lmp executable
69+
uenv start --view develop-gpu lammps/2024:v2
70+
```
6371

6472
### Running LAMMPS with Kokkos on the HPC Platform
6573

@@ -281,12 +289,16 @@ mkdir /dev/shm/lammps_build; cd /dev/shm/lammps_build
281289
After you've obtained a version of LAMMPS you'd like to build, extract it in the above temporary folder and create a build directory.
282290
Load one of the two following views:
283291

284-
```
285-
#build environment for lammps +kokkos package, without providing lmp executable
286-
uenv start --view develop-kokkos lammps/2024:v2-rc1
287-
#build environment for lammps +gpu package, without providing lmp executable
288-
uenv start --view develop-gpu lammps/2024:v2-rc1
289-
```
292+
=== "Kokkos"
293+
```bash
294+
#build environment for lammps +kokkos package, without providing lmp executable
295+
uenv start --view develop-kokkos lammps/2024:v2
296+
```
297+
=== "GPU"
298+
```bash
299+
#build environment for lammps +gpu package, without providing lmp executable
300+
uenv start --view develop-gpu lammps/2024:v2
301+
```
290302

291303
and now you can build your local copy of LAMMPS.
292304
For example to build with Kokkos and the `MOLECULE` package enabled:
@@ -320,71 +332,6 @@ For LAMMPS to work correctly on our system, you need a LAMMPS version which prov
320332

321333
If you'd like to extend the existing uenv with additional packages (or your own), you can use the LAMMPS uenv to provide all dependencies needed to build your customization. See [here](https://eth-cscs.github.io/alps-uenv/tutorial-spack) for more information.
322334

323-
<!--
324-
First, set up an environment:
325-
326-
```
327-
uenv start --view develop-gpu lammps/2024:v2
328-
329-
git clone -b v0.23.0 https://github.com/spack/spack.git
330-
source spack/share/spack/setup-env.sh
331-
export SPACK_SYSTEM_CONFIG_PATH=/user-environment/config/
332-
```
333-
334-
Then create the path and file `$SCRATCH/custom_env/spack.yaml`. We'll disable the KOKKOS package (and enable the GPU package via +cuda spec), and add the CG-SPICA package (via the +cg-spica spec) as an example. You can get the full list of options on [the LAMMPS spack package overview](https://packages.spack.io/package.html?name=lammps).
335-
336-
```
337-
spack:
338-
specs:
339-
- lammps@20240417 ~kokkos +cuda cuda_arch=90 +python +extra-dump +cuda_mps +cg-spica
340-
packages:
341-
all:
342-
prefer:
343-
- +cuda cuda_arch=90
344-
mpi:
345-
require: cray-mpich +cuda
346-
view: true
347-
concretizer:
348-
unify: true
349-
```
350-
351-
Then concretize and build (note, you will of course be using a different path):
352-
353-
```
354-
spack -e $SCRATCH/custom_env/ concretize -f
355-
spack -e $SCRATCH/custom_env/ install
356-
```
357-
358-
During concretization, you'll notice a hash being printed alongside the LAMMPS package name. Take note of this hash. If you now try to load LAMMPS:
359-
360-
```
361-
# naively try to load LAMMPS
362-
# it shows two versions installed (the one in the uenv, and the one we just built)
363-
spack load lammps
364-
==> Error: lammps matches multiple packages.
365-
Matching packages:
366-
rd2koe3 [email protected]%[email protected] arch=linux-sles15-neoverse_v2
367-
zoo2p63 [email protected]%[email protected] arch=linux-sles15-neoverse_v2
368-
Use a more specific spec (e.g., prepend '/' to the hash).
369-
# use the hash thats listed in the output of the build
370-
# and load using the hash
371-
spack load /zoo2p63
372-
# check the lmp executable:
373-
which lmp
374-
/capstor/scratch/cscs/browning/SD-61924/spack/opt/spack/linux-sles15-neoverse_v2/gcc-12.3.0/lammps-20240417-zoo2p63rzyuleogzn4a2h6yj7u3vhyy2/bin/lmp
375-
```
376-
377-
You should now see that the CG-SPICA package in the list of installed packages:
378-
379-
```
380-
> lmp -h
381-
...
382-
Installed packages:
383-
384-
CG-SPICA GPU KSPACE MANYBODY MOLECULE PYTHON RIGID
385-
```
386-
-->
387-
388335
[LAMMPS]: https://www.lammps.org
389336
[GNU Public License]: http://www.gnu.org/copyleft/gpl.html
390337
[uenv]: https://eth-cscs.github.io/cscs-docs/software/uenv

0 commit comments

Comments
 (0)