-
Notifications
You must be signed in to change notification settings - Fork 32
89 lines (80 loc) · 3.42 KB
/
github-actions-selfhosted.yml
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
name: Self-Hosted Integration test
on:
workflow_dispatch:
# workflow_run:
# workflows: [MBX+LAMMPS integration test]
# branches: [master]
# types:
# - completed
# push:
# branches: Actions-Test
jobs:
compile-mbxlammps:
runs-on: [self-hosted, epyc]
# if: ${{ github.event.workflow_run.conclusion == 'success' }}
steps:
- run: echo "The job was automatically triggered by a ${{ github.event_name }} event."
- run: echo "This job is now running on a ${{ runner.os }} server hosted by GitHub!"
- run: echo "The name of your branch is ${{ github.ref }} and your repository is ${{ github.repository }}."
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "The workflow is now ready to test your code on the runner."
- name: activate gnu compiler
run: |
module load gcc/12.2.0
echo "MPI_COMPILER=mpicxx" >> "$GITHUB_ENV"
- name: MBX-install
run: |
ls ${{ github.workspace }}
autoreconf -fi
./configure --enable-mpi CXX=${{ env.MPI_COMPILER }}
make -j 8
make install
echo "MBX_HOME=${{ github.workspace }}" >> "$GITHUB_ENV"
- name: LAMMPS-Install
run: |
export MBX_HOME=${{ env.MBX_HOME }}
git clone https://github.com/lammps/lammps.git -b stable
export LAMMPS_HOME=$PWD/lammps
export GITHUB_ACTIONS_MBX_LAMMPS_FLAGS=""
cp -r $MBX_HOME/plugins/lammps/USER-MBX $LAMMPS_HOME/src
cd $LAMMPS_HOME/src
make yes-USER-MBX yes-MOLECULE yes-KSPACE yes-RIGID yes-EXTRA-PAIR
make mpi_mbx CXX=${{ env.MPI_COMPILER }} -j 8
- name: Upload MBX+LAMMPS executable
uses: actions/upload-artifact@v4
with:
name: executable
path: ${{ github.workspace }}/lammps/src/lmp_mpi_mbx
retention-days: 1
test_mbxlammps:
strategy:
matrix:
example: [256h2o, 512h2o, 1024h2o, 2048h2o, na+_bulk, ch4, ch4_h2o]
runs-on: [self-hosted, epyc]
needs: compile-mbxlammps
steps:
- name: Check out repository code
uses: actions/checkout@v4
- run: echo "The ${{ github.repository }} repository has been cloned to the runner."
- run: echo "The workflow is now ready to test your code on the runner."
- name: Download executable from compilation
uses: actions/download-artifact@v4
with:
name: executable
- run: ls ${{ github.workspace }} -lth
- name: testing example ${{ matrix.example }}
run: |
chmod u+x lmp_mpi_mbx
ls ${{ github.workspace }}/lmp_mpi_mbx
cd ${{ github.workspace }}/plugins/lammps/examples/${{ matrix.example }}/
export OMP_NUM_THREADS=2
mpirun -np 8 ${{ github.workspace }}/lmp_mpi_mbx -in lammps.in
- run: ls ${{ github.workspace }}/plugins/lammps/examples/${{ matrix.example }}/ -lth
- name: log output
run: cat ${{ github.workspace }}/plugins/lammps/examples/${{ matrix.example }}/log.lammps
- name: thermo output
run: cat ${{ github.workspace }}/plugins/lammps/examples/${{ matrix.example }}/thermo.out
- name: performance output
run: cat ${{ github.workspace }}/plugins/lammps/examples/${{ matrix.example }}/performance.txt