Skip to content

Commit 95ef0c7

Browse files
committed
Update modules.
1 parent da69824 commit 95ef0c7

1 file changed

Lines changed: 90 additions & 0 deletions

File tree

Lines changed: 90 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,90 @@
1+
-- The MIT License (MIT)
2+
--
3+
-- Copyright (c) 2021 NVIDIA Corporation
4+
--
5+
-- Permission is hereby granted, free of charge, to any person obtaining a copy
6+
-- of this software and associated documentation files (the "Software"), to
7+
-- deal in the Software without restriction, including without limitation the
8+
-- rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
9+
-- sell copies of the Software, and to permit persons to whom the Software is
10+
-- furnished to do so, subject to the following conditions:
11+
--
12+
-- The above copyright notice and this permission notice shall be included in
13+
-- all copies or substantial portions of the Software.
14+
--
15+
-- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
-- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
-- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
-- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
-- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
20+
-- FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS
21+
-- IN THE SOFTWARE.
22+
23+
help([==[
24+
25+
Description
26+
===========
27+
RELION (for REgularized LIkelihood OptimizatioN) implements an empirical
28+
Bayesian approach for analysis of electron cryo-microscopy (Cryo-EM).
29+
Specifically it provides methods of refinement of singular or multiple 3D
30+
reconstructions as well as 2D class averages. RELION is an important tool in
31+
the study of living cells.
32+
33+
More information
34+
================
35+
- NGC: https://ngc.nvidia.com/catalog/containers/hpc:relion
36+
]==])
37+
38+
whatis("Name: relion")
39+
whatis("Version: 5.0.0")
40+
whatis("Description: RELION (for REgularized LIkelihood OptimizatioN) implements an empirical Bayesian approach for analysis of electron cryo-microscopy (Cryo-EM). Specifically it provides methods of refinement of singular or multiple 3D reconstructions as well as 2D class averages. RELION is an important tool in the study of living cells.")
41+
whatis("URL: https://ngc.nvidia.com/catalog/containers/hpc:relion")
42+
43+
if not (os.getenv("NGC_SINGULARITY_MODULE") == "none") then
44+
local singularity_module = os.getenv("NGC_SINGULARITY_MODULE") or "Singularity"
45+
if not (isloaded(singularity_module)) then
46+
load(singularity_module)
47+
end
48+
end
49+
50+
conflict(myModuleName(), "openmpi", "chroma", "lammps", "milc", "quantum_espresso", "relion")
51+
52+
local image = "nvcr.io_hpc_relion:5.0.0.sif"
53+
local uri = "docker://nvcr.io/hpc/relion:5.0.0"
54+
local programs = {"mpirun", "relion", "relion_refine_mpi"}
55+
local entrypoint_args = ""
56+
57+
-- The absolute path to Singularity is needed so it can be invoked on remote
58+
-- nodes without the corresponding module necessarily being loaded.
59+
-- Trim off the training newline.
60+
local singularity = capture("which singularity | head -c -1")
61+
62+
if (os.getenv("NGC_IMAGE_DIR") and mode() == "load") then
63+
image = pathJoin(os.getenv("NGC_IMAGE_DIR"), image)
64+
65+
if not (isFile(image)) then
66+
-- The image could not be found in the container directory
67+
LmodMessage("file not found: " .. image)
68+
LmodMessage("The container image will be pulled upon first use to the Singularity cache")
69+
image = uri
70+
71+
-- Alternatively, this could pull the container image and
72+
-- save it in the container directory
73+
--subprocess(singularity .. " pull " .. image .. " " .. uri)
74+
end
75+
else
76+
-- Look for the image in the Singularity cache, and if not found
77+
-- download it when "singularity run" is invoked.
78+
image = uri
79+
end
80+
81+
local container_launch = singularity .. " run --nv " .. image .. " " .. entrypoint_args
82+
83+
-- Multinode support
84+
setenv("OMPI_MCA_orte_launch_agent", container_launch .. " orted")
85+
86+
-- Programs to setup in the shell
87+
for i,program in pairs(programs) do
88+
set_shell_function(program, container_launch .. " " .. program .. " \"$@\"",
89+
container_launch .. " " .. program .. " $*")
90+
end

0 commit comments

Comments
 (0)