Skip to content

Commit

Permalink
Merge pull request #101 from ECP-copa/github_actions
Browse files Browse the repository at this point in the history
Travis -> GitHub Actions
  • Loading branch information
streeve authored Mar 16, 2021
2 parents a8c1980 + 2a5d052 commit d66b2c5
Show file tree
Hide file tree
Showing 9 changed files with 187 additions and 147 deletions.
162 changes: 162 additions & 0 deletions .github/workflows/CI.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,162 @@
name: CI
on:
push:
branches:
- master
pull_request:
branches:
- master
schedule:
- cron: '0 5 * * *'

jobs:
CI:
strategy:
matrix:
distro: ['ubuntu:latest']
cxx: ['g++', 'clang++']
backend: ['SERIAL', 'OPENMP']
cmake_build_type: ['Debug', 'Release']
kokkos_ver: ['3.2.01']
arborx: ['ArborX', 'NoArborX']
nnp: ['ON', 'OFF']
layout: ['1']
vector: ['1']
layout_nnp: ['1']
vector_nnp: ['1']
include:
- distro: 'ubuntu:latest'
cxx: 'g++'
openmp: 'ON'
cmake_build_type: 'Release'
kokkos_ver: '3.2.01'
arborx: 'NoArborX'
nnp: 'OFF'
layout: '2'
vector: '64'
layout_nnp: '1'
vector_nnp: '1'
- distro: 'ubuntu:latest'
cxx: 'g++'
openmp: 'ON'
cmake_build_type: 'Release'
kokkos_ver: '3.2.01'
arborx: 'NoArborX'
nnp: 'ON'
layout: '6'
vector: '32'
layout_nnp: '3'
vector_nnp: '32'
- distro: 'ubuntu:latest'
cxx: 'g++'
openmp: 'ON'
cmake_build_type: 'Release'
kokkos_ver: '3.2.01'
arborx: 'NoArborX'
nnp: 'OFF'
layout: '6'
vector: '"1;8;32;1;8;32"'
layout_nnp: '3'
vector_nnp: '"32;8;1"'
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/[email protected]
with:
repository: kokkos/kokkos
ref: ${{ matrix.kokkos_ver }}
path: kokkos
- name: Build kokkos
working-directory: kokkos
run: |
cmake -B build \
-DCMAKE_INSTALL_PREFIX=$HOME/kokkos \
-DKokkos_ENABLE_OPENMP=${{ matrix.openmp }} \
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }} \
-DKokkos_ENABLE_HWLOC=ON \
-DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }}
cmake --build build --parallel 2
cmake --install build
- name: Checkout arborx
if: ${{ matrix.arborx == 'ArborX' }}
uses: actions/[email protected]
with:
repository: arborx/ArborX
ref: master
path: arborx
- name: Build arborx
if: ${{ matrix.arborx == 'ArborX' }}
working-directory: arborx
run: |
cmake -B build \
-DCMAKE_PREFIX_PATH=${HOME}/kokkos \
-DCMAKE_INSTALL_PREFIX=$HOME/arborx \
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }} \
-DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }}
cmake --build build --parallel 2
cmake --install build
- name: Checkout Cabana
uses: actions/[email protected]
with:
repository: ECP-CoPA/Cabana
ref: master
path: cabana
- name: Build Cabana
working-directory: cabana
run: |
cmake -B build \
-DCMAKE_INSTALL_PREFIX=$HOME/Cabana \
-DMPIEXEC_MAX_NUMPROCS=2 -DMPIEXEC_PREFLAGS="--oversubscribe" \
-DCMAKE_PREFIX_PATH="$HOME/kokkos;$HOME/arborx" \
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }} \
-DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }}
cmake --build build --parallel 2
cmake --install build
- name: Checkout n2p2
if: ${{ matrix.nnp == 'ON' }}
uses: actions/[email protected]
with:
repository: CompPhysVienna/n2p2
ref: v2.0.1
path: n2p2
- name: Build n2p2
if: ${{ matrix.nnp == 'ON' }}
working-directory: n2p2/src
run: |
mkdir -p $HOME/n2p2/include
mkdir -p $HOME/n2p2/lib
make libnnpif INTERFACES=CabanaMD PROJECT_INCLUDE=$HOME/n2p2/include PROJECT_LIB=$HOME/n2p2/lib
- name: Checkout CabanaMD
uses: actions/[email protected]
- name: Build CabanaMD
run: |
cmake -B build \
-DCMAKE_INSTALL_PREFIX=$HOME/CabanaMD \
-DMPIEXEC_MAX_NUMPROCS=2 -DMPIEXEC_PREFLAGS="--oversubscribe" \
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }} \
-DCMAKE_CXX_FLAGS="-Wall -Wextra -pedantic -Werror" \
-DCMAKE_PREFIX_PATH="$HOME/Cabana" \
-DCabanaMD_ENABLE_TESTING=ON \
-DCabanaMD_LAYOUT=${{ matrix.layout }} \
-DCabanaMD_VECTORLENGTH=${{ matrix.vector }} \
-DCabanaMD_ENABLE_NNP=${{ matrix.nnp }} \
-DN2P2_DIR=$HOME/n2p2 \
-DCabanaMD_LAYOUT_NNP=${{ matrix.layout_nnp }} \
-DCabanaMD_VECTORLENGTH_NNP=${{ matrix.vector_nnp }}
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
123 changes: 0 additions & 123 deletions .travis.yml

This file was deleted.

6 changes: 3 additions & 3 deletions src/binning_cabana_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -94,9 +94,9 @@ void Binning<t_System>::create_binning( T_X_FLOAT dx_in, T_X_FLOAT dy_in,
minz = -dz * halo_depth - eps + system->local_mesh_lo_z;
maxz = dz * halo_depth + eps + system->local_mesh_hi_z;

T_X_FLOAT delta[3] = {dx, dy, dz};
T_X_FLOAT min[3] = {minx, miny, minz};
T_X_FLOAT max[3] = {maxx, maxy, maxz};
T_X_FLOAT delta[3] = { dx, dy, dz };
T_X_FLOAT min[3] = { minx, miny, minz };
T_X_FLOAT max[3] = { maxx, maxy, maxz };

system->slice_x();
auto x = system->x;
Expand Down
6 changes: 3 additions & 3 deletions src/comm_mpi_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -100,9 +100,9 @@ void Comm<t_System>::create_domain_decomposition()

for ( int p = 0; p < 6; p++ )
{
neighbors_dist[p] = {proc_rank, proc_neighbors_send[p],
proc_neighbors_recv[p]};
neighbors_halo[p] = {proc_neighbors_send[p], proc_neighbors_recv[p]};
neighbors_dist[p] = { proc_rank, proc_neighbors_send[p],
proc_neighbors_recv[p] };
neighbors_halo[p] = { proc_neighbors_send[p], proc_neighbors_recv[p] };

std::sort( neighbors_halo[p].begin(), neighbors_halo[p].end() );
auto unique_end =
Expand Down
10 changes: 5 additions & 5 deletions src/inputFile_impl.h
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@ std::vector<std::string> split( const std::string &line )
{
// Split line on spaces and tabs
std::regex re( "[ \r\t\n]" );
std::sregex_token_iterator first{line.begin(), line.end(), re, -1}, last;
std::vector<std::string> words{first, last};
std::sregex_token_iterator first{ line.begin(), line.end(), re, -1 }, last;
std::vector<std::string> words{ first, last };
// Remove empty
words.erase(
std::remove_if( words.begin(), words.end(),
Expand Down Expand Up @@ -497,8 +497,8 @@ void InputFile<t_System>::create_lattice( Comm<t_System> *comm )
T_X_FLOAT max_x = lattice_constant * lattice_nx;
T_X_FLOAT max_y = lattice_constant * lattice_ny;
T_X_FLOAT max_z = lattice_constant * lattice_nz;
std::array<T_X_FLOAT, 3> global_low = {0.0, 0.0, 0.0};
std::array<T_X_FLOAT, 3> global_high = {max_x, max_y, max_z};
std::array<T_X_FLOAT, 3> global_low = { 0.0, 0.0, 0.0 };
std::array<T_X_FLOAT, 3> global_high = { max_x, max_y, max_z };
system->create_domain( global_low, global_high );
s = *system;

Expand Down Expand Up @@ -723,7 +723,7 @@ void InputFile<t_System>::create_lattice( Comm<t_System> *comm )
for ( T_INT i = 0; i < system->N_local; i++ )
{
LAMMPS_RandomVelocityGeom random;
double x_i[3] = {h_x( i, 0 ), h_x( i, 1 ), h_x( i, 2 )};
double x_i[3] = { h_x( i, 0 ), h_x( i, 1 ), h_x( i, 2 ) };
random.reset( temperature_seed, x_i );

T_FLOAT mass_i = h_mass( h_type( i ) );
Expand Down
8 changes: 4 additions & 4 deletions src/neighbor_types/neighbor_verlet.h
Original file line number Diff line number Diff line change
Expand Up @@ -44,10 +44,10 @@ class NeighborVerlet : public Neighbor<t_System>
{
T_INT N_local = system->N_local;

double grid_min[3] = {system->ghost_mesh_lo_x, system->ghost_mesh_lo_y,
system->ghost_mesh_lo_z};
double grid_max[3] = {system->ghost_mesh_hi_x, system->ghost_mesh_hi_y,
system->ghost_mesh_hi_z};
double grid_min[3] = { system->ghost_mesh_lo_x, system->ghost_mesh_lo_y,
system->ghost_mesh_lo_z };
double grid_max[3] = { system->ghost_mesh_hi_x, system->ghost_mesh_hi_y,
system->ghost_mesh_hi_z };

system->slice_x();
auto x = system->x;
Expand Down
2 changes: 1 addition & 1 deletion src/system.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ class SystemCommon
global_mesh_z = global_mesh->extent( 2 );

// Create the global grid.
std::array<bool, 3> is_periodic = {true, true, true};
std::array<bool, 3> is_periodic = { true, true, true };
auto global_grid = Cajita::createGlobalGrid(
MPI_COMM_WORLD, global_mesh, is_periodic, partitioner );

Expand Down
13 changes: 7 additions & 6 deletions unit_test/tstIntegrator.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ t_System createParticles( const int num_particle, const int num_ghost,
system.N_local = num_particle - num_ghost;
system.N_ghost = num_ghost;

system.create_domain( {box_min, box_min, box_min},
{box_max, box_max, box_max} );
system.create_domain( { box_min, box_min, box_min },
{ box_max, box_max, box_max } );

system.slice_integrate();
auto x = system.x;
Expand Down Expand Up @@ -112,10 +112,11 @@ void testIntegratorReversibility( int steps )
system.slice_v();
auto v = system.v;
Kokkos::RangePolicy<TEST_EXECSPACE> exec_policy( 0, num_particle );
Kokkos::parallel_for( exec_policy, KOKKOS_LAMBDA( const int p ) {
for ( int d = 0; d < 3; ++d )
v( p, d ) *= -1.0;
} );
Kokkos::parallel_for(
exec_policy, KOKKOS_LAMBDA( const int p ) {
for ( int d = 0; d < 3; ++d )
v( p, d ) *= -1.0;
} );

// Integrate back
for ( int s = 0; s < steps; ++s )
Expand Down
Loading

0 comments on commit d66b2c5

Please sign in to comment.