Skip to content

Update macroatom.cc #5902

Update macroatom.cc

Update macroatom.cc #5902

Workflow file for this run

---
name: Compile and lint
on:
push:
branches-ignore:
- classic*
workflow_dispatch:
jobs:
cppcheck:
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- name: install dependencies
run: |
brew update
brew install gsl openmpi cppcheck || true
cp artisoptions_nltenebular.h artisoptions.h
make version.h
- name: run cppcheck
run: |
cppcheck --version
cppcheck --force --error-exitcode=1 --language=c++ --std=c++20 --enable=all --inconclusive --suppress=knownConditionTrueFalse --suppress=constParameterCallback --suppress=redundantAssignment --suppress=knownArgument --suppress=missingIncludeSystem --suppress=unusedFunction --check-level=exhaustive .
clang-format:
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- name: install clang-format
run: |
brew update
brew install clang-format || true
- name: Run clang-format style check
uses: jidicula/clang-format-action@v4.13.0
with:
clang-format-version: '19'
check-path: .
clang-tidy:
runs-on: macos-15
steps:
- uses: actions/checkout@v4
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 'latest-stable'
- name: install llvm from brew
run: |
brew install llvm
echo "/opt/homebrew/opt/llvm/bin" >> $GITHUB_PATH
echo "LDFLAGS=-L/opt/homebrew/opt/llvm/lib" >> $GITHUB_ENV
echo "CPPFLAGS=-I/opt/homebrew/opt/llvm/include" >> $GITHUB_ENV
echo "CXXFLAGS=-I/opt/homebrew/opt/libomp/include" >> $GITHUB_ENV
echo "LIBRARY_PATH=/opt/homebrew/opt/lib" >> $GITHUB_ENV
echo "LD_LIBRARY_PATH=/opt/homebrew/opt/lib" >> $GITHUB_ENV
echo "CPATH=$HOMEBREW_PREFIX/include:$CPATH" >> $GITHUB_ENV
- name: Set up Python
uses: actions/setup-python@v5
- name: install dependencies
run: |
brew update
brew install openmpi gsl || true
python3 -m pip install compiledb
- name: Generate compile_commands.json
run: |
cp artisoptions_nltenebular.h artisoptions.h
make clean
python3 -m compiledb -n --full-path make TESTMODE=ON
- name: run-clang-tidy
run: |
clang-tidy --version
xcrun run-clang-tidy
compile:
env:
CXX: g++
strategy:
matrix:
compiler:
[
{name: gcc, ver: 12},
{name: gcc, ver: 13},
{name: gcc, ver: 14},
{name: nvc++, ver: '24.9'},
]
fail-fast: false
runs-on: ubuntu-24.04
name: ${{ matrix.compiler.name }} ${{ matrix.compiler.ver }}
steps:
- uses: actions/checkout@v4
- name: CPU type and core count
id: cpu-count
run: |
g++ -march=native -Q --help=target | grep -- '-march= ' | cut -f3
#python3 -m pip install psutil
#python3 -c 'import psutil; print(f"CPU count (physical only): {int(psutil.cpu_count(logical=False))}")'
python3 -c 'import multiprocessing; print(f"CPU count: {multiprocessing.cpu_count()}")'
echo "count=$(python3 -c 'import multiprocessing; print(multiprocessing.cpu_count())')" >> $GITHUB_OUTPUT
- name: Install gcc
if: matrix.compiler.name == 'gcc'
uses: fortran-lang/setup-fortran@v1
with:
compiler: gcc
version: ${{ matrix.compiler.ver }}
- name: Install nvc++
if: matrix.compiler.name == 'nvc++'
uses: fortran-lang/setup-fortran@v1
with:
compiler: nvidia-hpc
version: ${{ matrix.compiler.ver }}
# - name: Install CUDA Toolkit
# uses: Jimver/cuda-toolkit@master
# if: matrix.compiler.name == 'nvc++'
# with:
# log-file-suffix: '${{matrix.compiler.ver}}.txt'
# method: 'network'
# sub-packages: '"nvcc", "cudart"'
- name: Set nvc++ as compiler
if: matrix.compiler.name == 'nvc++'
run: |
echo "CXX=nvc++" >> $GITHUB_ENV
echo "OMPI_CXX=nvc++" >> $GITHUB_ENV
- name: install gsl
run: |
sudo apt install libgsl-dev
- name: install tbb
if: matrix.compiler.name == 'gcc'
run: |
sudo apt install libtbb-dev
- name: install openmpi
run: |
sudo apt install -y openmpi-bin libopenmpi-dev
- name: install OpenMP
run: |
sudo apt-get install -y libomp5 libomp-dev
- name: Compile classic mode
run: |
$CXX -v
cp -v -p artisoptions_classic.h artisoptions.h
make clean
make -j${{ steps.cpu-count.outputs.count}} sn3d exspec
- name: Compile classic mode OPENMP=ON
run: |
make clean
make OPENMP=ON -j${{ steps.cpu-count.outputs.count}} sn3d exspec
- name: Compile classic mode STDPAR=ON
run: |
$CXX -v
cp -v -p artisoptions_classic.h artisoptions.h
make clean
make STDPAR=ON -j${{ steps.cpu-count.outputs.count}} sn3d exspec
- name: Compile classic mode STDPAR=ON GPU=ON
if: matrix.compiler.name == 'nvc++'
run: |
$CXX -v
cp -v -p artisoptions_classic.h artisoptions.h
make clean
make STDPAR=ON GPU=ON -j${{ steps.cpu-count.outputs.count}} sn3d exspec
- name: Compile nebular mode
run: |
cp -v -p artisoptions_classic.h artisoptions.h
make clean
make -j${{ steps.cpu-count.outputs.count}} sn3d exspec
- name: Compile nebular mode OPENMP=ON
run: |
cp -v -p artisoptions_classic.h artisoptions.h
make clean
make OPENMP=ON -j${{ steps.cpu-count.outputs.count}} sn3d exspec
- name: Compile nebular mode STDPAR=ON
if: matrix.compiler.name != 'nvc++'
run: |
cp -v -p artisoptions_classic.h artisoptions.h
make clean
make STDPAR=ON -j${{ steps.cpu-count.outputs.count}} sn3d exspec
- name: Compile nebular mode STDPAR=ON GPU=ON
if: matrix.compiler.name == 'nvc++'
run: |
cp -v -p artisoptions_classic.h artisoptions.h
make clean
make STDPAR=ON GPU=ON -j${{ steps.cpu-count.outputs.count}} sn3d exspec
mac-llvm:
runs-on: macos-15
env:
CXX: clang++
name: macOS llvm clang
steps:
- uses: actions/checkout@v4
- name: CPU core count
id: cpu-count
run: |
#python3 -m pip install psutil
#python3 -c 'import psutil; print(f"CPU count (physical only): {int(psutil.cpu_count(logical=False))}")'
python3 -c 'import multiprocessing; print(f"CPU count: {multiprocessing.cpu_count()}")'
echo "count=$(python3 -c 'import multiprocessing; print(multiprocessing.cpu_count())')" >> $GITHUB_OUTPUT
- uses: maxim-lobanov/setup-xcode@v1
with:
xcode-version: 'latest-stable'
- name: install dependencies
run: |
brew update
brew install gsl || true
- name: install llvm
run: |
brew install llvm || true
echo "/opt/homebrew/opt/llvm/bin" >> $GITHUB_PATH
echo "LDFLAGS=-L/opt/homebrew/opt/llvm/lib/c++ -Wl,-rpath,/opt/homebrew/opt/llvm/lib/c++ $LDFLAGS" >> $GITHUB_ENV
echo "CXX=clang++" >> $GITHUB_ENV
- name: install OpenMP
run: |
brew install libomp || true
brew link --force libomp
echo "LDFLAGS=-L/opt/homebrew/opt/libomp/lib $LDFLAGS" >> $GITHUB_ENV
echo "CXXFLAGS=-I/opt/homebrew/opt/libomp/include $CXXFLAGS" >> $GITHUB_ENV
- name: install OpenMPI
run: |
brew install openmpi || true
- name: Compile classic mode
run: |
$CXX -v
cp -v -p artisoptions_classic.h artisoptions.h
make clean
make -j${{ steps.cpu-count.outputs.count}} sn3d exspec
- name: Compile classic mode OPENMP=ON
run: |
make clean
make OPENMP=ON -j${{ steps.cpu-count.outputs.count}} sn3d exspec
- name: Compile classic mode STDPAR=ON
run: |
$CXX -v
cp -v -p artisoptions_classic.h artisoptions.h
make clean
make STDPAR=ON -j${{ steps.cpu-count.outputs.count}} sn3d exspec
- name: Compile nebular mode
run: |
cp -v -p artisoptions_classic.h artisoptions.h
make clean
make -j${{ steps.cpu-count.outputs.count}} sn3d exspec
- name: Compile nebular mode OPENMP=ON
run: |
cp -v -p artisoptions_classic.h artisoptions.h
make clean
make OPENMP=ON -j${{ steps.cpu-count.outputs.count}} sn3d exspec
- name: Compile nebular mode STDPAR=ON
run: |
cp -v -p artisoptions_classic.h artisoptions.h
make clean
make STDPAR=ON -j${{ steps.cpu-count.outputs.count}} sn3d exspec