Skip to content

Commit 4a7e150

Browse files
committed
Update modules.
1 parent 36dc695 commit 4a7e150

205 files changed

Lines changed: 19412 additions & 0 deletions

File tree

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
Lines changed: 131 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,131 @@
1+
-- The MIT License (MIT)
2+
--
3+
-- Copyright (c) 2021 Purdue University
4+
-- Copyright (c) 2020 NVIDIA Corporation
5+
--
6+
-- Permission is hereby granted, free of charge, to any person obtaining a copy
7+
-- of this software and associated documentation files (the "Software"), to
8+
-- deal in the Software without restriction, including without limitation the
9+
-- rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10+
-- sell copies of the Software, and to permit persons to whom the Software is
11+
-- furnished to do so, subject to the following conditions:
12+
--
13+
-- The above copyright notice and this permission notice shall be included in
14+
-- all copies or substantial portions of the Software.
15+
--
16+
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21+
-- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22+
-- IN THE SOFTWARE.
23+
24+
help([==[
25+
26+
Description
27+
===========
28+
CP2K is a quantum chemistry and solid state physics software package that
29+
can perform atomistic simulations of solid state, liquid, molecular,
30+
periodic, material, crystal, and biological systems. CP2K provides a
31+
general framework for different modeling methods such as DFT using the
32+
mixed Gaussian and plane waves approaches GPW and GAPW. Supported theory
33+
levels include DFTB, LDA, GGA, MP2, RPA, semi-empirical methods (AM1, PM3,
34+
PM6, RM1, MNDO, ...), and classical force fields (AMBER, CHARMM, ...).
35+
CP2K can do simulations of molecular dynamics, metadynamics, Monte Carlo,
36+
Ehrenfest dynamics, vibrational analysis, core level spectroscopy, energy
37+
minimization, and transition state optimization using NEB or dimer method.
38+
CP2K is written in Fortran 2008 and can be run efficiently in parallel
39+
using a combination of multi-threading, MPI, and HIP/CUDA.
40+
41+
More information
42+
================
43+
- Home page: http://www.cp2k.org/
44+
- Docker: https://www.amd.com/en/technologies/infinity-hub/cp2k
45+
]==])
46+
47+
whatis("Name: CP2K")
48+
whatis("Version: 20210311--h87ec1599")
49+
whatis("Description: CP2K is a quantum chemistry and solid state physics software package that can perform atomistic simulations of solid state, liquid, molecular, periodic, material, crystal, and biological systems. CP2K provides a general framework for different modeling methods such as DFT using the mixed Gaussian and plane waves approaches GPW and GAPW. Supported theory levels include DFTB, LDA, GGA, MP2, RPA, semi-empirical methods (AM1, PM3, PM6, RM1, MNDO, ...), and classical force fields (AMBER, CHARMM, ...). CP2K can do simulations of molecular dynamics, metadynamics, Monte Carlo, Ehrenfest dynamics, vibrational analysis, core level spectroscopy, energy minimization, and transition state optimization using NEB or dimer method. CP2K is written in Fortran 2008 and can be run efficiently in parallel using a combination of multi-threading, MPI, and HIP/CUDA.")
50+
whatis("Home page: http://www.cp2k.org/")
51+
whatis("Docker: https://www.amd.com/en/technologies/infinity-hub/cp2k")
52+
53+
if not (os.getenv("ROCM_SINGULARITY_MODULE") == "none") then
54+
local singularity_module = os.getenv("ROCM_SINGULARITY_MODULE") or "Singularity"
55+
if not (isloaded(singularity_module)) then
56+
load(singularity_module)
57+
end
58+
end
59+
60+
conflict(myModuleName(), "openmpi")
61+
62+
local image = "amdih_cp2k:87ec1599.sif"
63+
local uri = "docker://amdih/cp2k:87ec1599"
64+
local programs = {"cp2k.psmp", "cp2k.popt", "cp2k_shell.psmp", "dumpdcd.psmp",
65+
"graph.psmp", "grid_miniapp.psmp", "xyz2dcd.psmp",
66+
"benchmark",
67+
"mpirun", "mpiexec", "ompi_info",
68+
}
69+
local entrypoint_args = ""
70+
71+
-- The absolute path to Singularity is needed so it can be invoked on remote
72+
-- nodes without the corresponding module necessarily being loaded.
73+
-- Trim off the trailing newline.
74+
local singularity = capture("which singularity | head -c -1")
75+
76+
if (os.getenv("ROCM_IMAGE_DIR")) then
77+
image = pathJoin(os.getenv("ROCM_IMAGE_DIR"), image)
78+
79+
if not (isFile(image)) then
80+
-- The image could not be found in the container directory
81+
if (mode() == "load") then
82+
LmodMessage("file not found: " .. image)
83+
LmodMessage("The container image will be pulled upon first use to the Singularity cache")
84+
end
85+
image = uri
86+
87+
-- Alternatively, this could pull the container image and
88+
-- save it in the container directory
89+
--if (mode() == "load") then
90+
-- subprocess(singularity .. " pull " .. image .. " " .. uri)
91+
--end
92+
end
93+
else
94+
-- Look for the image in the Singularity cache, and if not found
95+
-- download it when "singularity run" is invoked.
96+
image = uri
97+
end
98+
99+
-- Determine Nvidia and/or AMD GPUs (to pass coresponding flag to Singularity)
100+
local run_args = {}
101+
if (capture("nvidia-smi -L 2>/dev/null") ~= "") then
102+
if (mode() == "load") then
103+
LmodMessage("ROCM_CONTAINER: Enabling Nvidia GPU support in the container.")
104+
end
105+
table.insert(run_args, "--nv")
106+
end
107+
if (capture("/opt/rocm/bin/rocm-smi -i 2>/dev/null | grep ^GPU") ~= "") then
108+
if (mode() == "load") then
109+
LmodMessage("ROCM_CONTAINER: Enabling AMD GPU support in the container.")
110+
end
111+
table.insert(run_args, "--rocm")
112+
end
113+
114+
-- And assemble container command
115+
local container_launch = singularity .. " run " .. table.concat(run_args, " ") .. " " .. image .. " " .. entrypoint_args
116+
117+
-- Multinode support
118+
pushenv("OMPI_MCA_orte_launch_agent", container_launch .. " orted")
119+
120+
-- Programs to setup in the shell
121+
for i,program in pairs(programs) do
122+
set_shell_function(program, container_launch .. " " .. program .. " \"$@\"",
123+
container_launch .. " " .. program .. " $*")
124+
end
125+
126+
-- Additional commands or environment variables, if any
127+
-- Somehow CP2K's bin directory is not in container's default PATH.
128+
-- And neither is OpenMPI.
129+
prepend_path("SINGULARITYENV_PREPEND_PATH", "/opt/cp2k/bin")
130+
prepend_path("SINGULARITYENV_PREPEND_PATH", "/opt/cp2k/benchmark-scripts")
131+
prepend_path("SINGULARITYENV_PREPEND_PATH", "/opt/ompi/bin")
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
-- The MIT License (MIT)
2+
--
3+
-- Copyright (c) 2021 Purdue University
4+
-- Copyright (c) 2020 NVIDIA Corporation
5+
--
6+
-- Permission is hereby granted, free of charge, to any person obtaining a copy
7+
-- of this software and associated documentation files (the "Software"), to
8+
-- deal in the Software without restriction, including without limitation the
9+
-- rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
10+
-- sell copies of the Software, and to permit persons to whom the Software is
11+
-- furnished to do so, subject to the following conditions:
12+
--
13+
-- The above copyright notice and this permission notice shall be included in
14+
-- all copies or substantial portions of the Software.
15+
--
16+
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
17+
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
18+
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
19+
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
20+
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
21+
-- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
22+
-- IN THE SOFTWARE.
23+
24+
help([==[
25+
26+
Description
27+
===========
28+
CP2K is a quantum chemistry and solid state physics software package that
29+
can perform atomistic simulations of solid state, liquid, molecular,
30+
periodic, material, crystal, and biological systems. CP2K provides a
31+
general framework for different modeling methods such as DFT using the
32+
mixed Gaussian and plane waves approaches GPW and GAPW. Supported theory
33+
levels include DFTB, LDA, GGA, MP2, RPA, semi-empirical methods (AM1, PM3,
34+
PM6, RM1, MNDO, ...), and classical force fields (AMBER, CHARMM, ...).
35+
CP2K can do simulations of molecular dynamics, metadynamics, Monte Carlo,
36+
Ehrenfest dynamics, vibrational analysis, core level spectroscopy, energy
37+
minimization, and transition state optimization using NEB or dimer method.
38+
CP2K is written in Fortran 2008 and can be run efficiently in parallel
39+
using a combination of multi-threading, MPI, and HIP/CUDA.
40+
41+
More information
42+
================
43+
- Home page: http://www.cp2k.org/
44+
- Docker: https://www.amd.com/en/technologies/infinity-hub/cp2k
45+
]==])
46+
47+
whatis("Name: CP2K")
48+
whatis("Version: 2022.2")
49+
whatis("Description: CP2K is a quantum chemistry and solid state physics software package that can perform atomistic simulations of solid state, liquid, molecular, periodic, material, crystal, and biological systems. CP2K provides a general framework for different modeling methods such as DFT using the mixed Gaussian and plane waves approaches GPW and GAPW. Supported theory levels include DFTB, LDA, GGA, MP2, RPA, semi-empirical methods (AM1, PM3, PM6, RM1, MNDO, ...), and classical force fields (AMBER, CHARMM, ...). CP2K can do simulations of molecular dynamics, metadynamics, Monte Carlo, Ehrenfest dynamics, vibrational analysis, core level spectroscopy, energy minimization, and transition state optimization using NEB or dimer method. CP2K is written in Fortran 2008 and can be run efficiently in parallel using a combination of multi-threading, MPI, and HIP/CUDA.")
50+
whatis("Home page: http://www.cp2k.org/")
51+
whatis("Docker: https://www.amd.com/en/technologies/infinity-hub/cp2k")
52+
53+
if not (os.getenv("ROCM_SINGULARITY_MODULE") == "none") then
54+
local singularity_module = os.getenv("ROCM_SINGULARITY_MODULE") or "Singularity"
55+
if not (isloaded(singularity_module)) then
56+
load(singularity_module)
57+
end
58+
end
59+
60+
conflict(myModuleName(), "openmpi")
61+
62+
local image = "amdih_cp2k:2022.2.sif"
63+
local uri = "docker://amdih/cp2k:2022.2"
64+
local programs = {"cp2k.psmp", "cp2k.popt",
65+
"cp2k.psmp.dbcsr_gpu", "cp2k.psmp.no_dbcsr_gpu",
66+
"cp2k_shell.psmp", "dumpdcd.psmp",
67+
"graph.psmp", "grid_miniapp.psmp", "grid_unittest.psmp",
68+
"libcp2k_unittest.psmp", "memory_utilities_unittest.psmp",
69+
"parallel_rng_types_unittest.psmp", "xyz2dcd.psmp",
70+
"benchmark",
71+
"mpirun", "mpiexec", "ompi_info",
72+
}
73+
local entrypoint_args = ""
74+
75+
-- The absolute path to Singularity is needed so it can be invoked on remote
76+
-- nodes without the corresponding module necessarily being loaded.
77+
-- Trim off the trailing newline.
78+
local singularity = capture("which singularity | head -c -1")
79+
80+
if (os.getenv("ROCM_IMAGE_DIR")) then
81+
image = pathJoin(os.getenv("ROCM_IMAGE_DIR"), image)
82+
83+
if not (isFile(image)) then
84+
-- The image could not be found in the container directory
85+
if (mode() == "load") then
86+
LmodMessage("file not found: " .. image)
87+
LmodMessage("The container image will be pulled upon first use to the Singularity cache")
88+
end
89+
image = uri
90+
91+
-- Alternatively, this could pull the container image and
92+
-- save it in the container directory
93+
--if (mode() == "load") then
94+
-- subprocess(singularity .. " pull " .. image .. " " .. uri)
95+
--end
96+
end
97+
else
98+
-- Look for the image in the Singularity cache, and if not found
99+
-- download it when "singularity run" is invoked.
100+
image = uri
101+
end
102+
103+
-- Determine Nvidia and/or AMD GPUs (to pass coresponding flag to Singularity)
104+
local run_args = {}
105+
if (capture("nvidia-smi -L 2>/dev/null") ~= "") then
106+
if (mode() == "load") then
107+
LmodMessage("ROCM_CONTAINER: Enabling Nvidia GPU support in the container.")
108+
end
109+
table.insert(run_args, "--nv")
110+
end
111+
if (capture("/opt/rocm/bin/rocm-smi -i 2>/dev/null | grep ^GPU") ~= "") then
112+
if (mode() == "load") then
113+
LmodMessage("ROCM_CONTAINER: Enabling AMD GPU support in the container.")
114+
end
115+
table.insert(run_args, "--rocm")
116+
end
117+
118+
-- And assemble container command
119+
local container_launch = singularity .. " run " .. table.concat(run_args, " ") .. " " .. image .. " " .. entrypoint_args
120+
121+
-- Multinode support
122+
pushenv("OMPI_MCA_orte_launch_agent", container_launch .. " orted")
123+
124+
-- Programs to setup in the shell
125+
for i,program in pairs(programs) do
126+
set_shell_function(program, container_launch .. " " .. program .. " \"$@\"",
127+
container_launch .. " " .. program .. " $*")
128+
end
129+
130+
-- Additional commands or environment variables, if any
131+
-- Somehow CP2K's bin directory is not in container's default PATH.
132+
-- And neither is OpenMPI.
133+
prepend_path("SINGULARITYENV_PREPEND_PATH", "/opt/cp2k/bin")
134+
prepend_path("SINGULARITYENV_PREPEND_PATH", "/opt/cp2k/benchmark-scripts")
135+
prepend_path("SINGULARITYENV_PREPEND_PATH", "/opt/openmpi/bin")

0 commit comments

Comments
 (0)