Skip to content

Commit

Permalink
Merge branch 'master' into evaleev/feature/wfn91-linalg-discovery
Browse files Browse the repository at this point in the history
  • Loading branch information
David Williams-Young committed May 4, 2021
2 parents 07e50e3 + 7aa5114 commit b6478d0
Show file tree
Hide file tree
Showing 52 changed files with 801 additions and 667 deletions.
58 changes: 58 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,58 @@
name: TiledArray CI

on: [push]

env:
CMAKE_BUILD_PARALLEL_LEVEL : 2

jobs:

MacOS-Build:

strategy:
fail-fast: false
matrix:
os : [ macos-latest ]
cxx : [ clang++, /usr/local/bin/g++-10 ]
build_type : [ Release, Debug ]
prerequisites : [ gcc@10 boost eigen open-mpi ]

name: "${{ matrix.os }}: ${{ matrix.cxx }} ${{ matrix.build_type }}"
runs-on: ${{ matrix.os }}
env:
CXX : ${{ matrix.cxx }}
BUILD_CONFIG : >
-DCMAKE_BUILD_TYPE=${{ matrix.build_type }}
-DMPIEXEC_PREFLAGS='--bind-to;none;--allow-run-as-root'
steps:
- uses: actions/checkout@v2

- name: Host system info
shell: bash
run: cmake -P ${{github.workspace}}/ci/host_system_info.cmake

- name: Install ${{matrix.prerequisites}}
run: brew install ${{matrix.prerequisites}}

- name: "Configure build: ${{ env.BUILD_CONFIG }}"
shell: bash
run: |
set -x;
cmake -B${{github.workspace}}/build $BUILD_CONFIG
- name: Build
working-directory: ${{github.workspace}}/build
shell: bash
run: |
cmake --build . --target tiledarray
cmake --build . --target examples
- name: Test
working-directory: ${{github.workspace}}/build
shell: bash
#run: ctest -C $${{matrix.build_type}}
run: |
source ${{github.workspace}}/ci/openmpi.env
cmake --build . --target ta_test
cmake --build . --target check
53 changes: 22 additions & 31 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,35 +7,20 @@ default:

variables:
MAD_NUM_THREADS : 2
TA_CI_TARGETS : "tiledarray examples ta_test check"
TA_CI_CONFIG : >
TA_BUILD_UNITTEST=TRUE
CMAKE_BUILD_TYPE=${BUILD_TYPE}
${TA_PYTHON}
${ENABLE_CUDA}
${BLA_VENDOR}
${ENABLE_SCALAPACK}
TA_TARGETS : "tiledarray examples ta_test check"
TA_CONFIG : >
CMAKE_BUILD_TYPE=${BUILD_TYPE}
${TA_PYTHON}
${ENABLE_CUDA}
${BLA_VENDOR}
${ENABLE_SCALAPACK}
before_script:
- echo 'localhost slots=2' > /etc/openmpi/openmpi-default-hostfile
# NB: below tag parsing is not robust
- echo "CI_RUNNER_TAGS=$CI_RUNNER_TAGS"
# NB: tag parsing below is not robust
- CMAKE_BUILD_PARALLEL_LEVEL=$(echo $CI_RUNNER_TAGS | sed -n 's/CMAKE_BUILD_PARALLEL_LEVEL=\([0-9]\+\).*/\1/p')
- export CMAKE_BUILD_PARALLEL_LEVEL=${CMAKE_BUILD_PARALLEL_LEVEL:=1}
- echo "CMAKE_BUILD_PARALLEL_LEVEL=$CMAKE_BUILD_PARALLEL_LEVEL"
- |-
if [[ "$BLA_VENDOR" == "BLA_VENDOR=Intel10"* ]]; then
# apt-get install -yq intel-mkl-core-c-2020.4-304
# source /opt/intel/compilers_and_libraries_2020.4.304/linux/mkl/bin/mklvars.sh intel64
make -C /home/ValeevGroup install/intel-mkl
source /opt/intel/mkl/bin/mklvars.sh intel64
echo "MKLROOT=$MKLROOT"
fi
- |-
if [[ "$ENABLE_CUDA" == "ENABLE_CUDA=ON" ]]; then
make -C /home/ValeevGroup install/cuda
export CUDACXX=/usr/local/cuda/bin/nvcc
fi

ubuntu:
stage: build
Expand All @@ -46,17 +31,23 @@ ubuntu:
TA_PYTHON : "TA_PYTHON=ON"
ENABLE_SCALAPACK : "ENABLE_SCALAPACK=OFF"
script:
- mkdir build
- cd build
# !!! Unset env vars that may conflict with build, eg FindBLAS uses $ENV{BLA_VENDOR}
- unset BUILD_TYPE TA_PYTHON BLA_VENDOR ENABLE_SCALAPACK ENABLE_CUDA
- ../bin/gitlab-ci.sh ..
${TA_CI_TARGETS}
${TA_CI_CONFIG}
- ./ci/.build-project
--build ./build
--metrics ./build/metrics.txt
${TA_CONFIG}
${TA_TARGETS}
MPIEXEC_PREFLAGS='--bind-to;none;--allow-run-as-root'
blacs_LIBRARIES=scalapack-openmpi
scalapack_LIBRARIES=scalapack-openmpi
#lapack_LIBRARIES=lapack
artifacts:
paths:
- build/metrics.txt
- build/CMakeCache.txt
- build/CMakeFiles/CMakeOutput.log
- build/CMakeFiles/CMakeError.log
reports:
metrics: build/metrics.txt
parallel:
matrix:
- IMAGE : [ "ubuntu:18.04", "ubuntu:20.04" ]
Expand All @@ -73,4 +64,4 @@ ubuntu:
CXX: [ g++ ]
BUILD_TYPE : [ "Release", "Debug" ]
ENABLE_CUDA : [ "ENABLE_CUDA=ON" ]
TA_CI_TARGETS : [ "tiledarray examples" ]
TA_TARGETS : [ "tiledarray examples" ]
1 change: 0 additions & 1 deletion .pre-commit-config.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -40,4 +40,3 @@ repos:
files: \.(c|cc|cxx|cpp|h|hpp|hxx)$
entry: clang-format -i
args: [--style=file]
additional_dependencies: [clang-format]
33 changes: 11 additions & 22 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,7 @@ if((ENABLE_GPERFTOOLS OR ENABLE_TCMALLOC_MINIMAL) AND CMAKE_SYSTEM_NAME MATCHES
set(ENABLE_LIBUNWIND ON)
add_feature_info(Libunwind ENABLE_LIBUNWIND "Libunwind provides stack unwinding")
endif()
option(TA_BUILD_UNITTEST "Causes building TiledArray unit tests" OFF)
option(TA_BUILD_UNITTEST "Causes building TiledArray unit tests" ON)
option(TA_EXPERT "TiledArray Expert mode: disables automatically downloading or building dependencies" OFF)

option(TA_SIGNED_1INDEX_TYPE "Enables the use of signed 1-index coordinate type (OFF in 1.0.0-alpha.2 and older)" ON)
Expand Down Expand Up @@ -256,28 +256,17 @@ include(CheckTypeSize)
check_type_size("long double" TILEDARRAY_HAS_LONG_DOUBLE LANGUAGE CXX)
check_type_size("long long" TILEDARRAY_HAS_LONG_LONG LANGUAGE CXX)

##########################
# convert string values of TA_ERROR to numerical values expected by TA_DEFAULT_ERROR
##########################
set (TA_DEFAULT_ERROR 3) # default is to abort so that it works with or without NDEBUG
# assert when CMAKE_BUILD_TYPE is Debug or RelWithDebInfo
string(TOUPPER "${CMAKE_BUILD_TYPE}" uppercase_CMAKE_BUILD_TYPE)
if (CMAKE_BUILD_TYPE AND uppercase_CMAKE_BUILD_TYPE MATCHES "^(DEBUG|RELWITHDEBINFO)$")
set (TA_DEFAULT_ERROR 2)
endif()
# TA_ASSERT
set (TA_ASSERT_POLICY TA_ASSERT_THROW CACHE STRING "")
set_property(
CACHE TA_ASSERT_POLICY PROPERTY
STRINGS TA_ASSERT_THROW TA_ASSERT_ABORT TA_ASSERT_IGNORE)

# if building unit tests default to throw to be able to test TA_ASSERT statements
if (TA_BUILD_UNITTEST)
set (TA_DEFAULT_ERROR 1)
endif(TA_BUILD_UNITTEST)

if (TA_ERROR STREQUAL none)
set (TA_DEFAULT_ERROR 0)
elseif (TA_ERROR STREQUAL throw)
set (TA_DEFAULT_ERROR 1)
elseif (TA_ERROR STREQUAL assert)
set (TA_DEFAULT_ERROR 2)
elseif (TA_ERROR STREQUAL abort)
set (TA_DEFAULT_ERROR 3)
if (NOT (TA_ASSERT_POLICY STREQUAL TA_ASSERT_THROW))
if (TA_BUILD_UNITTEST)
message(FATAL_ERROR "TA_ASSERT_POLICY=${TA_ASSERT_POLICY} requires TA_BUILD_UNITTEST=OFF")
endif(TA_BUILD_UNITTEST)
endif()

##########################
Expand Down
8 changes: 4 additions & 4 deletions INSTALL.md
Original file line number Diff line number Diff line change
Expand Up @@ -40,9 +40,9 @@ Both methods are supported. However, for most users we _strongly_ recommend to b
- Boost.Container: header-only
- Boost.Test: header-only or (optionally) as a compiled library, *only used for unit testing*
- Boost.Range: header-only, *only used for unit testing*
- [BTAS](https://github.com/ValeevGroup/BTAS), tag 784911dc65c5aec04c1f4c9a70a750bba563b173 . If usable BTAS installation is not found, TiledArray will download and compile
- [BTAS](https://github.com/ValeevGroup/BTAS), tag bbb11894802d7e2f89182a2e7fce9aed1078f851 . If usable BTAS installation is not found, TiledArray will download and compile
BTAS from source. *This is the recommended way to compile BTAS for all users*.
- [MADNESS](https://github.com/m-a-d-n-e-s-s/madness), tag b22ee85059e6ccc9a6e803ba0550652ece8d9df1 .
- [MADNESS](https://github.com/m-a-d-n-e-s-s/madness), tag a3f3dce8c9d81262cf9fd7b29f97fcdafc7372a5 .
Only the MADworld runtime and BLAS/LAPACK C API component of MADNESS is used by TiledArray.
If usable MADNESS installation is not found, TiledArray will download and compile
MADNESS from source. *This is the recommended way to compile MADNESS for all users*.
Expand Down Expand Up @@ -135,7 +135,6 @@ $ cmake -D CMAKE_INSTALL_PREFIX=/path/to/install/tiledarray \
```
$ cmake -D CMAKE_INSTALL_PREFIX=/path/to/install/tiledarray \
-D CMAKE_BUILD_TYPE=Debug \
-D TA_BUILD_UNITTEST=ON \
-D BOOST_ROOT=/path/to/boost \
-D CMAKE_PREFIX_PATH=/path/to/dependency;/path/to/another/dependency \
$TILEDARRAY_SOURCE_DIR
Expand Down Expand Up @@ -349,7 +348,8 @@ support may be added.
## Expert configure options:

* `TA_EXPERT` -- Set to `ON` to disable automatic installation of prerequisites. Useful for experts, hence the name. [Default=OFF].
* `TA_ERROR` -- Set to `none` to disable `TA_ASSERT` assertions, `throw` to cause `TA_ASSERT` assertions to throw, `abort` to cause `TA_ASSERT` assertions to abort, or `assert` to cause `TA_ASSERT` assertions to use C++ assert. The default is `throw` if `TA_BUILD_UNITTEST` is set, else is `assert` if `CMAKE_BUILD_TYPE` is `Debug` or `RelWithDebInfo`, else is `abort`.
* `TA_ASSERT_POLICY` -- Set to `TA_ASSERT_IGNORE` to disable `TA_ASSERT` assertions, `TA_ASSERT_THROW` to cause `TA_ASSERT` assertions to throw, `TA_ASSERT_ABORT` to cause `TA_ASSERT` assertions to abort. The default is `TA_ASSERT_THROW`.
* `TA_BUILD_UNITTEST` -- Set of `OFF` to disable building unit tests. The default is `ON`.
* `TA_TRACE_TASKS` -- Set to `ON` to enable tracing of MADNESS tasks using custom task tracer. Note that standard profilers/tracers are generally useless (except in the trivial cases) with MADWorld-based programs since the submission context of tasks is not captured by standard tracing tools; this makes it impossible in a nontrivial program to attribute tasks to source code. WARNING: task tracing his will greatly increase the memory requirements. [Default=OFF].
* `TA_ENABLE_RANGEV3` -- Set to `ON` to find or fetch the Range-V3 library and enable additional tests of TA components with constructs anticipated to be supported in the future. [Default=OFF].
* `TA_SIGNED_1INDEX_TYPE` -- Set to `OFF` to use unsigned 1-index coordinate type (default for TiledArray 1.0.0-alpha.2 and older). The default is `ON`, which enables the use of negative indices in coordinates.
Expand Down
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -49,9 +49,9 @@ int main(int argc, char** argv) {
// Construct a 2D tiled range structure that defines
// the tiling of an array. Each dimension contains
// 10 tiles.
TA::TiledRange trange =
{ { 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 },
{ 0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100 } };
auto trange = TA::TiledRange{
TA::TiledRange1{0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100},
TA::TiledRange1{0, 10, 20, 30, 40, 50, 60, 70, 80, 90, 100}};
// Construct and fill the argument arrays with data
TA::TArrayD A(world, trange);
Expand Down
2 changes: 0 additions & 2 deletions bin/build-linux.sh
Original file line number Diff line number Diff line change
Expand Up @@ -96,7 +96,6 @@ if [ "$BUILD_TYPE" = "Debug" ]; then
-DCMAKE_PREFIX_PATH="${INSTALL_PREFIX}/madness;${INSTALL_PREFIX}/eigen3;${INSTALL_PREFIX}/boost" \
-DPYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}" \
-DTA_PYTHON="${TA_PYTHON}" \
-DTA_BUILD_UNITTEST=ON \
-DENABLE_SCALAPACK=ON

else
Expand Down Expand Up @@ -126,7 +125,6 @@ else
-DCMAKE_PREFIX_PATH="${INSTALL_PREFIX}/eigen3;${INSTALL_PREFIX}/boost" \
-DPYTHON_EXECUTABLE="${PYTHON_EXECUTABLE}" \
-DTA_PYTHON="${TA_PYTHON}" \
-DTA_BUILD_UNITTEST=ON \
-DENABLE_SCALAPACK=ON

fi
Expand Down
2 changes: 1 addition & 1 deletion bin/docker-build.sh
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ RUN apt-get update && apt-get install -y python3 ninja-build liblapacke-dev libl
RUN CMAKE_URL="https://cmake.org/files/v${CMAKE_VERSION%.[0-9]}/cmake-${CMAKE_VERSION}-Linux-x86_64.tar.gz" && wget --no-check-certificate -O - \$CMAKE_URL | tar --strip-components=1 -xz -C /usr/local
ENV CMAKE=/usr/local/bin/cmake
# 3. download and build TiledArray
RUN cd /usr/local/src && git clone --depth=1 https://github.com/ValeevGroup/tiledarray.git && cd /usr/local/src/tiledarray && mkdir build && cd build && \$CMAKE .. -G Ninja -DCMAKE_CXX_COMPILER=clang++-8 -DCMAKE_C_COMPILER=clang-8 -DTA_BUILD_UNITTEST=ON -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=RelWithDebInfo && \$CMAKE --build . --target tiledarray && \$CMAKE --build . --target check && $CMAKE --build . --target examples && \$CMAKE --build . --target install
RUN cd /usr/local/src && git clone --depth=1 https://github.com/ValeevGroup/tiledarray.git && cd /usr/local/src/tiledarray && mkdir build && cd build && \$CMAKE .. -G Ninja -DCMAKE_CXX_COMPILER=clang++-8 -DCMAKE_C_COMPILER=clang-8 -DCMAKE_INSTALL_PREFIX=/usr/local -DCMAKE_BUILD_TYPE=RelWithDebInfo && \$CMAKE --build . --target tiledarray && \$CMAKE --build . --target check && $CMAKE --build . --target examples && \$CMAKE --build . --target install
# Clean up APT when done.
RUN apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
Expand Down
41 changes: 0 additions & 41 deletions bin/gitlab-ci.sh

This file was deleted.

Loading

0 comments on commit b6478d0

Please sign in to comment.