Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
39 changes: 39 additions & 0 deletions .github/install_gamer_env.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
#!/bin/bash

# Install GAMER Environment for GitHub-hosted GitHub Actions runners
# This script installs dependencies needed to compile and run GAMER

set -e

echo "Installing GAMER dependencies..."

# Install OpenMPI, HDF5, and CUDA toolkit
sudo apt-get install -y openmpi-bin libopenmpi-dev libhdf5-dev nvidia-cuda-toolkit

echo ""
echo "Verifying installations..."
echo "MPI:"
which mpirun
which mpicxx
mpicxx --version

echo ""
echo "CUDA:"
which nvcc
nvcc --version

echo ""
echo "HDF5:"
h5cc -show

echo ""
echo "Configuring GAMER machine settings..."
cd "$(git rev-parse --show-toplevel)/tool/config"
bash set_settings.sh --local --machine=github_action

echo ""
echo "Verifying configuration..."
cat "$(git rev-parse --show-toplevel)/src/.local_settings"

echo ""
echo "GAMER environment setup complete!"
33 changes: 33 additions & 0 deletions .github/workflows/copilot-setup-steps.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
name: "Copilot Setup Steps"

# Automatically run the setup steps when they are changed to allow for easy validation, and
# allow manual testing through the repository's "Actions" tab
on:
workflow_dispatch:
push:
paths:
- .github/workflows/copilot-setup-steps.yml
- .github/install_gamer_env.sh
pull_request:
paths:
- .github/workflows/copilot-setup-steps.yml
- .github/install_gamer_env.sh

jobs:
# The job MUST be called `copilot-setup-steps` or it will not be picked up by Copilot.
copilot-setup-steps:
runs-on: ubuntu-latest

# Set the permissions to the lowest permissions possible needed for your steps.
# Copilot will be given its own token for its operations.
permissions:
contents: read

# You can define any steps you want, and they will run before the agent starts.
# If you do not check out your code, Copilot will do this for you.
steps:
- name: Checkout code
uses: actions/checkout@v5

- name: Setup GAMER Environment
run: bash .github/install_gamer_env.sh
33 changes: 33 additions & 0 deletions configs/github_action.config
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
# GitHub-hosted GitHub Actions runners (Ubuntu)
# https://docs.github.com/en/actions/reference/runners/github-hosted-runners

# 1. Paths
CUDA_PATH /usr
FFTW2_PATH /path/to/fftw2
FFTW3_PATH /path/to/fftw3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we set either FFTW2_PATH or FFTW3_PATH if we want to compile/run test problems that require gravity for CI/CD? The 1D Shock Tube and 3D Blast Wave tests do not rely on gravity, so they will work without these settings.

MPI_PATH /usr
HDF5_PATH /usr/lib/x86_64-linux-gnu/hdf5/serial
GRACKLE_PATH /path/to/grackle
GSL_PATH /path/to/gsl
LIBYT_PATH /path/to/libyt
CUFFTDX_PATH /path/to/cufftdx

# 2. Compiler type
CXX g++ # Serial compiler
CXX_MPI mpicxx # MPI compiler (The MPI_PATH/bin/ will be combined automatically)

# 3. Compiler flags
CXXFLAG -g
CXXFLAG -O2

OPENMPFLAG -fopenmp

#LIBFLAG

NVCCFLAG_COM -O3 -I/usr/include/x86_64-linux-gnu/mpi
#NVCCFLAG_COM -use_fast_math
NVCCFLAG_FLU -Xptxas -dlcm=ca -prec-div=false -ftz=true
NVCCFLAG_POT -Xptxas -dlcm=ca

# 4. Set the GPU Compute Capability
GPU_COMPUTE_CAPABILITY 750 # NVIDIA Tesla T4
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Remove trailing space.