Skip to content

Commit

Permalink
Virtual Fugaku V1.1
Browse files Browse the repository at this point in the history
  • Loading branch information
ShigeruIshizuki committed Dec 4, 2024
1 parent c297399 commit 667dac9
Show file tree
Hide file tree
Showing 44 changed files with 5,486 additions and 12 deletions.
25 changes: 25 additions & 0 deletions README_build_procedure.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,25 @@
# The steps to create "virtual_fugaku" environment are as follows:
#
# First
# Build the GCC environment
spack install gcc@14.1.0+binutils
spack load gcc
spack compiler find

# Second,
# Create environment for python.
cd spack
spack env create virtual_fugaku_python etc/spack/spack_python.yaml
spack -e virtual_fugaku_python concretize
spack -e virtual_fugaku_python install

# Third,
# Create environment for application including "virtual_fugaku_python".
spack env create --include-concrete virtual_fugaku_python virtual_fugaku etc/spack/spack.yaml
spack -e virtual_fugaku concretize
spack -e virtual_fugaku install

# You can use the spack in one of the following ways.
# "spack env activate virtual_fugaku"
# or
# "spack load [spec]"
4 changes: 4 additions & 0 deletions etc/spack/mirrors.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
mirrors:
build_cache_https:
url: https://spack-mirror.r-ccs.riken.jp
signed: false
5 changes: 3 additions & 2 deletions etc/spack/packages.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
# -------------------------------------------------------------------------
packages:
all:
compiler: [gcc, intel, pgi, clang, xl, nag, fj, aocc]
compiler: [gcc@14.1.0, gcc, intel, pgi, clang, xl, nag, fj, aocc]
providers:
awk: [gawk]
blas: [openblas, amdblis]
Expand Down Expand Up @@ -68,4 +68,5 @@ packages:
externals:
- spec: "openmpi@4.1.5"
prefix: /opt/amazon/openmpi

python:
require: "@3.11"
14 changes: 4 additions & 10 deletions etc/spack/spack.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -12,19 +12,13 @@ spack:
- tmux
- petsc ^openblas~ilp64
- openbabel
- paraview+python~qt
# - gcc +binutils
- gnuplot
- lammps
- julia ^openblas+ilp64
- py-scipy
- py-numpy
- py-mpi4py
- py-matplotlib
- py-ase
- py-toml
- py-scikit-learn
- py-pandas
- cp2k
- cpmd+omp+mpi
- frontistr
- autodock-vina
concretizer:
unify: when_possible
view:
Expand Down
14 changes: 14 additions & 0 deletions etc/spack/spack_AI2.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
spack:
specs:
- py-tensorflow-hub%gcc@14.1.0
- py-tensorflow-metadata%gcc@14.1.0
- py-tensorflow-datasets%gcc@14.1.0 ^py-numpy@1.24.3
concretizer:
unify: when_possible
view:
default:
root: .spack-env/view
projections:
all: "{name}-{version}-{hash:7}"
config:
build_jobs: 1
45 changes: 45 additions & 0 deletions etc/spack/spack_python.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,45 @@
spack:
specs:
- paraview+python~qt
- py-tensorflow~cuda+mpi
- py-tensorflow-estimator
- py-tensorflow-probability@0.22 ^py-dm-tree@0.1.8%gcc@8.5.0
- py-torch~cuda
- py-botorch
- py-efficientnet-pytorch
- py-gpytorch
- py-pytorch-gradual-warmup-lr
- py-pytorch-lightning
- py-pytorch-sphinx-theme
- py-segmentation-models-pytorch
- py-torch-cluster
- py-torchdata
- py-torchdiffeq
- py-torchfile
- py-torch-geometric
- py-torchmetrics
- py-torch-nvidia-apex~cuda
- py-torch-scatter
- py-torch-sparse
- py-torch-spline-conv
- py-torchsummary
- py-torchtext
- py-torchvision
- py-vector-quantize-pytorch
- py-torchgeo
- py-torchaudio
- py-scipy
- py-numpy
- py-mpi4py
- py-matplotlib
- py-ase
- py-toml
- py-scikit-learn
- py-pandas
concretizer:
unify: when_possible
view:
default:
root: .spack-env/view
projections:
all: "{name}-{version}-{hash:7}"
63 changes: 63 additions & 0 deletions var/spack/repos/local/packages/autodock-vina/package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,63 @@
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)


import sys

from spack.package import *


class AutodockVina(MakefilePackage):
"""AutoDock Vina is an open-source program for doing molecular docking"""

homepage = "http://vina.scripps.edu/"
url = "https://github.com/ccsb-scripps/AutoDock-Vina/archive/refs/tags/v1.2.3.tar.gz"

license("Apache-2.0")

version("1.2.3", sha256="22f85b2e770b6acc363429153b9551f56e0a0d88d25f747a40d2f55a263608e0")
version("1.2.2", sha256="b9c28df478f90d64dbbb5f4a53972bddffffb017b7bb58581a1a0034fff1b400")
version("1.2.1", sha256="2d8d9871a5a95265c03c621c0584d9f06b202303116e6c87e23c935f7b694f74")
version("1.2.0", sha256="9c9a85766b4d124d7c1d92e767aa8b4580c6175836b8aa2c28f88a9c40a5b90e")
version(
"1.1.2",
sha256="65422b2240c75d40417872a48e98043e7a7c435300dc8490af0c1f752f1ca4a2",
url="https://github.com/ccsb-scripps/AutoDock-Vina/archive/refs/tags/v1.1.2-boost-new.tar.gz",
)

depends_on(
"boost@1.50.0:1.75.0 +filesystem +program_options +serialization +system +thread",
when="@1.1.2",
)
depends_on(
"boost@1.54.0: +filesystem +program_options +serialization +system +thread", when="@1.2.0:"
)

@property
def build_directory(self):
if sys.platform == "darwin":
return join_path("build", "mac", "release")
else:
return join_path("build", "linux", "release")

def edit(self, spec, prefix):
with working_dir(self.build_directory):
makefile = FileFilter("Makefile")
makefile.filter(
"BOOST_INCLUDE = .*", f"BOOST_INCLUDE = {self.spec['boost'].prefix.include}"
)
makefile.filter("C_PLATFORM=.*", "C_PLATFORM=-pthread")
makefile.filter("GPP=.*", f"GPP={spack_cxx}")
makefile.filter("-DNDEBUG", "-DNDEBUG -DBOOST_TIMER_ENABLE_DEPRECATED")

def build(self, spec, prefix):
with working_dir(self.build_directory):
make()

def install(self, spec, prefix):
with working_dir(self.build_directory):
mkdirp(prefix.bin)
install("vina", prefix.bin)
install("vina_split", prefix.bin)
101 changes: 101 additions & 0 deletions var/spack/repos/local/packages/cpmd/package.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,101 @@
# Copyright 2013-2024 Lawrence Livermore National Security, LLC and other
# Spack Project Developers. See the top-level COPYRIGHT file for details.
#
# SPDX-License-Identifier: (Apache-2.0 OR MIT)

from spack.package import *


class Cpmd(MakefilePackage):
"""The CPMD code is a parallelized plane wave / pseudopotential
implementation of Density Functional Theory, particularly
designed for ab-initio molecular dynamics."""

homepage = "https://www.cpmd.org/wordpress/"
url = "https://github.com/CPMD-code/CPMD/archive/refs/tags/4.3.tar.gz"

license("MIT")

version("4.3", sha256="e0290f9da0d255f90a612e60662b14a97ca53003f89073c6af84fa7bc8739f65")

variant("omp", description="Enables the use of OMP instructions", default=False)
variant("mpi", description="Build with MPI support", default=False)

depends_on("lapack")
depends_on("mpi", when="+mpi")

conflicts("^openblas threads=none", when="+omp")
conflicts("^openblas threads=pthreads", when="+omp")

def edit(self, spec, prefix):
# patch configure file
cbase = "LINUX-GFORTRAN"
cp = FileFilter(join_path("configure", cbase))
# Compilers
if spec.satisfies("+mpi"):
fc = spec["mpi"].mpifc
cc = spec["mpi"].mpicc
else:
fc = spack_fc
cc = spack_cc
cp.filter(r"FFLAGS='([^']*)'", "FFLAGS='\\1 -fallow-argument-mismatch'")

cp.filter("FC=.+", "FC='{0}'".format(fc))
cp.filter("CC=.+", "CC='{0}'".format(cc))
cp.filter("LD=.+", "LD='{0}'".format(fc))

# MPI flag
if spec.satisfies("+mpi"):
cp.filter("-D__Linux", "-D__Linux -D__PARALLEL")

# OMP flag
if spec.satisfies("+omp"):
cp.filter("-fopenmp", self.compiler.openmp_flag)

# lapack
cp.filter("LIBS=.+", "LIBS='{0}'".format(spec["lapack"].libs.ld_flags))

# LFLAGS
cp.filter("'-static '", "")

# Compiler specific
if spec.satisfies("%gcc@=14.1.0"):
cp.filter(r"FFLAGS='([^']*)'", "FFLAGS='\\1 -fallow-argument-mismatch'")
cp.filter(r"CFLAGS='([^']*)'", "CFLAGS='\\1 -Wno-int-conversion'")

if spec.satisfies("%fj"):
cp.filter("-ffixed-form", "-Fixed")
cp.filter("-ffree-line-length-none", "")
cp.filter("-falign-commons", "-Kalign_commons")

# create Makefile
bash = which("bash")
if spec.satisfies("+omp"):
bash("./configure.sh", "-omp", cbase)
else:
bash("./configure.sh", cbase)

def install(self, spec, prefix):
install_tree(".", prefix)

def test_cpmd(self):
test_dir = self.test_suite.current_test_data_dir
test_file = join_path(test_dir, "1-h2o-pbc-geoopt.inp")
opts = []
if self.spec.satisfies("+mpi"):
exe_name = self.spec["mpi"].prefix.bin.mpirun
opts.extend(["-n", "2"])
opts.append(join_path(self.prefix.bin, "cpmd.x"))
else:
exe_name = "cpmd.x"
opts.append(test_file)
opts.append(test_dir)
cpmd = which(exe_name)
out = cpmd(*opts, output=str.split, error=str.split)

expected = [
"2 1 H O 1.84444 0.97604",
"3 1 H O 1.84444 0.97604",
"2 1 3 H O H 103.8663",
]
check_outputs(expected, out)
51 changes: 51 additions & 0 deletions var/spack/repos/local/packages/cpmd/test/1-h2o-pbc-geoopt.inp
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
&INFO
single water molecule with pbc.
default geometry optimization
&END

&CPMD
OPTIMIZE GEOMETRY XYZ
HESSIAN UNITY
CONVERGENCE ORBITALS
1.0d-7
CONVERGENCE GEOMETRY
3.0d-4
ODIIS
5
MAXSTEP
100
MAXCPUTIME
1500

STRUCTURE BONDS ANGLES
&END

&DFT
FUNCTIONAL BLYP
GC-CUTOFF
1.0d-06
&END

&SYSTEM
SYMMETRY
1
CELL
20.0 1.0 1.0 0.0 0.0 0.0
CUTOFF
70.0
&END

&ATOMS

*O_MT_BLYP.psp KLEINMAN-BYLANDER
LMAX=P
1
10.0 10.0 10.0

*H_CVB_BLYP.psp
LMAX=S
2
8.5 9.0 10.0
11.5 9.0 10.0

&END
28 changes: 28 additions & 0 deletions var/spack/repos/local/packages/cpmd/test/H_CVB_BLYP.psp
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
&ATOM
Z = 1
ZV = 1
XC = 1312 .666667
TYPE = NORMCONSERVING CAR
&END
&INFO
============================================================
| hydrogen pseudopotential with |
| Exchange-Correlation Functional : |
| Slater exchange : .6667 |
| LDA correlation : Lee-Yang-Parr |
| Exchange GC : Becke (1988) |
| Correlation GC : Lee-Yang-Parr |
| Von Barth-Car normconserving PP after P. Giannozzi |
| ALPHA(CORE): .25 |
| .2829559 -1.961599 .4051810 |
| Note this is the PP used by Michiel Sprik |
============================================================
&END
&POTENTIAL
CAR
0.25000
0.2829559 -1.9615990 0.405181
0.2829559 -1.9615990 0.405181
0.2829559 -1.9615990 0.405181
&END

Loading

0 comments on commit 667dac9

Please sign in to comment.