Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update CI #108

Merged
merged 7 commits into from
Jan 9, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
38 changes: 12 additions & 26 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
Expand Up @@ -6,8 +6,6 @@ on:
pull_request:
branches:
- master
schedule:
- cron: '0 5 * * *'

jobs:
CI:
Expand All @@ -17,7 +15,7 @@ jobs:
cxx: ['g++', 'clang++']
backend: ['SERIAL', 'OPENMP']
cmake_build_type: ['Debug', 'Release']
kokkos_ver: ['3.2.01']
kokkos_ver: ['3.7.02']
arborx: ['ArborX', 'NoArborX']
nnp: ['ON', 'OFF']
layout: ['1']
Expand All @@ -29,7 +27,7 @@ jobs:
cxx: 'g++'
openmp: 'ON'
cmake_build_type: 'Release'
kokkos_ver: '3.2.01'
kokkos_ver: '3.7.02'
arborx: 'NoArborX'
nnp: 'OFF'
layout: '2'
Expand All @@ -40,7 +38,7 @@ jobs:
cxx: 'g++'
openmp: 'ON'
cmake_build_type: 'Release'
kokkos_ver: '3.2.01'
kokkos_ver: '3.7.02'
arborx: 'NoArborX'
nnp: 'ON'
layout: '6'
Expand All @@ -51,7 +49,7 @@ jobs:
cxx: 'g++'
openmp: 'ON'
cmake_build_type: 'Release'
kokkos_ver: '3.2.01'
kokkos_ver: '3.7.02'
arborx: 'NoArborX'
nnp: 'OFF'
layout: '6'
Expand All @@ -61,13 +59,8 @@ jobs:
runs-on: ubuntu-20.04
container: ghcr.io/ecp-copa/ci-containers/${{ matrix.distro }}
steps:
- name: Get trail license
if: ${{ matrix.cxx == 'icpc' }}
run: |
mkdir ~/Licenses
curl https://dynamicinstaller.intel.com/api/v2/license > ~/Licenses/intel.lic
- name: Checkout kokkos
uses: actions/checkout@v2.2.0
uses: actions/checkout@v3
with:
repository: kokkos/kokkos
ref: ${{ matrix.kokkos_ver }}
Expand All @@ -85,10 +78,10 @@ jobs:
cmake --install build
- name: Checkout arborx
if: ${{ matrix.arborx == 'ArborX' }}
uses: actions/checkout@v2.2.0
uses: actions/checkout@v3
with:
repository: arborx/ArborX
ref: master
ref: v1.4.1
path: arborx
- name: Build arborx
if: ${{ matrix.arborx == 'ArborX' }}
Expand All @@ -102,10 +95,10 @@ jobs:
cmake --build build --parallel 2
cmake --install build
- name: Checkout Cabana
uses: actions/checkout@v2.2.0
uses: actions/checkout@v3
with:
repository: ECP-CoPA/Cabana
ref: master
ref: 0.6.1
path: cabana
- name: Build Cabana
working-directory: cabana
Expand All @@ -115,12 +108,13 @@ jobs:
-DMPIEXEC_MAX_NUMPROCS=2 -DMPIEXEC_PREFLAGS="--oversubscribe" \
-DCMAKE_PREFIX_PATH="$HOME/kokkos;$HOME/arborx" \
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }} \
-DCabana_DISABLE_CAJITA_DEPRECATION_WARNINGS=ON \
-DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }}
cmake --build build --parallel 2
cmake --install build
- name: Checkout n2p2
if: ${{ matrix.nnp == 'ON' }}
uses: actions/checkout@v2.2.0
uses: actions/checkout@v3
with:
repository: CompPhysVienna/n2p2
ref: v2.0.1
Expand All @@ -133,7 +127,7 @@ jobs:
mkdir -p $HOME/n2p2/lib
make libnnpif INTERFACES=CabanaMD PROJECT_INCLUDE=$HOME/n2p2/include PROJECT_LIB=$HOME/n2p2/lib
- name: Checkout CabanaMD
uses: actions/checkout@v2.2.0
uses: actions/checkout@v3
- name: Build CabanaMD
run: |
cmake -B build \
Expand All @@ -152,11 +146,3 @@ jobs:
cmake --build build --parallel 2
CTEST_OUTPUT_ON_FAILURE=1 cmake --build build --target test
cmake --install build
- name: Format CabanaMD
working-directory: build
run: |
make format
git diff --exit-code
- name: Upload Report to codecov.io
if: ${{ matrix.coverage }}
uses: codecov/codecov-action@v1
64 changes: 64 additions & 0 deletions .github/workflows/Weekly.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: Nightly
on:
workflow_dispatch:
schedule:
- cron: '30 6 * * 1'

jobs:
CI:
strategy:
matrix:
backend: ["OPENMP", "SERIAL"]
cmake_build_type: ['Release']
runs-on: ubuntu-20.04
container: ghcr.io/ecp-copa/ci-containers/ubuntu:latest
steps:
- name: Checkout kokkos
uses: actions/checkout@v3
with:
repository: kokkos/kokkos
ref: develop
path: kokkos
- name: Build kokkos
working-directory: kokkos
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} \
-DCMAKE_INSTALL_PREFIX=$HOME/kokkos \
-DKokkos_ENABLE_${{ matrix.backend }}=ON \
-DKokkos_ENABLE_DEPRECATED_CODE_3=OFF
cmake --build build --parallel 2
cmake --install build
- name: Checkout Cabana
uses: actions/checkout@v3
with:
repository: ECP-CoPA/Cabana
ref: master
path: cabana
- name: Build Cabana
working-directory: cabana
run: |
cmake -B build \
-DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} \
-DCMAKE_INSTALL_PREFIX=$HOME/Cabana \
-DCMAKE_PREFIX_PATH="$HOME/kokkos" \
-DCabana_DISABLE_CAJITA_DEPRECATION_WARNINGS=ON
cmake --build build --parallel 2
cmake --install build
- name: Checkout CabanaMD
uses: actions/checkout@v3
- name: Build CabanaMD
run: |
cmake -B build \
-D CMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }} \
-D CMAKE_CXX_FLAGS="-Wall -Wextra -pedantic -Werror" \
-D CMAKE_INSTALL_PREFIX=$HOME/CabanaPD \
-D CMAKE_PREFIX_PATH="$HOME/Cabana" \
-D MPIEXEC_MAX_NUMPROCS=2 \
-D MPIEXEC_PREFLAGS="--oversubscribe" \
-D CabanaPD_ENABLE_TESTING=ON
cmake --build build --parallel 2
cmake --install build
- name: Test CabanaPD
run: |
CTEST_OUTPUT_ON_FAILURE=1 cmake --build build --target test
12 changes: 12 additions & 0 deletions .github/workflows/format.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
name: Clang-Format Check
on: [pull_request]
jobs:
formatting-check:
name: Formatting Check
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v3
- name: Run clang-format style check
uses: jidicula/[email protected]
with:
clang-format-version: '10'
36 changes: 10 additions & 26 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -13,37 +13,11 @@ include(GNUInstallDirs)

set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/cmake)

##---------------------------------------------------------------------------##
# Download and unpack googletest
##---------------------------------------------------------------------------##
include(FetchContent)
FetchContent_Declare(
googletest
GIT_REPOSITORY https://github.com/google/googletest.git
GIT_TAG release-1.10.0
)
FetchContent_GetProperties(googletest)
if(NOT googletest_POPULATED)
FetchContent_Populate(googletest)
add_subdirectory(${googletest_SOURCE_DIR} ${googletest_BINARY_DIR})
endif()

# Prevent GoogleTest from overriding our compiler/linker options
# when building with Visual Studio
set(gtest_force_shared_crt ON CACHE BOOL "" FORCE)

##---------------------------------------------------------------------------##
# Set up main options (inherit from Kokkos and Cabana CMake)
##---------------------------------------------------------------------------##
find_package(Cabana REQUIRED)

if( NOT Cabana_ENABLE_MPI )
message( FATAL_ERROR "Cabana must be compiled with MPI" )
endif()
if( NOT Cabana_ENABLE_CAJITA )
message( FATAL_ERROR "Cabana must be compiled with Cajita" )
endif()

##---------------------------------------------------------------------------##
# Set up optional libraries
##---------------------------------------------------------------------------##
Expand Down Expand Up @@ -78,6 +52,16 @@ add_subdirectory(bin)
##---------------------------------------------------------------------------##
option(CabanaMD_ENABLE_TESTING "Build tests" OFF)
if(CabanaMD_ENABLE_TESTING)
find_package(GTest 1.10 REQUIRED)
# Workaround for FindGTest module in CMake older than 3.20
if(TARGET GTest::gtest)
set(gtest_target GTest::gtest)
elseif(TARGET GTest::GTest)
set(gtest_target GTest::GTest)
else()
message(FATAL_ERROR "bug in GTest find module workaround")
endif()

enable_testing()
add_subdirectory(unit_test)
endif()
Expand Down
2 changes: 1 addition & 1 deletion src/cabanamd_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ void CbnMD<t_System, t_Neighbor>::init( InputCL commandline )

using exe_space = typename t_System::execution_space;
if ( print_rank() )
exe_space::print_configuration( out );
exe_space().print_configuration( out );

#ifndef CabanaMD_ENABLE_NNP
// Check that the requested pair_style was compiled
Expand Down
4 changes: 2 additions & 2 deletions src/neighbor_types/neighbor_tree.h
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ class NeighborTree<t_System, t_iteration, Cabana::VerletLayoutCSR>
auto x = system->x;

t_iteration tag;
list = Cabana::Experimental::makeNeighborList<device_type>(
list = Cabana::Experimental::makeNeighborList(
tag, x, 0, N_local, neigh_cut, max_neigh_guess );
}

Expand Down Expand Up @@ -100,7 +100,7 @@ class NeighborTree<t_System, t_iteration, Cabana::VerletLayout2D>
auto x = system->x;

t_iteration tag;
list = Cabana::Experimental::make2DNeighborList<device_type>(
list = Cabana::Experimental::make2DNeighborList(
tag, x, 0, N_local, neigh_cut, max_neigh_guess );
}

Expand Down
2 changes: 1 addition & 1 deletion src/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -129,7 +129,7 @@ class SystemCommon
std::array<double, 3> high_corner )
{
// Create the MPI partitions.
Cajita::UniformDimPartitioner partitioner;
Cajita::DimBlockPartitioner<3> partitioner;
ranks_per_dim = partitioner.ranksPerDimension( MPI_COMM_WORLD, {} );

// Create global mesh of MPI partitions.
Expand Down
4 changes: 1 addition & 3 deletions unit_test/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,3 @@
set(gtest_args --gtest_color=yes)

##--------------------------------------------------------------------------##
## On-node tests
##--------------------------------------------------------------------------##
Expand Down Expand Up @@ -30,7 +28,7 @@ macro(CabanaMD_add_tests)
set(_target ${_test}_test_${_uppercase_device})
add_executable(${_target} ${_file} ${CABANAMD_UNIT_TEST_MAIN})
target_include_directories(${_target} PRIVATE ${_dir} ${CMAKE_CURRENT_SOURCE_DIR})
target_link_libraries(${_target} PRIVATE CabanaMD gtest CabanaMD)
target_link_libraries(${_target} PRIVATE CabanaMD ${gtest_target} CabanaMD)

foreach(_np ${CABANAMD_UNIT_TEST_MPIEXEC_NUMPROCS})
if(_device STREQUAL PTHREAD OR _device STREQUAL OPENMP)
Expand Down