Skip to content

Commit

Permalink
Add option Xolotl_ENABLE_TIMER_TESTS and disable for macos ci (#205)
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilipFackler committed Nov 19, 2024
1 parent 5f8e4e9 commit 3e78465
Show file tree
Hide file tree
Showing 8 changed files with 20 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .github/workflows/ci-github-actions.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ jobs:
- name: Configure
run: |
export EXTRA_CMAKE_ARGS='-DXolotl_INCLUDE_RN_TPP_FILES=ON'
export EXTRA_CMAKE_ARGS='-DXolotl_INCLUDE_RN_TPP_FILES=ON -DXolotl_ENABLE_TIMER_TESTS=OFF'
CI/scripts/run_step.sh configure
env:
PATH: ${{ env.PATH }}
Expand Down
3 changes: 3 additions & 0 deletions test/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,9 @@ get_filename_component(XOLOTL_TEST_DATA_DIR
)
set(XOLOTL_BUILD_DIR ${CMAKE_BINARY_DIR})

option(Xolotl_ENABLE_TIMER_TESTS "Include tests for accurate timing" ON)
set(XOLOTL_ENABLE_TIMER_TESTS ${Xolotl_ENABLE_TIMER_TESTS})

execute_process(COMMAND
${CMAKE_COMMAND} -E make_directory ${XOLOTL_BINARY_INCLUDE_DIR}/xolotl/test
)
Expand Down
2 changes: 2 additions & 0 deletions test/config.h.in
Original file line number Diff line number Diff line change
Expand Up @@ -5,3 +5,5 @@
#define XOLOTL_BUILD_DIR @XOLOTL_BUILD_DIR@

#define XOLOTL_TEST_DATA_DIR @XOLOTL_TEST_DATA_DIR@

#cmakedefine XOLOTL_ENABLE_TIMER_TESTS
9 changes: 7 additions & 2 deletions test/perf/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,19 @@ list(APPEND tests
dummy/DummyEventCounterTester.cpp
dummy/DummyHardwareCounterTester.cpp
dummy/DummyTimerTester.cpp
os/OSTimerTester.cpp
)

if(Xolotl_ENABLE_TIMER_TESTS)
list(APPEND tests os/OSTimerTester.cpp)
endif()

if(PAPI_FOUND)
list(APPEND tests
papi/PAPIHardwareCounterTester.cpp
papi/PAPITimerTester.cpp
)
if(Xolotl_ENABLE_TIMER_TESTS)
list(APPEND tests papi/PAPITimerTester.cpp)
endif()
endif(PAPI_FOUND)

if(CMAKE_BUILD_TYPE MATCHES "^Debug$")
Expand Down
3 changes: 3 additions & 0 deletions test/perf/PerfHandlerTester.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@
#include <xolotl/perf/IPerfHandler.h>
#include <xolotl/perf/PerfObjStatistics.h>
#include <xolotl/test/MPITestUtils.h>
#include <xolotl/test/config.h>

using namespace xolotl;

Expand Down Expand Up @@ -122,10 +123,12 @@ BOOST_AUTO_TEST_CASE(aggregateStats)
BOOST_REQUIRE_EQUAL(timerStatsObj.name, "testTimer");
BOOST_REQUIRE_EQUAL(
timerStatsObj.processCount, (unsigned int)cwSize);
#ifdef XOLOTL_ENABLE_TIMER_TESTS
BOOST_REQUIRE_CLOSE(timerStatsObj.average, nTimedSeconds, 0.03);
BOOST_REQUIRE_CLOSE(timerStatsObj.min, nTimedSeconds, 0.03);
BOOST_REQUIRE_CLOSE(timerStatsObj.max, nTimedSeconds, 0.03);
BOOST_REQUIRE_SMALL(timerStatsObj.stdev, 0.001);
#endif

// Next check counts. We can compute exactly what the values
// should be.
Expand Down
4 changes: 2 additions & 2 deletions xolotl/core/include/xolotl/core/flux/FuelFitFluxHandler.h
Original file line number Diff line number Diff line change
Expand Up @@ -242,8 +242,8 @@ class FuelFitFluxHandler : public FluxHandler
/**
* \see IFluxHandler.h
*/
virtual void
setFissionYield(double yield)
void
setFissionYield(double yield) override
{
xeYield = yield;
}
Expand Down
2 changes: 1 addition & 1 deletion xolotl/solver/include/xolotl/solver/PetscSolver.h
Original file line number Diff line number Diff line change
Expand Up @@ -131,7 +131,7 @@ class PetscSolver : public Solver
* \see ISolver.h
*/
void
setCurrentTimeStep(double dt);
setCurrentTimeStep(double dt) override;

/**
* \see ISolver.h
Expand Down
2 changes: 1 addition & 1 deletion xolotl/solver/include/xolotl/solver/Solver.h
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ class Solver : public ISolver
* \see ISolver.h
*/
void
setCommandLineOptions(std::string arg);
setCommandLineOptions(std::string arg) override;

/**
* \see ISolver.h
Expand Down

0 comments on commit 3e78465

Please sign in to comment.