Skip to content

Commit

Permalink
COMP: Syncronize with cookie cutter recommendations
Browse files Browse the repository at this point in the history
  • Loading branch information
hjmjohnson committed Jan 28, 2025
1 parent 8f2fd1a commit 0544b8f
Show file tree
Hide file tree
Showing 7 changed files with 128 additions and 16 deletions.
Original file line number Diff line number Diff line change
@@ -1,9 +1,17 @@
name: Build, test, package

on: [push,pull_request]
on:
push:
branches:
- main
tags:
- 'v*'
pull_request:
branches:
- main

jobs:
build-test-cxx:
cxx-build-workflow:
runs-on: ${{ matrix.os }}
strategy:
max-parallel: 3
Expand Down Expand Up @@ -40,7 +48,7 @@ jobs:
python -m pip install ninja
- name: Get specific version of CMake, Ninja
uses: lukka/get-cmake@latest
uses: lukka/get-cmake@3.31.5

- name: Download ITK
run: |
Expand Down
11 changes: 6 additions & 5 deletions CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,9 @@ project(PerformanceBenchmarking
HOMEPAGE_URL "https://github.com/InsightSoftwareConsortium/ITKPerformanceBenchmarking"
LANGUAGES CXX C
)

set(PerformanceBenchmarking_LIBRARIES PerformanceBenchmarking)

if(NOT ITK_SOURCE_DIR)
find_package(ITK REQUIRED)
list(APPEND CMAKE_MODULE_PATH ${ITK_CMAKE_DIR})
Expand All @@ -41,14 +44,12 @@ if(NOT ITK_SOURCE_DIR)
# Set the possible values of build type for cmake-gui
set_property(CACHE CMAKE_BUILD_TYPE PROPERTY STRINGS "Debug" "Release" "MinSizeRel" "RelWithDebInfo")
endif()
endif()
set(PerformanceBenchmarking_LIBRARIES PerformanceBenchmarking)

include_directories(${CMAKE_BINARY_DIR})
if(NOT ITK_SOURCE_DIR)
include(ITKModuleExternal)
else()
set(ITK_DIR ${CMAKE_BINARY_DIR})
itk_module_impl()
endif()
add_subdirectory(examples)

itk_module_examples() # This builds the src directory
add_subdirectory(examples) # this builds each of the itk benchmark domains
90 changes: 90 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,90 @@
# PerformanceBenchmarking

image:: https://github.com/InsightSoftwareConsortium/ITKPerformanceBenchmarking/workflows/Build,%20test,%20package/badge.svg

[![Build Status](https://github.com/InsightSoftwareConsortium/PerformanceBenchmarking/actions/workflows/build-test-package.yml/badge.svg)](https://github.com/InsightSoftwareConsortium/PerformanceBenchmarking/actions/workflows/build-test-package.yml)

[![PyPI Version](https://img.shields.io/pypi/v/itk-PerformanceBenchmarking.svg)](https://pypi.python.org/pypi/itk-PerformanceBenchmarking)

[![License](https://img.shields.io/badge/License-Apache%202.0-blue.svg)](https://github.com/InsightSoftwareConsortium/PerformanceBenchmarking/blob/main/LICENSE)

## Overview

Real-world tests to benchmark ITK performance.

New classes increase operating system process priority to
minimize the impact of other processes running on the system.

These classes are used by a suite of example ITK benchmarks to quantify toolkit
performance.

For more information, see::

```txt
McCormick M., Kang H.J., Barre S.
Performance Benchmarking the Insight Toolkit
The Insight Journal. January-December. 2016.
https://hdl.handle.net/10380/3557
https://insight-journal.org/browse/publication/972
```

Since ITK 4.11.0, this module is available in the ITK source tree as a Remote
module. To enable it, set::

Module_PerformanceBenchmarking:BOOL=ON

in ITK's CMake build configuration.

Requirements
------------
- `CMake <https://cmake.org/>`_
- `Ninja <https://ninja-build.org/>`_
- `Python <https://www.python.org/>`_

Notes for running the benchmarks
--------------------------------

An example to call the benchmarking script is::

$ python ./evaluate-itk-performance.py run -g {ITK-version} {ITK-source} {ITK-build} {ITKPerformanceBenchmarking-build}

where ``{ITK-version}`` is the ITK version that the user wishes to evaluate.

Also, note that the ITK source folder ``(ITK-source}``, where the specific
version is fetched, needs to exist.

The generated/result ``JSON`` files are placed in::

./{ITKPerformanceBenchmarking-build}/BenchmarkResults/{machine-name}


Notes for benchmarking in Windows
---------------------------------

**CMake** and **Ninja** need to be in the ``PATH``. Also, the **C++ compiler**
has to be in the ``PATH`` so that Ninja can find it.

For the Microsoft Visual Studio compiler, the C++ compiler is a file that is
usually under::

C:/Program Files/Microsoft Visual Studio {version}/VC/bin/cl.exe

The user will need to change the path to the *vcvars\*.bat* command file in the
`RunWithVisualStudio.cmd <https://github.com/InsightSoftwareConsortium/ITKPerformanceBenchmarking/blob/master/RunWithVisualStudio.cmd#L1>`_ command line script to the specific location of their
*vcvars* file, e.g.::

C:/Program Files/Microsoft Visual Studio {version}/VC/vcvarsall.bat

Finally, the user will need to start the Git bash by double-clicking on the
``RunWithVisualStudio.cmd`` script.

Note that the module is built with static libraries to allow for ITK
benchmarking in Windows: the ``BUILD_SHARED_LIBS`` flag in the
`evaluate-itk-performance.py <https://github.com/InsightSoftwareConsortium/ITKPerformanceBenchmarking/blob/master/evaluate-itk-performance.py>`_ script is set to `OFF`.


License
-------

This software is distributed under the Apache 2.0 license. Please see
the *LICENSE* file for details.
7 changes: 4 additions & 3 deletions README.rst
Original file line number Diff line number Diff line change
@@ -1,7 +1,6 @@
ITKPerformanceBenchmarking
==========================

.. image:: https://github.com/InsightSoftwareConsortium/ITKPerformanceBenchmarking/workflows/Build,%20test,%20package/badge.svg
image:: https://github.com/InsightSoftwareConsortium/ITKPerformanceBenchmarking/workflows/Build,%20test,%20package/badge.svg

Real-world tests to benchmark ITK performance.

Expand All @@ -11,13 +10,15 @@ minimize the impact of other processes running on the system.
These classes are used by a suite of example ITK benchmarks to quantify toolkit
performance.

For more information, see the `Insight Journal article <https://hdl.handle.net/10380/3557>`_::
For more information, see::

```txt
McCormick M., Kang H.J., Barre S.
Performance Benchmarking the Insight Toolkit
The Insight Journal. January-December. 2016.
https://hdl.handle.net/10380/3557
https://insight-journal.org/browse/publication/972
```

Since ITK 4.11.0, this module is available in the ITK source tree as a Remote
module. To enable it, set::
Expand Down
10 changes: 8 additions & 2 deletions examples/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,5 +1,11 @@
cmake_minimum_required(VERSION 3.10.2)
project(ITKBenchmarks NONE)
cmake_minimum_required(VERSION 3.22.1)
project(ITKBenchmarks
VERSION 0.9.0
DESCRIPTION
"Benchmarks performance."
HOMEPAGE_URL "https://github.com/InsightSoftwareConsortium/ITKPerformanceBenchmarking"
LANGUAGES CXX C
)

set(CMAKE_MODULE_PATH ${CMAKE_CURRENT_SOURCE_DIR}/CMake ${CMAKE_MODULE_PATH})
include(ITKBenchmarksExternalData)
Expand Down
8 changes: 7 additions & 1 deletion itk-module.cmake
Original file line number Diff line number Diff line change
@@ -1,4 +1,10 @@
set(DOCUMENTATION "New classes increase operating system process priority to
# the top-level README is used for describing this module, just
# re-used it for documentation here
get_filename_component(MY_CURRENT_DIR "${CMAKE_CURRENT_LIST_FILE}" PATH)
file(READ "${MY_CURRENT_DIR}/README.md" DOCUMENTATION)

set(DOCUMENTATION
"New classes increase operating system process priority to
minimize the impact of other processes running on the system.
These classes are used by a used by a suite of example ITK benchmarks to
Expand Down
4 changes: 2 additions & 2 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -53,7 +53,7 @@ set(MAPPING_VALUES "
")

configure_file(PerformanceBenchmarkingInformation.cxx.in ${CMAKE_BINARY_DIR}/PerformanceBenchmarkingInformation.cxx)
configure_file(PerformanceBenchmarkingInformation.h.in ${CMAKE_BINARY_DIR}/PerformanceBenchmarkingInformation.h)
configure_file(PerformanceBenchmarkingInformation.h.in ${CMAKE_BINARY_DIR}/include/PerformanceBenchmarkingInformation.h)

set( PerformanceBenchmarking_SRCS
jsonxx.cc ## MIT License https://github.com/hjiang/jsonxx
Expand All @@ -62,7 +62,7 @@ set( PerformanceBenchmarking_SRCS
itkHighPriorityRealTimeProbe.cxx
itkHighPriorityRealTimeProbesCollector.cxx
PerformanceBenchmarkingUtilities.cxx
${CMAKE_BINARY_DIR}/PerformanceBenchmarkingInformation.h)
${CMAKE_BINARY_DIR}/include/PerformanceBenchmarkingInformation.h)

if(MSVC)
add_definitions(-D_CRT_SECURE_NO_WARNINGS)
Expand Down

0 comments on commit 0544b8f

Please sign in to comment.