-
Notifications
You must be signed in to change notification settings - Fork 1
/
recipe_nompi.py
64 lines (51 loc) · 1.7 KB
/
recipe_nompi.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
"""
HPCCM recipe for MRChem Singularity image (OpenMP)
Contents:
Ubuntu 20.04
GNU compilers (upstream)
Generating recipe (stdout):
$ hpccm --recipe recipe_omp.py --format singularity --singularity-version=3.2
"""
os_version="20.04"
mrchem_version="@_VERSION_@"
cmake_version="3.20.6"
# CentOS base image
Stage0 += baseimage(image=f"ubuntu:{os_version}", _as="build")
# GNU compilers
compiler = gnu()
Stage0 += compiler
# CMake
Stage0 += cmake(eula=True, version=cmake_version)
# Python 3
Stage0 += python(python2=False, python3=True)
# MRChem
Stage0 += packages(apt=["patch"])
Stage0 += generic_cmake(
cmake_opts=["-D CMAKE_BUILD_TYPE=Release",
"-D ENABLE_MPI=OFF",
"-D ENABLE_OPENMP=ON",
"-D ENABLE_ARCH_FLAGS=OFF",
],
prefix="/usr/local/mrchem",
url=f"http://github.com/MRChemSoft/mrchem/archive/v{mrchem_version}.tar.gz",
directory=f"mrchem-{mrchem_version}",
)
# Runtime distributable stage
Stage1 += baseimage(image=f"ubuntu:{os_version}")
Stage1 += Stage0.runtime(_from="build")
Stage1 += environment(variables={"PATH": "$PATH:/usr/local/mrchem/bin"})
Stage1 += runscript(commands=["mrchem"])
Stage1 += label(metadata={
"Author": "Stig Rune Jensen <stig.r.jensen@uit.no>",
"Version": f'"v{mrchem_version}"',
"Description": "MRChem program (OpenMP version)"
})
help_str="""
%help
Shared memory parallel (OpenMP) build of MRChem on a Ubuntu-{os_version} base image.
For a pure OpenMP run (n threads on one process) you can run the container
just as the regular mrchem executable, here with input file molecule.inp:
$ export OMP_NUM_THREADS=n
$ ./<image-name>.sif molecule
"""
Stage1 += raw(singularity=help_str)