Go to file
xxq250 8c533e28ed
基础编译和单元测试 / build-test (push) Failing after 55s Details
Container Build / Build, smoke test, and publish image (push) Failing after 55s Details
容器镜像构建-冒烟测试-发布制品 / 基础编译和单元测试[job-fe62ee7] (push) Failing after 55s Details
容器镜像构建-冒烟测试-发布制品 / 容器镜像构建-冒烟测试-发布制品[job-1bd30f8] (push) Has been skipped Details
超算项目持续集成部署流水线 / 基础编译和单元测试[job-fe62ee7] (push) Failing after 55s Details
超算项目持续集成部署流水线 / 容器镜像构建-冒烟测试-发布制品[job-1bd30f8] (push) Has been skipped Details
Update buildkitd.toml
2026-07-23 14:28:35 +08:00
.gitea/workflows 修改流水线:容器镜像构建-冒烟测试-发布制品 2026-06-24 16:17:27 +08:00
.github/workflows ci: regenerate GitHub Actions templates 2026-06-12 10:24:15 +08:00
include feat: add HPC stencil demo app 2026-06-12 09:28:17 +08:00
src feat: add HPC stencil demo app 2026-06-12 09:28:17 +08:00
tests feat: add HPC stencil demo app 2026-06-12 09:28:17 +08:00
.gitignore feat: add HPC stencil demo app 2026-06-12 09:28:17 +08:00
CMakeLists.txt fix: make MPI tests CI friendly 2026-06-12 09:50:37 +08:00
Dockerfile feat: add HPC stencil demo app 2026-06-12 09:28:17 +08:00
README.md feat: add HPC stencil demo app 2026-06-12 09:28:17 +08:00
buildkitd.toml Update buildkitd.toml 2026-07-23 14:28:35 +08:00

README.md

HPC Stencil Demo

这是一个用于验证“超算应用 CI/CD 流水线编排”的最小可运行 demo。项目使用 CMake + C++17 + MPI 实现一维热扩散 stencil 计算并提供单元测试、MPI 冒烟测试、性能基准标签和容器构建入口。

目录结构

.
├── CMakeLists.txt
├── Dockerfile
├── include/stencil.hpp
├── src/stencil.cpp
├── src/main_mpi.cpp
├── tests/test_stencil.cpp
└── .github/workflows/ci-basic.yml

本地构建

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DENABLE_MPI=ON -DENABLE_TESTS=ON
cmake --build build --parallel
ctest --test-dir build --output-on-failure

MPI 运行

mpirun -np 4 ./build/stencil_mpi --size 200000 --steps 200

输出示例:

hpc_stencil_demo
ranks=4
global_size=200000
steps=200
checksum=...
elapsed_seconds=...

Slurm 作业示例

#!/usr/bin/env bash
#SBATCH --job-name=hpc-stencil-demo
#SBATCH --partition=normal
#SBATCH --nodes=1
#SBATCH --ntasks=4
#SBATCH --time=00:10:00
#SBATCH --output=stencil-%j.out
#SBATCH --error=stencil-%j.err

set -euo pipefail

module purge
module load gcc openmpi cmake

cmake -S . -B build -DCMAKE_BUILD_TYPE=Release -DENABLE_MPI=ON -DENABLE_TESTS=ON
cmake --build build --parallel
ctest --test-dir build --output-on-failure
srun ./build/stencil_mpi --size 1000000 --steps 500

容器构建

docker build -t hpc-stencil-demo .
docker run --rm hpc-stencil-demo

与流水线模板配合

本 demo 的 .github/workflows/ci-basic.yml 可直接用于 GitHub Actions 基础验证。你也可以把前面生成的模板目录中的其他 workflow 复制进来:

  • ci-matrix.yml:验证不同 MPI 实现或构建类型。
  • hpc-remote-slurm.yml:提交到真实超算 Slurm 集群。
  • performance-benchmark.yml:运行带 benchmark 标签的 CTest。
  • container-build.yml:发布容器镜像到 GHCR。
  • pipeline-orchestrator.yml:作为一体化编排入口。