Skip to content

Commit 173a0a5

Browse files
authored
Merge pull request #16 from hpc4cmb/custom_numpy
Custom numpy
2 parents 7bfbcd9 + 3c92566 commit 173a0a5

16 files changed

+401
-43
lines changed

configs/linux-nvhpc

Lines changed: 10 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ TEMPLATE = linux
99
PYVERSION = auto
1010

1111
# Packages to install with pip
12-
PIP_PKGS = future nose Cython numpy scipy matplotlib pyyaml astropy six psutil ephem pandas memory_profiler ipython cycler kiwisolver python-dateutil toml numba tbb nbstripout black wurlitzer ipympl ipykernel jupyterlab pillow pshmem tomlkit traitlets healpy ducc0
12+
PIP_PKGS = future nose Cython scipy matplotlib pyyaml astropy six psutil ephem pandas memory_profiler ipython cycler kiwisolver python-dateutil toml cmake numba tbb nbstripout black wurlitzer ipympl ipykernel jupyterlab pillow pshmem tomlkit traitlets healpy ducc0
1313

1414
# Packages to install with conda
1515
CONDA_PKGS =
@@ -24,6 +24,7 @@ FC = nvfortran
2424

2525
BUILD_CC = gcc
2626
BUILD_CXX = g++
27+
BUILD_FC = gfortran
2728

2829
# MPI compilers
2930

@@ -57,17 +58,17 @@ MAKEJ = 4
5758
MKL =
5859

5960
# CUDA
60-
CUDA = /opt/nvidia/hpc_sdk/Linux_x86_64/21.9/cuda
61-
CUDA_INC = /opt/nvidia/hpc_sdk/Linux_x86_64/21.9/cuda/include
62-
CUDA_LIB = /opt/nvidia/hpc_sdk/Linux_x86_64/21.9/cuda/lib64
63-
CUDA_MATH = /opt/nvidia/hpc_sdk/Linux_x86_64/21.9/math_libs
64-
CUDA_MATH_INC = /opt/nvidia/hpc_sdk/Linux_x86_64/21.9/math_libs/include
65-
CUDA_MATH_LIB = /opt/nvidia/hpc_sdk/Linux_x86_64/21.9/math_libs/lib64
61+
CUDA = /opt/nvidia/hpc_sdk/Linux_x86_64/22.7/cuda
62+
CUDA_INC = /opt/nvidia/hpc_sdk/Linux_x86_64/22.7/cuda/include
63+
CUDA_LIB = /opt/nvidia/hpc_sdk/Linux_x86_64/22.7/cuda/lib64
64+
CUDA_MATH = /opt/nvidia/hpc_sdk/Linux_x86_64/22.7/math_libs
65+
CUDA_MATH_INC = /opt/nvidia/hpc_sdk/Linux_x86_64/22.7/math_libs/include
66+
CUDA_MATH_LIB = /opt/nvidia/hpc_sdk/Linux_x86_64/22.7/math_libs/lib64
6667

6768
# For BLAS/LAPACK, we use openblas
6869

69-
BLAS = -lnvblas
70-
LAPACK = -lopenblas -fopenmp -lm
70+
BLAS = @AUX_PREFIX@/lib/libopenblas.so -fopenmp -lm
71+
LAPACK =
7172

7273
# Boost toolchain name
7374

configs/linux-nvhpc.pkgs

Lines changed: 10 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -6,17 +6,17 @@
66
#
77
# Autotools. If you already have recent versions installed with your OS
88
# package manager, then comment these out.
9-
m4
10-
libtool
11-
autoconf
12-
automake
9+
#m4
10+
#libtool
11+
#autoconf
12+
#automake
1313
#
1414
# CMake.
15-
cmake
15+
#cmake
1616
#
1717
# Install zlib. This is needed on some systems where the OS-provided zlib is
1818
# very ancient.
19-
zlib
19+
#zlib
2020
#
2121
# Install OpenBLAS. Comment out if you are using MKL with the Intel compilers
2222
# or some other vendor BLAS / LAPACK solution.
@@ -26,9 +26,12 @@ openblas
2626
# "default" option for Docker images. All other configs should use either
2727
# a virtualenv or a conda environment. This will also install a set of
2828
# common base packages.
29-
python:virtualenv
29+
python:virtualenv custom
3030
#python:conda
3131
#python:default
32+
python_numpy
33+
python_scipy
34+
python_pkgs
3235
#
3336
# Install MPICH. This step is optional and only needed in 2 cases:
3437
# 1. You don't have MPI available through system packages that is

configs/linux-rocm-conda

Lines changed: 72 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,72 @@
1+
2+
# OS type (linux OR osx)
3+
OSTYPE = linux
4+
5+
# Specify the template to use
6+
TEMPLATE = linux
7+
8+
# Python version to use
9+
PYVERSION = auto
10+
11+
# Packages to install with pip
12+
PIP_PKGS =
13+
14+
# Packages to install with conda
15+
CONDA_PKGS = cmake future nose cython matplotlib pyyaml astropy healpy six psutil ephem virtualenv pandas memory_profiler ipython cycler kiwisolver python-dateutil toml numba tbb nbstripout black wurlitzer ipympl ipykernel jupyterlab pillow pshmem tomlkit traitlets ducc0 plotly plotly-resampler h5py mpi4py
16+
17+
# Serial compilers
18+
19+
CC = amdclang
20+
CXX = amdclang++
21+
FC = amdflang
22+
23+
# Compiler to use for packages needed on the build machine
24+
25+
BUILD_CC = gcc
26+
BUILD_CXX = g++
27+
BUILD_FC = gfortran
28+
29+
# MPI compilers
30+
31+
MPICC = mpicc
32+
MPICXX = mpicxx
33+
MPIFC = mpifort
34+
MPI_CPPFLAGS = @AUX_PREFIX@/include
35+
MPI_LDFLAGS = @AUX_PREFIX@/lib
36+
MPI_CXXLIB = mpichcxx
37+
MPI_LIB = mpich
38+
MPI_EXTRA_COMP =
39+
MPI_EXTRA_LINK =
40+
41+
# Compile flags
42+
43+
CFLAGS = -O3 -g -fPIC -Wno-error=implicit-function-declaration
44+
CXXFLAGS = -O3 -g -fPIC -std=c++11
45+
FCFLAGS = -O3 -g -fPIC
46+
47+
OPENMP_CFLAGS = -fopenmp
48+
OPENMP_CXXFLAGS = -fopenmp
49+
LDFLAGS = -rtlib=compiler-rt -fopenmp
50+
51+
# Are we doing a cross-compile?
52+
CROSS =
53+
54+
# Parallel builds
55+
MAKEJ = 8
56+
57+
# Define MKL location
58+
MKL =
59+
60+
# For BLAS/LAPACK, we use our custom openblas
61+
62+
BLAS = @AUX_PREFIX@/lib/libopenblas.so -fopenmp -lm
63+
LAPACK =
64+
65+
# Boost toolchain name
66+
67+
BOOSTCHAIN = clang
68+
69+
# Group and permissions to set
70+
71+
CHGRP =
72+
CHMOD =

configs/linux-rocm-conda.mod

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
2+
if [ module-info mode load ] {
3+
if [ is-loaded rocm ] {
4+
} else {
5+
module load rocm
6+
}
7+
}

configs/linux-rocm-conda.pkgs

Lines changed: 119 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,119 @@
1+
# This is the full set of packages that can be installed. This can be
2+
# used as a starting point for the package list for a particular config.
3+
# Some packages accept additional options which can be added after a colon ":".
4+
# These extra options are documented in the shell snippet for each package
5+
# in the top-level pkgs directory.
6+
#
7+
# Autotools. If you already have recent versions installed with your OS
8+
# package manager, then comment these out.
9+
#m4
10+
#libtool
11+
#autoconf
12+
#automake
13+
#
14+
# CMake.
15+
#cmake
16+
#
17+
# Install zlib. This is needed on some systems where the OS-provided zlib is
18+
# very ancient.
19+
#zlib
20+
#
21+
# Install OpenBLAS. Comment out if you are using MKL with the Intel compilers
22+
# or some other vendor BLAS / LAPACK solution.
23+
openblas
24+
#
25+
# Python 3. Uncomment one of the following lines. You should only use the
26+
# "default" option for Docker images. All other configs should use either
27+
# a virtualenv or a conda environment. This will also install a set of
28+
# common base packages.
29+
#python:virtualenv custom
30+
python:conda custom
31+
#python:default
32+
python_numpy
33+
python_scipy
34+
python_pkgs
35+
#
36+
# Install MPICH. This step is optional and only needed in 2 cases:
37+
# 1. You don't have MPI available through system packages that is
38+
# compatible with the serial compilers you are using.
39+
# 2. You are building a docker container for use at NERSC with shifter
40+
# and need an MPICH compatible with the Cray one.
41+
#mpich
42+
#
43+
# Install mpi4py. This will use the MPI compilers specified in your config.
44+
#mpi4py
45+
#
46+
# Install CFITSIO.
47+
cfitsio
48+
#
49+
# Install FFTW3.
50+
fftw
51+
#
52+
# Install pyFFTW
53+
pyfftw
54+
#
55+
# Install libbz2. This is required to enable some features in the boost
56+
# build which are in turn needed by spt3g.
57+
bzip2
58+
#
59+
# Install Boost.
60+
#boost
61+
#
62+
# Install HDF5.
63+
#hdf5
64+
#
65+
# Install h5py (using our HDF5).
66+
#h5py
67+
#
68+
# Install healpy
69+
#healpy
70+
#
71+
# Install quaternionarray
72+
qarray
73+
#
74+
# Install Pixell
75+
#pixell
76+
#
77+
# Install fitsio
78+
#fitsio
79+
#
80+
# Install aatm. Needed for some features of atmosphere simulations.
81+
aatm
82+
#
83+
# GMP and MPFR are needed by SuiteSparse
84+
gmp
85+
mpfr
86+
#
87+
# Install suitesparse
88+
suitesparse
89+
#
90+
# Install libconviqt. 4-PI a_lm space beam convolution.
91+
#conviqt
92+
#
93+
# Install libsharp. Distributed harmonic transforms.
94+
#libsharp
95+
#
96+
# Install libmadam. Destriping map-maker.
97+
#madam
98+
#
99+
# Install FLAC, needed by spt3g
100+
#libflac
101+
#
102+
# Install SPT3G. Frame based data format.
103+
#spt3g
104+
#
105+
# Install uncrustify
106+
uncrustify
107+
#
108+
# Install TIDAS. HDF5-based timestream data format.
109+
#tidas
110+
#
111+
# Install PySM. Python Sky Model.
112+
#pysm
113+
#
114+
# Install PyMPIT for environment testing. Useful for testing working
115+
# mpi4py stack.
116+
#pympit
117+
#
118+
# Install TOAST.
119+
#toast

configs/linux-rocm-conda.sh

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
loadedrocm=`modulecmd sh -t list 2>&1 | grep rocm`
2+
if [ "x${loadedrocm}" = x ]; then
3+
module load rocm
4+
fi

configs/perlmutter-nvhpc

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@ FC = nvfortran
2424

2525
BUILD_CC = gcc
2626
BUILD_CXX = g++
27+
BUILD_FC = gfortran
2728

2829
# MPI compilers
2930

configs/perlmutter-nvhpc.pkgs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@ openblas
3030
# a virtualenv or a conda environment. This will also install a set of
3131
# common base packages.
3232
#python:virtualenv
33-
python:conda
33+
python:conda custom
3434
#python:default
35+
python_numpy
36+
python_scipy
37+
python_pkgs
3538
#
3639
# Install MPICH. This step is optional and only needed in 2 cases:
3740
# 1. You don't have MPI available through system packages that is

pkgs/mpich.sh

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -35,7 +35,7 @@ tar xzf ${src} \
3535
&& cleanup="${cleanup} $(pwd)" \
3636
&& CC="@CC@" CXX="@CXX@" FC="@FC@" F77="@FC@" \
3737
CFLAGS="@CFLAGS@" CXXFLAGS="@CXXFLAGS@" \
38-
FFLAGS="@FCFLAGS@" FCFLAGS="@FCFLAGS@" \
38+
FFLAGS="@FCFLAGS@" FCFLAGS="@FCFLAGS@" LDFLAGS="@LDFLAGS@" \
3939
MPICH_MPICC_CFLAGS="@CFLAGS@ @MPI_EXTRA_COMP@" \
4040
MPICH_MPICXX_CXXFLAGS="@CXXFLAGS@ @MPI_EXTRA_COMP@" \
4141
MPICH_MPIF77_FFLAGS="@FCFLAGS@ @MPI_EXTRA_COMP@" \

pkgs/openblas.sh

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ pkg="openblas"
44
pkgopts=$@
55
cleanup=""
66

7-
version=0.3.20
7+
version=0.3.21
88
pfile=OpenBLAS-${version}.tar.gz
99
src=$(eval "@TOP_DIR@/tools/fetch_check.sh" https://github.com/xianyi/OpenBLAS/archive/v${version}.tar.gz ${pfile})
1010

@@ -34,6 +34,7 @@ rm -rf OpenBLAS-${version}
3434
tar xzf ${src} \
3535
&& cd OpenBLAS-${version} \
3636
&& cleanup="${cleanup} $(pwd)" \
37+
&& patch -p1 < "@TOP_DIR@/pkgs/patch_openblas" > ${log} 2>&1 \
3738
&& if [ "$static" = "yes" ]; then
3839
make NO_SHARED=1 USE_OPENMP=1 \
3940
FC="@FC@" \
@@ -42,7 +43,7 @@ tar xzf ${src} \
4243
CROSS=$(if [ "x@CROSS@" = x ]; then echo "0"; else echo "1"; fi) \
4344
COMMON_OPT="@CFLAGS@" \
4445
FCOMMON_OPT="@FCFLAGS@" \
45-
LDFLAGS="@OPENMP_CFLAGS@ -lm" > ${log} 2>&1 \
46+
LDFLAGS="@OPENMP_CFLAGS@ -lm" >> ${log} 2>&1 \
4647
&& make NO_SHARED=1 PREFIX="@AUX_PREFIX@" install >> ${log} 2>&1; \
4748
else make USE_OPENMP=1 \
4849
FC="@FC@" \

0 commit comments

Comments
 (0)