Skip to content

Commit

Permalink
cmake build and CI testing (#67)
Browse files Browse the repository at this point in the history
Add cmake build system and CI testing
  • Loading branch information
rfhaque authored Jan 25, 2024
1 parent d6537e2 commit 667cf12
Show file tree
Hide file tree
Showing 12 changed files with 729 additions and 9 deletions.
64 changes: 64 additions & 0 deletions .github/workflows/cuda.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,64 @@
name: GNU MPI+CUDA CI

on:
push:
branches: [ "master", "dev" ]
paths-ignore:
- LICENSE.md
- README.md
pull_request:
branches: [ "master", "dev" ]

jobs:
build_and_test:
runs-on: ubuntu-20.04

strategy:
matrix:
cuda_pkg: [11-0]
include:
- cuda_ver: "11.0"
cuda_pkg: 11-0
cuda_extra: libcurand-dev-11-0 cuda-cupti-dev-11-0 libcusolver-dev-11-0 libcublas-dev-11-0 libcusparse-dev-11-0
env:
CXX: nvcc
CXXFLAGS: -arch=compute_70 -code=sm_70 -Xptxas -v -ccbin mpicxx -g -O3 -DHAVE_MPI -DHAVE_CUDA -DHAVE_ASYNC_MPI -std=c++14
CPPFLAGS: -DHAVE_MPI -DHAVE_CUDA -DHAVE_ASYNC_MPI -x cu -dc -std=c++14 -Xcompiler -Wall
LDFLAGS: -lmpi -lcuda -lcudart

steps:
- name: Check out code
uses: actions/checkout@v3

- name: Install MPI
run: |
sudo apt-get update
sudo apt-get install -y openmpi-bin libopenmpi-dev
- name: Prepare CUDA environment
run: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu2004/x86_64/7fa2af80.pub
echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 /" | sudo tee /etc/apt/sources.list.d/cuda.list
echo "deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu2004/x86_64 /" | sudo tee /etc/apt/sources.list.d/nvidia-ml.list
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
cuda-command-line-tools-${{matrix.cuda_pkg}} cuda-compiler-${{matrix.cuda_pkg}} cuda-minimal-build-${{matrix.cuda_pkg}} cuda-nvml-dev-${{matrix.cuda_pkg}} cuda-nvtx-${{matrix.cuda_pkg}} ${{matrix.cuda_extra}}
- name: Clean up
run: |
cd ${{runner.workspace}}/Quicksilver/src
make clean
- name: Make the code
run: |
cd ${{runner.workspace}}/Quicksilver/src
export PATH=/usr/local/nvidia/bin:/usr/local/cuda-${{matrix.cuda_ver}}/bin:${PATH}
export LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/cuda-${{matrix.cuda_ver}}/lib64:/usr/local/cuda-${{matrix.cuda_ver}}/lib:${LD_LIBRARY_PATH}
make CXX="$CXX" CXXFLAGS="$CXXFLAGS" CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" -j4
# - name: Run smoke test
# run: |
# export LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/cuda-${{matrix.cuda_ver}}/lib64:/usr/local/cuda-${{matrix.cuda_ver}}/lib:${LD_LIBRARY_PATH}
# mpirun -n 1 ${{runner.workspace}}/Quicksilver/src/qs
62 changes: 62 additions & 0 deletions .github/workflows/cuda_cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: CMAKE GNU MPI+CUDA CI

on:
push:
branches: [ "master", "dev" ]
paths-ignore:
- LICENSE.md
- README.md
pull_request:
branches: [ "master", "dev" ]

jobs:
build_and_test:
runs-on: ubuntu-20.04

strategy:
matrix:
cuda_pkg: [11-0]
include:
- cuda_ver: "11.0"
cuda_pkg: 11-0
cuda_extra: libcurand-dev-11-0 cuda-cupti-dev-11-0 libcusolver-dev-11-0 libcublas-dev-11-0 libcusparse-dev-11-0

steps:
- name: Check out code
uses: actions/checkout@v3

- name: Install MPI
run: |
sudo apt update
sudo apt install -y mpich
which mpicc
which mpicxx
- name: Prepare CUDA environment
run: |
export DEBIAN_FRONTEND=noninteractive
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64/3bf863cc.pub
sudo apt-key adv --fetch-keys https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu2004/x86_64/7fa2af80.pub
echo "deb https://developer.download.nvidia.com/compute/cuda/repos/ubuntu2004/x86_64 /" | sudo tee /etc/apt/sources.list.d/cuda.list
echo "deb https://developer.download.nvidia.com/compute/machine-learning/repos/ubuntu2004/x86_64 /" | sudo tee /etc/apt/sources.list.d/nvidia-ml.list
sudo apt-get update
sudo apt-get install -y --no-install-recommends \
cuda-command-line-tools-${{matrix.cuda_pkg}} cuda-compiler-${{matrix.cuda_pkg}} cuda-minimal-build-${{matrix.cuda_pkg}} cuda-nvml-dev-${{matrix.cuda_pkg}} cuda-nvtx-${{matrix.cuda_pkg}} ${{matrix.cuda_extra}}
- name: Clean up
run: |
rm -rf ${{runner.workspace}}/Quicksilver/build
mkdir ${{runner.workspace}}/Quicksilver/build
- name: Make the code
run: |
cd ${{runner.workspace}}/Quicksilver/build
export PATH=/usr/local/nvidia/bin:/usr/local/cuda-${{matrix.cuda_ver}}/bin:${PATH}
export LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/cuda-${{matrix.cuda_ver}}/lib64:/usr/local/cuda-${{matrix.cuda_ver}}/lib:${LD_LIBRARY_PATH}
cmake .. -DCMAKE_CUDA_COMPILER=nvcc -DENABLE_MPI=ON -DENABLE_OMP=OFF -DENABLE_CUDA=ON -DCUDA_ARCH=70
make -j16
# - name: Run smoke test
# run: |
# export LD_LIBRARY_PATH=/usr/local/nvidia/lib:/usr/local/nvidia/lib64:/usr/local/cuda-${{matrix.cuda_ver}}/lib64:/usr/local/cuda-${{matrix.cuda_ver}}/lib:${LD_LIBRARY_PATH}
# mpirun -n 1 ${{runner.workspace}}/Quicksilver/src/qs
62 changes: 62 additions & 0 deletions .github/workflows/hip.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
name: GNU MPI+HIP CI

on:
push:
branches: [ "master", "dev" ]
paths-ignore:
- LICENSE.md
- README.md
pull_request:
branches: [ "master", "dev" ]

jobs:
build_and_test:
runs-on: ubuntu-20.04

env:
OMPI_CC: hipcc
CXX: mpicc
CXXFLAGS: -g
CPPFLAGS: -DHAVE_MPI -DHAVE_HIP -x hip --offload-arch=gfx90a -fgpu-rdc -Wno-unused-result -g -O3 -std=c++14 -Wall
LDFLAGS: -fgpu-rdc --offload-arch=gfx90a --hip-link

steps:
- name: Check out code
uses: actions/checkout@v3

- name: Install MPI
run: |
sudo apt-get update
sudo apt-get install -y openmpi-bin libopenmpi-dev
which mpicc
- name: Install ROCm dependencies
run: |
set -eu -o pipefail
wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | sudo apt-key add -
echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/debian/ ubuntu main' | sudo tee /etc/apt/sources.list.d/rocm.list
echo 'export PATH=/opt/rocm/llvm/bin:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin:$PATH' | sudo tee -a /etc/profile.d/rocm.sh
sudo apt-get update
sudo apt-get install -y --no-install-recommends build-essential rocm-dev roctracer-dev rocprofiler-dev rocrand-dev rocprim-dev rocfft rocprim rocrand
source /etc/profile.d/rocm.sh
hipcc --version
which clang
which clang++
- name: Clean up
run: |
cd ${{runner.workspace}}/Quicksilver/src
make clean
- name: Make the code
run: |
source /etc/profile.d/rocm.sh
hipcc --version
which clang
which clang++
cd ${{runner.workspace}}/Quicksilver/src
make CXX="$CXX" CXXFLAGS="$CXXFLAGS" CPPFLAGS="$CPPFLAGS" LDFLAGS="$LDFLAGS" -j4
# - name: Run smoke test
# run: |
# mpirun -n 1 ${{runner.workspace}}/Quicksilver/src/qs
57 changes: 57 additions & 0 deletions .github/workflows/hip_cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,57 @@
name: CMAKE GNU MPI+HIP CI

on:
push:
branches: [ "master", "dev" ]
paths-ignore:
- LICENSE.md
- README.md
pull_request:
branches: [ "master", "dev" ]

jobs:
build_and_test:
runs-on: ubuntu-20.04

steps:
- name: Check out code
uses: actions/checkout@v3

- name: Install MPI
run: |
sudo apt update
sudo apt install -y mpich
which mpicc
which mpicxx
- name: Install ROCm dependencies
run: |
set -eu -o pipefail
wget -q -O - https://repo.radeon.com/rocm/rocm.gpg.key | sudo apt-key add -
echo 'deb [arch=amd64] https://repo.radeon.com/rocm/apt/debian/ ubuntu main' | sudo tee /etc/apt/sources.list.d/rocm.list
echo 'export PATH=/opt/rocm/llvm/bin:/opt/rocm/bin:/opt/rocm/profiler/bin:/opt/rocm/opencl/bin:$PATH' | sudo tee -a /etc/profile.d/rocm.sh
sudo apt-get update
sudo apt-get install -y --no-install-recommends build-essential rocm-dev roctracer-dev rocprofiler-dev rocrand-dev rocprim-dev rocfft rocprim rocrand
source /etc/profile.d/rocm.sh
hipcc --version
which clang
which clang++
- name: Clean up
run: |
rm -rf ${{runner.workspace}}/Quicksilver/build
mkdir ${{runner.workspace}}/Quicksilver/build
- name: Make the code
run: |
source /etc/profile.d/rocm.sh
hipcc --version
which clang
which clang++
cd ${{runner.workspace}}/Quicksilver/build
cmake .. -DHIP_PATH=/opt/rocm/hip -DROCM_PATH=/opt/rocm -DCMAKE_C_COMPILER=hipcc -DCMAKE_CXX_COMPILER=hipcc -DENABLE_MPI=ON -DENABLE_OMP=OFF -DENABLE_HIP=ON -DHIP_ARCH=gfx908
make -j16
# - name: Run smoke test
# run: |
# mpirun -n 1 ${{runner.workspace}}/Quicksilver/src/qs
42 changes: 42 additions & 0 deletions .github/workflows/mpi.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
name: GNU MPI CI

on:
push:
branches: [ "master", "dev" ]
paths-ignore:
- LICENSE.md
- README.md
pull_request:
branches: [ "master", "dev" ]

jobs:
build_and_test:
runs-on: ubuntu-latest

env:
CXX: mpic++
CXXFLAGS: -g -O3 -DHAVE_MPI -DHAVE_ASYNC_MPI -std=c++14 -Wall
LDFLAGS: -lmpi

steps:
- name: Check out code
uses: actions/checkout@v3

- name: Install MPI
run: |
sudo apt-get update
sudo apt-get install -y openmpi-bin libopenmpi-dev
- name: Clean up
run: |
cd ${{runner.workspace}}/Quicksilver/src
make clean
- name: Make the code
run: |
cd ${{runner.workspace}}/Quicksilver/src
make CXX="$CXX" CXXFLAGS="$CXXFLAGS" CPPFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" -j4
- name: Run smoke test
run: |
mpirun -n 1 ${{runner.workspace}}/Quicksilver/src/qs
40 changes: 40 additions & 0 deletions .github/workflows/mpi_cmake.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,40 @@
name: CMAKE GNU MPI CI

on:
push:
branches: [ "master", "dev" ]
paths-ignore:
- LICENSE.md
- README.md
pull_request:
branches: [ "master", "dev" ]

jobs:
build_and_test:
runs-on: ubuntu-latest

steps:
- name: Check out code
uses: actions/checkout@v3

- name: Install MPI
run: |
sudo apt update
sudo apt install -y mpich
which mpicc
which mpicxx
- name: Clean up
run: |
rm -rf ${{runner.workspace}}/Quicksilver/build
mkdir ${{runner.workspace}}/Quicksilver/build
- name: Make the code
run: |
cd ${{runner.workspace}}/Quicksilver/build
cmake .. -DENABLE_MPI=ON
make -j16
- name: Run smoke test
run: |
mpirun -n 1 ${{runner.workspace}}/Quicksilver/build/qs
47 changes: 47 additions & 0 deletions .github/workflows/openmp.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: GNU MPI+OpenMP CI

on:
push:
branches: [ "master", "dev" ]
paths-ignore:
- LICENSE.md
- README.md
pull_request:
branches: [ "master", "dev" ]

jobs:
build_and_test:
runs-on: ubuntu-latest

env:
CXX: mpic++
CXXFLAGS: -g -O3 -DHAVE_MPI -DHAVE_ASYNC_MPI -std=c++14 -Wall -fopenmp -DHAVE_OPENMP
LDFLAGS: -lmpi -fopenmp

strategy:
matrix:
omp_num_threads: [1, 2, 4, 8]

steps:
- name: Check out code
uses: actions/checkout@v3

- name: Install MPI
run: |
sudo apt-get update
sudo apt-get install -y openmpi-bin libopenmpi-dev
- name: Clean up
run: |
cd ${{runner.workspace}}/Quicksilver/src
make clean
- name: Make the code
run: |
cd ${{runner.workspace}}/Quicksilver/src
make CXX="$CXX" CXXFLAGS="$CXXFLAGS" CPPFLAGS="$CXXFLAGS" LDFLAGS="$LDFLAGS" -j4
- name: Run smoke test
run: |
export OMP_NUM_THREADS=${{ matrix.omp_num_threads }}
mpirun -n 1 ${{runner.workspace}}/Quicksilver/src/qs
Loading

0 comments on commit 667cf12

Please sign in to comment.