Skip to content

Commit

Permalink
Merge branch 'develop' into brryan/gray_vs_mg
Browse files Browse the repository at this point in the history
  • Loading branch information
brryan authored Jan 21, 2025
2 parents d264ed0 + 9a32b74 commit 57f4fe1
Show file tree
Hide file tree
Showing 8 changed files with 470 additions and 167 deletions.
140 changes: 140 additions & 0 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,140 @@
#=========================================================================================
# (C) (or copyright) 2023-2024. Triad National Security, LLC. All rights reserved.
# This program was produced under U.S. Government contract 89233218CNA000001
# for Los Alamos National Laboratory (LANL), which is operated by Triad
# National Security, LLC for the U.S. Department of Energy/National
# Nuclear Security Administration. All rights in the program are
# reserved by Triad National Security, LLC, and the U.S. Department of
# Energy/National Nuclear Security Administration. The Government is
# granted for itself and others acting on its behalf a nonexclusive,
# paid-up, irrevocable worldwide license in this material to reproduce,
# prepare derivative works, distribute copies to the public, perform
# publicly and display publicly, and to permit others to do so.
#=========================================================================================

# This file was created in whole or in part by one of OpenAI's generative AI models.

name: CI

on:
push:
branches: [ "main" ]
pull_request:

# Cancel outdated workflows
concurrency:
group: ${{ github.workflow }}-${{ github.head_ref || github.ref }}
cancel-in-progress: true

jobs:
# -------------------------------------------
# 1) CI Format job
# -------------------------------------------
ci_format:
# If you want to skip if the PR title has 'Draft:' or 'WIP:',
# you can approximate with the condition below.
if: >
github.event_name == 'pull_request' &&
(!
(
contains(github.event.pull_request.title, 'Draft:') ||
contains(github.event.pull_request.title, 'WIP:')
)
) ||
github.event_name == 'push'
runs-on: ubuntu-latest

# If you need HPC resources, set up a self-hosted runner here:
# runs-on: self-hosted
# or
# runs-on: [self-hosted, darwin-slurm-shared]

# Equivalent to 'variables:' in GitLab
env:
GIT_SUBMODULE_STRATEGY: recursive
SCHEDULER_PARAMETERS: "--nodes 1 --partition=skylake-gold"

steps:
- name: Check out code (with submodules)
uses: actions/checkout@v3
with:
submodules: true

- name: Set up environment
run: |
source env/bash
- name: Format
run: |
VERBOSE=1 ./style/format.sh
- name: Check for changes
run: |
git diff --exit-code --ignore-submodules
# -------------------------------------------
# 2) CI CPU job
# -------------------------------------------
ci_cpu:
# If you wanted it to run only if ci_format succeeded:
needs: ci_format
# Or skip if 'Draft:' or 'WIP:' in PR title
if: >
github.event_name == 'pull_request' &&
(!
(
contains(github.event.pull_request.title, 'Draft:') ||
contains(github.event.pull_request.title, 'WIP:')
)
) ||
github.event_name == 'push'
runs-on: ubuntu-latest
env:
GIT_SUBMODULE_STRATEGY: recursive
SCHEDULER_PARAMETERS: "--nodes 1 --partition=skylake-gold"

steps:
- name: Check out code (with submodules)
uses: actions/checkout@v3
with:
submodules: recursive

- name: Install dependencies
run: |
sudo apt-get update -qq
sudo apt-get install -qq --no-install-recommends tzdata
sudo apt-get install -qq git
sudo apt-get install -qq make cmake g++
sudo apt-get install -qq libopenmpi-dev libhdf5-openmpi-dev
sudo apt-get install -qq openssh-client
sudo apt-get install -qq python3 python3-numpy python3-h5py python3-matplotlib
- name: Build Jaybenne
run: |
cd tst
mkdir -p build
cd build
cmake -DPARTHENON_DISABLE_HDF5_COMPRESSION=ON -DCMAKE_BUILD_TYPE=Release ../../
make -j 4
echo "JAYBENNE_EXECUTABLE=$(pwd)/mcblock" >> $GITHUB_ENV
cd ..
- name: stepdiff tests
run: |
cd tst
./stepdiff.py --executable $JAYBENNE_EXECUTABLE \
--input ../inputs/stepdiff.in --use_mpiexec
./stepdiff.py --executable $JAYBENNE_EXECUTABLE \
--input ../inputs/stepdiff_ddmc.in --use_mpiexec
./stepdiff_smr.py --executable $JAYBENNE_EXECUTABLE \
--input ../inputs/stepdiff_smr.in --use_mpiexec
./stepdiff_smr.py --executable $JAYBENNE_EXECUTABLE \
--input ../inputs/stepdiff_smr_ddmc.in --use_mpiexec
./stepdiff_smr.py --executable $JAYBENNE_EXECUTABLE \
--input ../inputs/stepdiff_smr_ddmc.in --use_mpiexec \
--mpi_nthreads 8 --mpi_oversubscribe
./stepdiff_smr.py --executable $JAYBENNE_EXECUTABLE \
--input ../inputs/stepdiff_smr_hybrid.in --use_mpiexec
./stepdiff_smr.py --executable $JAYBENNE_EXECUTABLE \
--input ../inputs/stepdiff_smr_hybrid.in --use_mpiexec \
--mpi_nthreads 8 --mpi_oversubscribe
82 changes: 0 additions & 82 deletions .gitlab-ci.yml

This file was deleted.

17 changes: 0 additions & 17 deletions .gitlab/merge_request_templates/Default.md

This file was deleted.

23 changes: 23 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -67,6 +67,29 @@ with an empty commit, do

git commit --allow-empty -m "trigger pipeline" && git push

A portion of the CI is run on LANL's internal Darwin platform. To launch this CI job, someone with
Darwin access (usually a LANL employee) must first create a Github Personal Access Token, like so:

- `github.com` profile -> `Settings` -> `Developer Settings` -> `Personal Access Tokens` -> `Tokens (classic)`
- Click the `Generate New Token` button -> `Generate New Token (classic)`
- Name it something like `jaybenne_token` in the `Note` box
- Click the `workflow` checkbox (which will also check the `repo` boxes)
- `Generate token`
- You only get to see the token once, so immediately copy it.

Store the token securely in your own environment as `JAYBENNE_GITHUB_TOKEN`, e.g. in your Darwin `~/.bashrc`:

export JAYBENNE_GITHUB_TOKEN=[token]

and then, again from Darwin, manually launch the CI runner:

cd jaybenne
./tst/launch_ci_runner.py [Number of the github PR]

Note that `launch_ci_runner.py` will create a temporary checkout of the current state of the branch associated
with this PR according to the `origin` remote, so you don't need to worry about the state of your local checkout
of `jaybenne`.

# Run driver executable

cd build/src
Expand Down
Loading

0 comments on commit 57f4fe1

Please sign in to comment.