Skip to content

Commit

Permalink
Debug chart generation, add attempt at fortran testing
Browse files Browse the repository at this point in the history
  • Loading branch information
LivInTheLookingGlass committed Sep 19, 2024
1 parent c3136e2 commit 6eda997
Show file tree
Hide file tree
Showing 5 changed files with 82 additions and 3 deletions.
47 changes: 47 additions & 0 deletions .github/workflows/fortran.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,47 @@
name: Fortran

on:
push:
paths:
- 'fortran/**'
- '!fortran/README.rst'
schedule:
- cron: "0 0 1 * *"

concurrency:
group: ${{ github.workflow }}-${{ github.ref }}
cancel-in-progress: true

jobs:
fortran:
strategy:
fail-fast: false
matrix:
os: [windows-latest, macos-latest, macos-13, 'ubuntu-20.04']
toolchain:
- {compiler: gcc, version: 13}
- {compiler: intel, version: '2023.2'}
- {compiler: intel-classic, version: '2021.10'}
- {compiler: nvidia-hpc, version: '23.11'}
include:
- os: ubuntu-latest
toolchain: {compiler: gcc, version: 12}
- os: ubuntu-latest
toolchain: {compiler: gcc, version: 11}
- os: ubuntu-latest
toolchain: {compiler: gcc, version: 10}
- os: ubuntu-latest
toolchain: {compiler: gcc, version: 9}
runs-on: ${{ matrix.os }}

steps:
- uses: fortran-lang/setup-fortran@v1
id: setup-fortran
with:
compiler: ${{ matrix.toolchain.compiler }}
version: ${{ matrix.toolchain.version }}

- run: |
${{ env.FC }} ... # environment vars FC, CC, and CXX are set
${{ steps.setup-fortran.outputs.fc }} ... # outputs work too
make fr_test
1 change: 1 addition & 0 deletions .github/workflows/pages.yml
Original file line number Diff line number Diff line change
Expand Up @@ -9,6 +9,7 @@ on:
- '**/*.c'
- '**/*.cpp'
- '**/*.cs'
- '**/*.f90'
- '**/*.h'
- '**/*.hpp'
- '**/*.java'
Expand Down
1 change: 1 addition & 0 deletions docs/conf.py
Original file line number Diff line number Diff line change
Expand Up @@ -245,6 +245,7 @@ def countfiles(lang):
def setup(app):
try:
labels, sizes, counts = zip(*((lang, float(size), countfiles(lang)) for lang, size in linguist(basedir)))
print("\n".join(repr(zip(labels, sizes, counts))))
size = max(10, len(labels))
colormap = plt.get_cmap('tab10' if len(labels) <= 10 else 'tab20')
colors = [colormap(idx / size) for idx, _ in enumerate(labels)]
Expand Down
6 changes: 3 additions & 3 deletions fortran/Makefile
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
BLUE=\033[0;34m
NC=\033[0m # No Color
CFORTRAN?=flang-new
FC?=flang-new

.PHONY: help
help:
Expand All @@ -10,8 +10,8 @@ help:

.PHONY: test
test: ../LICENSE
@$(CFORTRAN) -c src/*.f90
@$(CFORTRAN) *.o test.f90
@$(FC) -c src/*.f90
@$(FC) *.o test.f90
@./a.out

test_%:
Expand Down
30 changes: 30 additions & 0 deletions fortran/README.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,36 @@
Fortran Section
===============

All problems are solved in Fortran90, and should be compliant with later standards.

Organization
------------

All Fortran files share a common prefix with their problem number. All shared
functions are moved to header files in the include subfolder

Makefile
--------

There are three main recipes in this Makefile

test
~~~~

This recipe runs tests in a single thread and performs benchmarks on each.

test\_\*
~~~~~~~~

This recipe currently redirects to ``test``, but in future versions may
spawn a number of threads equal to the suffix given, with ``auto`` equalling
the number of CPUs on the system.

clean
~~~~~

This removes any build files, as well as the test runner executable

Tests
-----

Expand Down

0 comments on commit 6eda997

Please sign in to comment.