Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Simplify and unify Makefile build system #219

Merged
merged 61 commits into from
Dec 2, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
61 commits
Select commit Hold shift + click to select a range
2825770
Remove un-maintained CMake build system
bozbez Oct 21, 2021
0ca3dec
Remove CMake references from READMEs and docs
bozbez Oct 21, 2021
2e98822
Rename CPP compiled .c sources to .cpp
bozbez Oct 21, 2021
c05214a
Untangle C library Makefile build rules
bozbez Oct 21, 2021
74379a5
Simplify CPP Makefile rules
bozbez Oct 22, 2021
52425e9
Migrate op2/c and op2/fortran to op2/* with op2/src/fortran and op2/i…
bozbez Oct 25, 2021
6669078
Fix FORTRAN module make order and simplify rules
bozbez Oct 26, 2021
012916b
Build objects in src-equivalent directory and simplify
bozbez Oct 26, 2021
999b0b8
Generate library build rules via template
bozbez Oct 26, 2021
fdd0dc6
Split OP2 Makefile for unification with app Makefiles
bozbez Oct 26, 2021
3266377
Consolidate minimal compiler flag definitions
bozbez Oct 27, 2021
efaacd4
Finer-grained wiring of include path
bozbez Oct 28, 2021
89b2cc7
Initial generic Makefile for C apps
bozbez Oct 29, 2021
d9ca872
Move jac1/sp and jac2 to new Makefile
bozbez Oct 29, 2021
27d1446
(Re-)Port jac2.cpp to MPI
bozbez Oct 29, 2021
0e5e966
Move reduction to new Makefile
bozbez Oct 29, 2021
e0e57a1
Move all other C apps to new Makefile
bozbez Nov 1, 2021
9cfdc69
Remove MATLAB translator
bozbez Nov 1, 2021
067cdbc
Remove dp/ folder layer for aero, restore write_hdf5 build rule
bozbez Nov 1, 2021
b919cdd
Add convert_mesh rules to airfoil HDF5
bozbez Nov 1, 2021
e0ddbde
Add profile system with GNU NVPTX example
bozbez Nov 1, 2021
2c0008a
Remove FORTRAN airfoil dp/ folders
bozbez Nov 2, 2021
f9ab0e9
Fix permissions in FORTRAN apps
bozbez Nov 2, 2021
c0303bb
Remove FORTRAN airfoil_plain generated files
bozbez Nov 2, 2021
99eaa50
Add C linkage specifiers to dummy lib functions
bozbez Nov 2, 2021
28aad62
Restore FORTRAN airfoil_plain inc2 files
bozbez Nov 2, 2021
fb711cd
Initial generic FORTRAN airfoil_plain Makefile
bozbez Nov 2, 2021
67121be
Set MPI compilers for cray
bozbez Nov 2, 2021
c0796bd
Hard set CC/CXX in compiler makefiles
bozbez Nov 3, 2021
38e3160
Remove need to provide MPI_INSTALL_PATH for MPI_INC
bozbez Nov 3, 2021
e7de7dd
Improve Makefile compatability with implicitly provided libraries
bozbez Nov 3, 2021
d7cf516
Fix Makefile indentation
bozbez Nov 3, 2021
ac88482
Restore Makefile detection of NVCC/MPICC
bozbez Nov 3, 2021
340aa77
Silence Makefile compiler detection
bozbez Nov 3, 2021
f1d9b3b
Adjust library link flags and Cray compile flags
bozbez Nov 3, 2021
60b6398
Remove C app grouped targets for GNU Make < 3.4 compatability
bozbez Nov 3, 2021
5788a85
Only build _cuda app variants when NVCC is present
bozbez Nov 8, 2021
e7fd8e6
Fix app make generate rule
bozbez Nov 8, 2021
88c1afc
Fix recursive HDF5_INC in common.mk
bozbez Nov 8, 2021
1f1a65b
Switch to list-directed input for .dat file headers
bozbez Nov 8, 2021
0b7628f
Common Makefile for FORTRAN apps ((mpi_) (seq, genseq, openmp))
bozbez Nov 9, 2021
346d4d9
Fix GNU build of airfoil with FORTRAN argument pointers
bozbez Nov 10, 2021
49bbea0
Amend C app OMP4 rules and add FORTRAN VEC and OMP4 rules
bozbez Nov 10, 2021
230609e
Rework compiler and f_app Makefiles for FORTRAN CUDA
bozbez Nov 12, 2021
97ff2aa
Fix gitignore of compilers/c_cuda, use hidden files for profile pre/post
bozbez Nov 14, 2021
f1349f9
Disable parallel builds for nvhpc FORTRAN to fix races
bozbez Nov 15, 2021
322ec9e
Update GitHub workflow for new build system
bozbez Nov 15, 2021
d7a857d
Add support for parallel and sequential HDF5 builds and auto-translat…
bozbez Nov 18, 2021
c7a50db
FORTRAN app split HDF5 support and MPT/Intel/NVHPC fixes
bozbez Nov 19, 2021
062beee
Add HDF5 variant detection for FORTRAN apps
bozbez Nov 19, 2021
3866c66
Port the FORTRAN apps' Makfile dynamic rule generation to the C apps'…
bozbez Nov 19, 2021
c11624c
Restore C app .d inclusion
bozbez Nov 19, 2021
8cded75
Rewrite .gitignore files
bozbez Nov 19, 2021
3f92581
Only build sequential C openmp4 variant, link CUDA statically
bozbez Nov 22, 2021
1371ccb
Rewrite top-level README in markdown
bozbez Nov 23, 2021
d2d6d41
Fix incorrect static library compositions
bozbez Nov 24, 2021
043b44c
Remove unneeded READMEs and convert remaining to Markdown
bozbez Nov 29, 2021
0cf9f36
Add makefiles/README.md to document makefile structure
bozbez Nov 29, 2021
8c9b7bf
Use awk over sed for profiles, tweak nvhpc.mk, add GCC offload profile
bozbez Dec 1, 2021
5f68f33
Remove mention of old generate rules
bozbez Dec 1, 2021
526586f
Remove unneeded `make generate` invocation in CI workflow
bozbez Dec 1, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
23 changes: 9 additions & 14 deletions .github/workflows/airfoil.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ on:
branches:
- master
release:
types:
types:
- created

jobs:
Expand All @@ -28,8 +28,7 @@ jobs:

env:
OP2_COMPILER: gnu
OP2_INSTALL_PATH: "$(GITHUB_WORKSPACE)/op2"
NV_ARCH: Pascal
# NV_ARCH: Pascal

steps:
- name: Checkout repository
Expand All @@ -49,18 +48,14 @@ jobs:
# cuda: '11.2.2'
# method: 'network'
# sub-packages: '[ "cudart", "nvcc" ]'

# - name: Link CUDA runtime
# if: ${{ matrix.optimisation == 'cuda' }}
# run: sudo ln -s "${{steps.install-cuda-toolkit.outputs.CUDA_PATH}}"/lib64/libcudart.so /usr/lib/libcudart.so

- name: Build OP2 backend
working-directory: op2/${{ matrix.language.name }}
run: make core seq openmp # TODO: Only build targets required for active the matrix config

- name: Run OP2 translator
if: ${{ matrix.optimisation != 'seq' }}
run: python3 $GITHUB_WORKSPACE/translator/${{ matrix.language.name }}/python/op2.py airfoil.${{ matrix.language.ext }}
working-directory: op2
run: make -j seq openmp # TODO: Only build targets required for active the matrix config

- name: Build airfoil
run: make airfoil_${{ matrix.optimisation }}
Expand All @@ -70,7 +65,7 @@ jobs:
run: wget https://op-dsl.github.io/docs/OP2/new_grid.dat

- name: Run airfoil
run: ./airfoil_${{ matrix.optimisation }} > ~/output.txt
run: ./airfoil_${{ matrix.optimisation }} > ~/output.txt

- name: Validate airfoil output
run: grep -q "This test is considered PASSED" ~/output.txt || exit 1
Expand All @@ -80,11 +75,11 @@ jobs:
uses: actions/upload-artifact@v2
with:
name: airfoil-${{ matrix.language.name }}-${{ matrix.optimisation }}-${{ matrix.mesh }}-output
path: ~/output.txt
path: ~/output.txt


# analyse-airfoil:
# runs-on: ubuntu-latest
# needs: validate-airfoil
# steps:
# TODO: Fetch app output artifact from validate job, extract runtime metric, compare runtime metric with historical artifacts
# TODO: Fetch app output artifact from validate job, extract runtime metric, compare runtime metric with historical artifacts
75 changes: 10 additions & 65 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,72 +1,17 @@
# Compiled Object files
*.slo
*.lo
# Compilation artifacts
*.o
*_cu.o
# Compiled Dynamic libraries
*.lo
*.mod
*.d
*.optrpt

# Compiled libraries
*.so
# Compiled Static libraries
*.lai
*.la
*.a
*_seq
*_openmp
*_openmp4
*_cuda
*_mpi
*_vec
*_genseq
*_cuda_hyb
*.dat
*_sycl
*_openacc
source_*
#*.txt
#*.dat
*_mpi
*.h5
*.bin
#fortran
*.mod
numawrap*

#python
# Python artifacts
*.pyc

#latex
*.log
*.aux
*.toc
*.out
*.backup
*.blg
*.bbl
# Miscellaneous
*~
*.pyg.*
*.optrpt
*.lst

#opt files
*.optrpt

#opt files
*.optrpt

#directories
op2/c/lib/
op2/c/build/
op2/c/obj/
op2/c/CMakeFiles/
op2/fortran/lib/
op2/fortran/obj/

#docs
doc/*.pdf
./op2/c/lib/
./op2/c/build/
./op2/c/obj/
./op2/c/CMakeFiles/
./op2/fortran/lib/
./op2/fortran/obj/
./apps/c/build/
./apps/c/bin/
*.swp
30 changes: 0 additions & 30 deletions README

This file was deleted.

53 changes: 53 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,53 @@
# OP2
OP2 is a high-level embedded domain specific language for writing **unstructured mesh** algorithms with automatic parellelisation on multi-core and many-core architectures. The API is embedded in both C/C++ and Fortran.

This repository contains the implementation of the code translation tools and run-time support libraries, and is structured as follows:
* `op2`: The C/C++ OP2 run-time libraries and Fortran bindings.
* `translator`: The Python code translators for both C/C++ and Fortran.
* `apps`: Example applications that demonstrate use of the API.
* `makefiles`: Shared infrastructure of the GNU Make based build-system.
* `doc`: LaTeX documentation source.

## Documentation
Documentation is currently available as a series of PDFs:
* [C++ User's Manual](https://op-dsl.github.io/docs/OP2/C++_Users_Guide.pdf): An overview of the C/C++ OP2 API, intended for those looking to use OP2.
* [Airfoil App Walkthrough](https://op-dsl.github.io/docs/OP2/airfoil-doc.pdf): A walkthrough of the `apps/{c, fortran}/airfoil` example application.
* [OP2 Developer's Guide](https://op-dsl.github.io/docs/OP2/dev.pdf): An overview of the algorithms and implementation details of OP2, intended for those who are developing OP2.
* [OP2 MPI Developer's Guide](https://op-dsl.github.io/docs/OP2/mpi-dev.pdf): An extension to the main developer's guide that further details issues relating to MPI.

## Quick-start
Firstly, OP2 has a varienty of dependencies that you will need depending on your use case:
* GNU Make > 4.2
* A C/C++ compiler: Currently supported compilers are GCC, Clang, Cray, Intel, IBM XL and NVHPC.
* (Optional) A Fortran compiler: Currently supported compilers are GFortran, Cray, Intel, IBM XL and NVHPC.
* (Optional) An MPI implementation: Any implementation with the `mpicc`, `mpicxx`, and `mpif90` wrappers is supported.
* (Optional) NVIDIA CUDA > 9.2

Secondly, OP2 has a few dependencies that you must obtain and build, ideally with the same compiler you will use for OP2 and the application you are integrating OP2 into:
* [(PT-)Scotch](https://www.labri.fr/perso/pelegrin/scotch/): Used for mesh partitioning. You must build both the sequential Scotch and parallel PT-Scotch.
* [ParMETIS](http://glaros.dtc.umn.edu/gkhome/metis/parmetis/overview): Used for mesh partitioning.
* (Optional) [HDF5](https://www.hdfgroup.org/solutions/hdf5/): Used for HDF5 I/O. You may build with and without `--enable-parallel` (depending on if you need MPI), and then specify both builds via the environment variables listed below.

Finally, to build OP2 and any of the apps:
1. Set either `OP2_COMPILER={gnu, cray, intel, xl, nvhpc}`, or `OP2_{C, C_CUDA, F}_COMPILER={...}` depending on your compiler setup. Alternatively if there is a profile specific to the cluster you are building on in `makefiles/profiles` you may use e.g. `OP2_PROFILE=cirrus-intel`.
2. Set `PTSCOTCH_INSTALL_PATH`, `PARMETIS_INSTALL_PATH`, and `HDF5_{SEQ, PAR}_INSTALL_PATH` to the locations of the respective dependency builds containing `include` and `lib` folders.
3. (Optional) Set `CUDA_INSTALL_PATH` to the location of the installed CUDA toolkit.
4. Run `make -j$(nproc)` in the `op2` directory to build the run-time libraries.
5. Run `make -j$(nproc)` in any of the app directories to build the respective apps.

## Citing
To cite OP2, please reference the following paper:

[G. R. Mudalige, M. B. Giles, I. Reguly, C. Bertolli and P. H. J. Kelly, "OP2: An active library framework for solving unstructured mesh-based applications on multi-core and many-core architectures," 2012 Innovative Parallel Computing (InPar), 2012, pp. 1-12, doi: 10.1109/InPar.2012.6339594.](https://ieeexplore.ieee.org/document/6339594)

```
@INPROCEEDINGS{6339594,
author={Mudalige, G.R. and Giles, M.B. and Reguly, I. and Bertolli, C. and Kelly, P.H.J},
booktitle={2012 Innovative Parallel Computing (InPar)},
title={OP2: An active library framework for solving unstructured mesh-based applications on multi-core and many-core architectures},
year={2012},
volume={},
number={},
pages={1-12},
doi={10.1109/InPar.2012.6339594}}
```
32 changes: 32 additions & 0 deletions apps/.gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
# Translator-generated files
.generated
*_op.*

seq/
vec/
openmp/
openmp4/
cuda/
openacc/

*_kernel.*
*_seqkernel.*
*_veckernel.*
*_omp4kernel.*

# Compiled apps
*_seq
*_genseq
*_vec
*_openmp
*_openmp4
*_cuda
*_cuda_hyb
*_mpi
*_sycl
*_openacc

# Test files
*.dat
*.h5
*.bin
82 changes: 0 additions & 82 deletions apps/c/CMakeLists.txt

This file was deleted.

Loading