Skip to content

Commit d66b2c5

Browse files
authored
Merge pull request #101 from ECP-copa/github_actions
Travis -> GitHub Actions
2 parents a8c1980 + 2a5d052 commit d66b2c5

File tree

9 files changed

+187
-147
lines changed

9 files changed

+187
-147
lines changed

.github/workflows/CI.yml

Lines changed: 162 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,162 @@
1+
name: CI
2+
on:
3+
push:
4+
branches:
5+
- master
6+
pull_request:
7+
branches:
8+
- master
9+
schedule:
10+
- cron: '0 5 * * *'
11+
12+
jobs:
13+
CI:
14+
strategy:
15+
matrix:
16+
distro: ['ubuntu:latest']
17+
cxx: ['g++', 'clang++']
18+
backend: ['SERIAL', 'OPENMP']
19+
cmake_build_type: ['Debug', 'Release']
20+
kokkos_ver: ['3.2.01']
21+
arborx: ['ArborX', 'NoArborX']
22+
nnp: ['ON', 'OFF']
23+
layout: ['1']
24+
vector: ['1']
25+
layout_nnp: ['1']
26+
vector_nnp: ['1']
27+
include:
28+
- distro: 'ubuntu:latest'
29+
cxx: 'g++'
30+
openmp: 'ON'
31+
cmake_build_type: 'Release'
32+
kokkos_ver: '3.2.01'
33+
arborx: 'NoArborX'
34+
nnp: 'OFF'
35+
layout: '2'
36+
vector: '64'
37+
layout_nnp: '1'
38+
vector_nnp: '1'
39+
- distro: 'ubuntu:latest'
40+
cxx: 'g++'
41+
openmp: 'ON'
42+
cmake_build_type: 'Release'
43+
kokkos_ver: '3.2.01'
44+
arborx: 'NoArborX'
45+
nnp: 'ON'
46+
layout: '6'
47+
vector: '32'
48+
layout_nnp: '3'
49+
vector_nnp: '32'
50+
- distro: 'ubuntu:latest'
51+
cxx: 'g++'
52+
openmp: 'ON'
53+
cmake_build_type: 'Release'
54+
kokkos_ver: '3.2.01'
55+
arborx: 'NoArborX'
56+
nnp: 'OFF'
57+
layout: '6'
58+
vector: '"1;8;32;1;8;32"'
59+
layout_nnp: '3'
60+
vector_nnp: '"32;8;1"'
61+
runs-on: ubuntu-20.04
62+
container: ghcr.io/ecp-copa/ci-containers/${{ matrix.distro }}
63+
steps:
64+
- name: Get trail license
65+
if: ${{ matrix.cxx == 'icpc' }}
66+
run: |
67+
mkdir ~/Licenses
68+
curl https://dynamicinstaller.intel.com/api/v2/license > ~/Licenses/intel.lic
69+
- name: Checkout kokkos
70+
uses: actions/checkout@v2.2.0
71+
with:
72+
repository: kokkos/kokkos
73+
ref: ${{ matrix.kokkos_ver }}
74+
path: kokkos
75+
- name: Build kokkos
76+
working-directory: kokkos
77+
run: |
78+
cmake -B build \
79+
-DCMAKE_INSTALL_PREFIX=$HOME/kokkos \
80+
-DKokkos_ENABLE_OPENMP=${{ matrix.openmp }} \
81+
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }} \
82+
-DKokkos_ENABLE_HWLOC=ON \
83+
-DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }}
84+
cmake --build build --parallel 2
85+
cmake --install build
86+
- name: Checkout arborx
87+
if: ${{ matrix.arborx == 'ArborX' }}
88+
uses: actions/checkout@v2.2.0
89+
with:
90+
repository: arborx/ArborX
91+
ref: master
92+
path: arborx
93+
- name: Build arborx
94+
if: ${{ matrix.arborx == 'ArborX' }}
95+
working-directory: arborx
96+
run: |
97+
cmake -B build \
98+
-DCMAKE_PREFIX_PATH=${HOME}/kokkos \
99+
-DCMAKE_INSTALL_PREFIX=$HOME/arborx \
100+
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }} \
101+
-DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }}
102+
cmake --build build --parallel 2
103+
cmake --install build
104+
- name: Checkout Cabana
105+
uses: actions/checkout@v2.2.0
106+
with:
107+
repository: ECP-CoPA/Cabana
108+
ref: master
109+
path: cabana
110+
- name: Build Cabana
111+
working-directory: cabana
112+
run: |
113+
cmake -B build \
114+
-DCMAKE_INSTALL_PREFIX=$HOME/Cabana \
115+
-DMPIEXEC_MAX_NUMPROCS=2 -DMPIEXEC_PREFLAGS="--oversubscribe" \
116+
-DCMAKE_PREFIX_PATH="$HOME/kokkos;$HOME/arborx" \
117+
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }} \
118+
-DCMAKE_BUILD_TYPE=${{ matrix.cmake_build_type }}
119+
cmake --build build --parallel 2
120+
cmake --install build
121+
- name: Checkout n2p2
122+
if: ${{ matrix.nnp == 'ON' }}
123+
uses: actions/checkout@v2.2.0
124+
with:
125+
repository: CompPhysVienna/n2p2
126+
ref: v2.0.1
127+
path: n2p2
128+
- name: Build n2p2
129+
if: ${{ matrix.nnp == 'ON' }}
130+
working-directory: n2p2/src
131+
run: |
132+
mkdir -p $HOME/n2p2/include
133+
mkdir -p $HOME/n2p2/lib
134+
make libnnpif INTERFACES=CabanaMD PROJECT_INCLUDE=$HOME/n2p2/include PROJECT_LIB=$HOME/n2p2/lib
135+
- name: Checkout CabanaMD
136+
uses: actions/checkout@v2.2.0
137+
- name: Build CabanaMD
138+
run: |
139+
cmake -B build \
140+
-DCMAKE_INSTALL_PREFIX=$HOME/CabanaMD \
141+
-DMPIEXEC_MAX_NUMPROCS=2 -DMPIEXEC_PREFLAGS="--oversubscribe" \
142+
-DCMAKE_CXX_COMPILER=${{ matrix.cxx }} \
143+
-DCMAKE_CXX_FLAGS="-Wall -Wextra -pedantic -Werror" \
144+
-DCMAKE_PREFIX_PATH="$HOME/Cabana" \
145+
-DCabanaMD_ENABLE_TESTING=ON \
146+
-DCabanaMD_LAYOUT=${{ matrix.layout }} \
147+
-DCabanaMD_VECTORLENGTH=${{ matrix.vector }} \
148+
-DCabanaMD_ENABLE_NNP=${{ matrix.nnp }} \
149+
-DN2P2_DIR=$HOME/n2p2 \
150+
-DCabanaMD_LAYOUT_NNP=${{ matrix.layout_nnp }} \
151+
-DCabanaMD_VECTORLENGTH_NNP=${{ matrix.vector_nnp }}
152+
cmake --build build --parallel 2
153+
CTEST_OUTPUT_ON_FAILURE=1 cmake --build build --target test
154+
cmake --install build
155+
- name: Format CabanaMD
156+
working-directory: build
157+
run: |
158+
make format
159+
git diff --exit-code
160+
- name: Upload Report to codecov.io
161+
if: ${{ matrix.coverage }}
162+
uses: codecov/codecov-action@v1

.travis.yml

Lines changed: 0 additions & 123 deletions
This file was deleted.

src/binning_cabana_impl.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,9 +94,9 @@ void Binning<t_System>::create_binning( T_X_FLOAT dx_in, T_X_FLOAT dy_in,
9494
minz = -dz * halo_depth - eps + system->local_mesh_lo_z;
9595
maxz = dz * halo_depth + eps + system->local_mesh_hi_z;
9696

97-
T_X_FLOAT delta[3] = {dx, dy, dz};
98-
T_X_FLOAT min[3] = {minx, miny, minz};
99-
T_X_FLOAT max[3] = {maxx, maxy, maxz};
97+
T_X_FLOAT delta[3] = { dx, dy, dz };
98+
T_X_FLOAT min[3] = { minx, miny, minz };
99+
T_X_FLOAT max[3] = { maxx, maxy, maxz };
100100

101101
system->slice_x();
102102
auto x = system->x;

src/comm_mpi_impl.h

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -100,9 +100,9 @@ void Comm<t_System>::create_domain_decomposition()
100100

101101
for ( int p = 0; p < 6; p++ )
102102
{
103-
neighbors_dist[p] = {proc_rank, proc_neighbors_send[p],
104-
proc_neighbors_recv[p]};
105-
neighbors_halo[p] = {proc_neighbors_send[p], proc_neighbors_recv[p]};
103+
neighbors_dist[p] = { proc_rank, proc_neighbors_send[p],
104+
proc_neighbors_recv[p] };
105+
neighbors_halo[p] = { proc_neighbors_send[p], proc_neighbors_recv[p] };
106106

107107
std::sort( neighbors_halo[p].begin(), neighbors_halo[p].end() );
108108
auto unique_end =

src/inputFile_impl.h

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -56,8 +56,8 @@ std::vector<std::string> split( const std::string &line )
5656
{
5757
// Split line on spaces and tabs
5858
std::regex re( "[ \r\t\n]" );
59-
std::sregex_token_iterator first{line.begin(), line.end(), re, -1}, last;
60-
std::vector<std::string> words{first, last};
59+
std::sregex_token_iterator first{ line.begin(), line.end(), re, -1 }, last;
60+
std::vector<std::string> words{ first, last };
6161
// Remove empty
6262
words.erase(
6363
std::remove_if( words.begin(), words.end(),
@@ -497,8 +497,8 @@ void InputFile<t_System>::create_lattice( Comm<t_System> *comm )
497497
T_X_FLOAT max_x = lattice_constant * lattice_nx;
498498
T_X_FLOAT max_y = lattice_constant * lattice_ny;
499499
T_X_FLOAT max_z = lattice_constant * lattice_nz;
500-
std::array<T_X_FLOAT, 3> global_low = {0.0, 0.0, 0.0};
501-
std::array<T_X_FLOAT, 3> global_high = {max_x, max_y, max_z};
500+
std::array<T_X_FLOAT, 3> global_low = { 0.0, 0.0, 0.0 };
501+
std::array<T_X_FLOAT, 3> global_high = { max_x, max_y, max_z };
502502
system->create_domain( global_low, global_high );
503503
s = *system;
504504

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

729729
T_FLOAT mass_i = h_mass( h_type( i ) );

src/neighbor_types/neighbor_verlet.h

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -44,10 +44,10 @@ class NeighborVerlet : public Neighbor<t_System>
4444
{
4545
T_INT N_local = system->N_local;
4646

47-
double grid_min[3] = {system->ghost_mesh_lo_x, system->ghost_mesh_lo_y,
48-
system->ghost_mesh_lo_z};
49-
double grid_max[3] = {system->ghost_mesh_hi_x, system->ghost_mesh_hi_y,
50-
system->ghost_mesh_hi_z};
47+
double grid_min[3] = { system->ghost_mesh_lo_x, system->ghost_mesh_lo_y,
48+
system->ghost_mesh_lo_z };
49+
double grid_max[3] = { system->ghost_mesh_hi_x, system->ghost_mesh_hi_y,
50+
system->ghost_mesh_hi_z };
5151

5252
system->slice_x();
5353
auto x = system->x;

src/system.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -141,7 +141,7 @@ class SystemCommon
141141
global_mesh_z = global_mesh->extent( 2 );
142142

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

unit_test/tstIntegrator.hpp

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -43,8 +43,8 @@ t_System createParticles( const int num_particle, const int num_ghost,
4343
system.N_local = num_particle - num_ghost;
4444
system.N_ghost = num_ghost;
4545

46-
system.create_domain( {box_min, box_min, box_min},
47-
{box_max, box_max, box_max} );
46+
system.create_domain( { box_min, box_min, box_min },
47+
{ box_max, box_max, box_max } );
4848

4949
system.slice_integrate();
5050
auto x = system.x;
@@ -112,10 +112,11 @@ void testIntegratorReversibility( int steps )
112112
system.slice_v();
113113
auto v = system.v;
114114
Kokkos::RangePolicy<TEST_EXECSPACE> exec_policy( 0, num_particle );
115-
Kokkos::parallel_for( exec_policy, KOKKOS_LAMBDA( const int p ) {
116-
for ( int d = 0; d < 3; ++d )
117-
v( p, d ) *= -1.0;
118-
} );
115+
Kokkos::parallel_for(
116+
exec_policy, KOKKOS_LAMBDA( const int p ) {
117+
for ( int d = 0; d < 3; ++d )
118+
v( p, d ) *= -1.0;
119+
} );
119120

120121
// Integrate back
121122
for ( int s = 0; s < steps; ++s )

0 commit comments

Comments
 (0)