Skip to content

Commit

Permalink
Merge branch 'devel' into 'master'
Browse files Browse the repository at this point in the history
MetaCG v0.6.0 brings these new features and fixes

* Improved CMake that allows to use the graph library via `add_link_libraries`
* Utility tool to automatically generate a call graph via CMake File API
* Simplified and updated CMake handling of dependencies
* General code clean up

MetaCG Graph Library

* Removes explicit `edge` class
* Metadata is now registered automatically, simplifying the use of it
* Metadata can be attached to edges (not serialized into the file)
* Better multigraph managing API
* Improved implementation for json generation in `MCGWriter` class
* Ability to sort edges in generated dot output
* Ability to attach arbitrary `Metadata` and query its key
* Several fixes for potential null pointer accesses

CGCollector

* Fixes to name generation

PGIS

* Overhead-based heuristics to work within the PIRA automatic profiler

Infrastructure

* Ability to run all integration tests concurrently

See merge request tuda-sc/projects/metacg!124
  • Loading branch information
jplehr committed Oct 10, 2023
2 parents 71711db + d13f94a commit 5c557fa
Show file tree
Hide file tree
Showing 134 changed files with 5,392 additions and 2,621 deletions.
122 changes: 79 additions & 43 deletions .gitlab-ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -49,84 +49,101 @@ build-dependencies:
script:
- ./build_submodules.sh

mcg-container:
# mcg-container:
# stage: build
# tags:
# - podman
# allow_failure: true
# variables:
# GIT_STRATEGY: clone
# GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_COMMIT_SHA
# script:
# - podman login ${CI_REGISTRY} -u ${CI_CONTAINER_REG_USER} -p ${CONTAINER_REGISTRY_READ_TOKEN}
# - podman build -t registry.git.rwth-aachen.de/tuda-sc/projects/metacg/metacg:$CI_COMMIT_SHA -f container/metacg .
# - podman run --rm -t metacg:$CI_COMMIT_SHA /opt/metacg/metacg/build/pgis/test/unit/pgistests
# - podman run --rm -t metacg:$CI_COMMIT_SHA /opt/metacg/metacg/build/graph/test/unit/libtests
# - podman image rm metacg:$CI_COMMIT_SHA
#

# Stage: build
build-mcg-no-tests:
<<: *job-setup
stage: build
tags:
- podman
variables:
GIT_STRATEGY: clone
GIT_CLONE_PATH: $CI_BUILDS_DIR/$CI_COMMIT_SHA
script:
- podman login ${CI_REGISTRY} -u ${CI_CONTAINER_REG_USER} -p ${CONTAINER_REGISTRY_READ_TOKEN}
- podman build -t registry.git.rwth-aachen.de/tuda-sc/projects/metacg/metacg:$CI_COMMIT_SHA -f container/metacg .
- podman run --rm -t metacg:$CI_COMMIT_SHA /opt/metacg/metacg/build/pgis/test/unit/pgistests
- podman run --rm -t metacg:$CI_COMMIT_SHA /opt/metacg/metacg/build/graph/test/unit/libtests
- podman image rm metacg:$CI_COMMIT_SHA

- module load clang/$LLVM
- cmake -S . -B $MCG_BUILD-no-tests -G Ninja -DCMAKE_BUILD_TYPE=Debug
-DCMAKE_INSTALL_PREFIX=/tmp/metacg/$MCG_BUILD-no-tests
-DCUBE_LIB=$(dirname $(which cube_info))/../lib
-DCUBE_INCLUDE=$(dirname $(which cube_info))/../include/cubelib
-DEXTRAP_INCLUDE=./extern/install/extrap/include
-DEXTRAP_LIB=./extern/install/extrap/lib
-DSPDLOG_BUILD_SHARED=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
-DMETACG_BUILD_UNIT_TESTS=OFF
- cmake --build $MCG_BUILD-no-tests --parallel
- module purge

# Stage: build
build-mcg:
build-mcg-stripped-all:
<<: *job-setup
stage: build
script:
- module load clang/$LLVM
- cmake -S . -B $MCG_BUILD -DCMAKE_BUILD_TYPE=Debug
-DCMAKE_INSTALL_PREFIX=/tmp/metacg/full
- cmake -S . -B $MCG_BUILD-no-all -G Ninja -DCMAKE_BUILD_TYPE=Debug
-DCMAKE_INSTALL_PREFIX=/tmp/metacg/$MCG_BUILD-dflt
-DCUBE_LIB=$(dirname $(which cube_info))/../lib
-DCUBE_INCLUDE=$(dirname $(which cube_info))/../include/cubelib
-DEXTRAP_INCLUDE=./extern/install/extrap/include
-DEXTRAP_LIB=./extern/install/extrap/lib
-DSPDLOG_BUILD_SHARED=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
- cmake --build $MCG_BUILD --parallel
- cmake --build $MCG_BUILD-no-all --parallel
- module purge

build-mcg-stripped-pgis:
<<: *job-setup
stage: build
script:
- module load clang/$LLVM
- cmake -S . -B $MCG_BUILD-no-pgis -DCMAKE_BUILD_TYPE=Debug
-DCMAKE_INSTALL_PREFIX=/tmp/metacg/no_pgis
- cmake -S . -B $MCG_BUILD-no-cgcollector -G Ninja -DCMAKE_BUILD_TYPE=Debug
-DCMAKE_INSTALL_PREFIX=/tmp/metacg/$MCG_BUILD-w_pgis
-DCUBE_LIB=$(dirname $(which cube_info))/../lib
-DCUBE_INCLUDE=$(dirname $(which cube_info))/../include/cubelib
-DEXTRAP_INCLUDE=./extern/install/extrap/include
-DEXTRAP_LIB=./extern/install/extrap/lib
-DWITH_PGIS=OFF
-DMETACG_BUILD_PGIS=ON
-DSPDLOG_BUILD_SHARED=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
- cmake --build $MCG_BUILD-no-pgis --parallel
- cmake --build $MCG_BUILD-no-cgcollector --parallel
- module purge

build-mcg-stripped-cgcollector:
<<: *job-setup
stage: build
script:
- module load clang/$LLVM
- cmake -S . -B $MCG_BUILD-no-cgcollector -DCMAKE_BUILD_TYPE=Debug
-DCMAKE_INSTALL_PREFIX=/tmp/metacg/no_cgcollector
- cmake -S . -B $MCG_BUILD-no-pgis -G Ninja -DCMAKE_BUILD_TYPE=Debug
-DCMAKE_INSTALL_PREFIX=/tmp/metacg/$MCG_BUILD-w_cgcollector
-DCUBE_LIB=$(dirname $(which cube_info))/../lib
-DCUBE_INCLUDE=$(dirname $(which cube_info))/../include/cubelib
-DEXTRAP_INCLUDE=./extern/install/extrap/include
-DEXTRAP_LIB=./extern/install/extrap/lib
-DWITH_CGCOLLECTOR=OFF
-DMETACG_BUILD_CGCOLLECTOR=ON
-DSPDLOG_BUILD_SHARED=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
- cmake --build $MCG_BUILD-no-cgcollector --parallel
- cmake --build $MCG_BUILD-no-pgis --parallel
- module purge

build-mcg-stripped-all:
build-mcg:
<<: *job-setup
stage: build
script:
- module load clang/$LLVM
- cmake -S . -B $MCG_BUILD-no-all -DCMAKE_BUILD_TYPE=Debug
-DCMAKE_INSTALL_PREFIX=/tmp/metacg/no_all
- cmake -S . -B $MCG_BUILD -G Ninja -DCMAKE_BUILD_TYPE=Debug
-DCMAKE_INSTALL_PREFIX=/tmp/metacg/$MCG_BUILD-w_all
-DCUBE_LIB=$(dirname $(which cube_info))/../lib
-DCUBE_INCLUDE=$(dirname $(which cube_info))/../include/cubelib
-DEXTRAP_INCLUDE=./extern/install/extrap/include
-DEXTRAP_LIB=./extern/install/extrap/lib
-DWITH_PGIS=OFF
-DWITH_CGCOLLECTOR=OFF
-DMETACG_BUILD_PGIS=ON
-DMETACG_BUILD_CGCOLLECTOR=ON
-DSPDLOG_BUILD_SHARED=ON -DCMAKE_VERBOSE_MAKEFILE:BOOL=ON
- cmake --build $MCG_BUILD-no-all --parallel
- cmake --build $MCG_BUILD --parallel
- module purge


Expand Down Expand Up @@ -218,7 +235,7 @@ test-dynamic-pgis:
- export LD_LIBRARY_PATH=$PWD/../extern/install/extrap/lib:$LD_LIBRARY_PATH
- cd test/integration
- ./selectionTestRunner.sh -t dynamic -b $MCG_BUILD

test-imbalance-pgis:
<<: *job-setup
stage: integration-test
Expand All @@ -229,27 +246,46 @@ test-imbalance-pgis:
- cd test/integration
- ./selectionTestRunner.sh -t imbalance -b $MCG_BUILD

test-target-collector:
<<: *job-setup
stage: integration-test
script:
- module load clang/$LLVM
- cd graph/test/integration/TargetCollector
- ./TestRunner.sh -b $MCG_BUILD

# Stage: install
install-mcg:
<<: *job-setup
stage: install
script:
- cmake --install $MCG_BUILD
- stat /tmp/metacg/full/bin/cgcollector
- stat /tmp/metacg/full/bin/cgmerge
- export LD_LIBRARY_PATH=/tmp/metacg/full/lib:$LD_LIBRARY_PATH
- /tmp/metacg/full/bin/cgcollector --help
- rm -r /tmp/metacg/full
- cmake --install $MCG_BUILD-no-all
- cd graph/test/install
- stat /tmp/metacg/$MCG_BUILD-dflt/lib64/libmetacg.so
- CMAKE_PREFIX_PATH=/tmp/metacg/$MCG_BUILD-dflt/lib64/cmake/metacg cmake -S . -B $MCG_BUILD -DCMAKE_INSTALL_PREFIX=/tmp/metacg-user/test
- cmake --build $MCG_BUILD --parallel
- rm -r /tmp/metacg/$MCG_BUILD-dflt

install-pgis:
<<: *job-setup
stage: install
script:
- module load clang/$LLVM
- export LD_LIBRARY_PATH=$PWD/extern/install/extrap/lib:$LD_LIBRARY_PATH
- cmake --install $MCG_BUILD
- stat /tmp/metacg/full/bin/pgis_pira
- export LD_LIBRARY_PATH=/tmp/metacg/full/lib:$LD_LIBRARY_PATH
- /tmp/metacg/full/bin/pgis_pira --help
- rm -r /tmp/metacg/full
- cmake --install $MCG_BUILD-no-cgcollector
- stat /tmp/metacg/$MCG_BUILD-w_pgis/bin/pgis_pira
- export LD_LIBRARY_PATH=/tmp/metacg/$MCG_BUILD-w_pgis/lib64:/tmp/metacg/$MCG_BUILD-w_pgis/lib:$LD_LIBRARY_PATH
- /tmp/metacg/$MCG_BUILD-w_pgis/bin/pgis_pira --help
- rm -r /tmp/metacg/$MCG_BUILD-w_pgis

install-cgcollector:
<<: *job-setup
stage: install
script:
- module load clang/$LLVM
- export LD_LIBRARY_PATH=$PWD/extern/install/extrap/lib:$LD_LIBRARY_PATH
- cmake --install $MCG_BUILD-no-pgis
- stat /tmp/metacg/$MCG_BUILD-w_cgcollector/bin/cgcollector
- export LD_LIBRARY_PATH=/tmp/metacg/$MCG_BUILD-w_cgcollector/lib64:/tmp/metacg/$MCG_BUILD-w_cgcollector/lib:$LD_LIBRARY_PATH
- /tmp/metacg/$MCG_BUILD-w_cgcollector/bin/cgcollector --help
- rm -r /tmp/metacg/$MCG_BUILD-w_cgcollector
33 changes: 24 additions & 9 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ endif()
# End of require out-of-source builds

# Project information
set(METACG_VERSION 0.4.0)
set(METACG_VERSION 0.6.0)
project(
MetaCG
VERSION ${METACG_VERSION}
Expand All @@ -41,6 +41,14 @@ list(

set(METACG_Directory ${CMAKE_CURRENT_SOURCE_DIR})

# Whether the GoogleTest-based unit tests should be built and GoogleTest is downloaded as dependency This needs to be
# here, so ToolchainOptions already "sees" the option's value
option(
METACG_BUILD_UNIT_TESTS
"On or Off"
ON
)

# This also downloads and builds googletest
include(ToolchainOptions)
# Making packaging easier
Expand All @@ -59,32 +67,32 @@ if(NOT
)
set(GIT_SHA1 "NO_GIT_ROOT")
endif()
message(${GIT_SHA1})

# Configure the file that holds version information
configure_file(Config.h.in config.h)

# Component options MetaCG graph library will always be built. The actual graph implementation
add_subdirectory(graph)

# The collector toolchain: CGCollector, CGMerge, and CGValidate Should CGCollector be built
# Build the collector toolchain: CGCollector, CGMerge, and CGValidate
option(
WITH_CGCOLLECTOR
METACG_BUILD_CGCOLLECTOR
"On or off"
ON
OFF
)
if(WITH_CGCOLLECTOR)
if(METACG_BUILD_CGCOLLECTOR)
include(ClangLLVM)
include(CubeLib)
add_subdirectory(cgcollector)
endif()

# PIRA analyzer Should PGIS be built
option(
WITH_PGIS
METACG_BUILD_PGIS
"On or off"
ON
OFF
)
if(WITH_PGIS)
if(METACG_BUILD_PGIS)
include(ExtraP)
include(CubeLib)
add_subdirectory(pgis)
Expand All @@ -103,3 +111,10 @@ option(
"On or off"
OFF
)

# If set to on, CMake looks for installed cxxopts
option(
METACG_USE_EXTERNAL_CXXOPTS
"On or Off"
OFF
)
Loading

0 comments on commit 5c557fa

Please sign in to comment.