Skip to content

Commit

Permalink
Merge release-next into main
Browse files Browse the repository at this point in the history
  • Loading branch information
mantid-builder authored Jan 16, 2025
2 parents fc0059c + 5ac5173 commit 8529cc9
Show file tree
Hide file tree
Showing 10 changed files with 95 additions and 142 deletions.
10 changes: 2 additions & 8 deletions CMakePresets.json
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,7 @@
"inherits": [
"ci-default",
"conda"
],
"cacheVariables": {
"PROFILE_ALGORITHM_LINUX": "ON"
}
]
},
{
"name": "win-64-ci",
Expand Down Expand Up @@ -123,10 +120,7 @@
"inherits": [
"unix-debug",
"conda"
],
"cacheVariables": {
"PROFILE_ALGORITHM_LINUX": "ON"
}
]
},
{
"name": "win-vs-2019",
Expand Down
12 changes: 3 additions & 9 deletions Framework/API/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
set(SRC_FILES
src/ADSValidator.cpp
src/Algorithm.cpp
src/AlgorithmExecuteProfile.cpp
src/AlgorithmFactory.cpp
src/AlgorithmFactoryObserver.cpp
src/AlgorithmHasProperty.cpp
Expand All @@ -10,6 +11,7 @@ set(SRC_FILES
src/AlgorithmProperties.cpp
src/AlgorithmProperty.cpp
src/AlgorithmRuntimeProps.cpp
src/AlgoTimeRegister.cpp
src/AnalysisDataService.cpp
src/AnalysisDataServiceObserver.cpp
src/ArchiveSearchFactory.cpp
Expand Down Expand Up @@ -375,6 +377,7 @@ set(TEST_FILES
AlgorithmPropertyTest.h
AlgorithmRuntimePropsTest.h
AlgorithmTest.h
AlgoTimeRegisterTest.h
AnalysisDataServiceObserverTest.h
AnalysisDataServiceTest.h
AsynchronousTest.h
Expand Down Expand Up @@ -483,15 +486,6 @@ set(TEST_FILES
WorkspaceUnitValidatorTest.h
)

option(PROFILE_ALGORITHM_LINUX "Profile algorithm execution on Linux" OFF)
if(PROFILE_ALGORITHM_LINUX)
set(SRC_FILES "${SRC_FILES}" "src/AlgorithmExecuteProfile.cpp" "src/AlgoTimeRegister.cpp")
set(INC_FILES "${INC_FILES}" "inc/MantidAPI/AlgoTimeRegister.h")
set(TEST_FILES "${TEST_FILES}" "AlgoTimeRegisterTest.h")
else()
set(SRC_FILES "${SRC_FILES}" "src/AlgorithmExecute.cpp")
endif()

set(GMOCK_TEST_FILES ImplicitFunctionFactoryTest.h ImplicitFunctionParameterParserFactoryTest.h MatrixWorkspaceTest.h)

if(COVERAGE)
Expand Down
30 changes: 0 additions & 30 deletions Framework/API/src/AlgorithmExecute.cpp

This file was deleted.

11 changes: 6 additions & 5 deletions Framework/API/test/AlgoTimeRegisterTest.h
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,6 @@

using Mantid::Instrumentation::AlgoTimeRegister;
using Mantid::Kernel::ConfigService;
using std::filesystem::exists;
using std::filesystem::remove_all;

class AlgoTimeRegisterTest : public CxxTest::TestSuite {
public:
Expand All @@ -34,16 +32,19 @@ class AlgoTimeRegisterTest : public CxxTest::TestSuite {
};

AlgoTimeRegisterTest() {
if (mkdir(m_directory.c_str(), 0777) == -1) {

const auto &path = m_directory.c_str();
if (!std::filesystem::create_directory(path)) {
std::cerr << "Error : " << strerror(errno) << std::endl;
}
std::filesystem::permissions(path, std::filesystem::perms::owner_write, std::filesystem::perm_options::add);
ConfigService::Instance().setString("performancelog.filename", m_directory + "test.log");
ConfigService::Instance().setString("performancelog.write", "On");
AlgoTimeRegister::Instance();
}

~AlgoTimeRegisterTest() override {
remove_all(m_directory);
std::filesystem::remove_all(m_directory);
ConfigService::Instance().setString("performancelog.filename", "");
ConfigService::Instance().setString("performancelog.write", "Off");
}
Expand Down Expand Up @@ -186,7 +187,7 @@ class AlgoTimeRegisterTest : public CxxTest::TestSuite {

// Add the time entry
AlgoTimeRegister::Instance().addTime("TestAlgorithm", startTime, endTime);
TS_ASSERT(!exists(m_directory + "noWrite.log"));
TS_ASSERT(!std::filesystem::exists(m_directory + "noWrite.log"));
}

private:
Expand Down
5 changes: 1 addition & 4 deletions Framework/PythonInterface/mantid/api/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@ set(EXPORT_FILES
src/Exports/IAlgorithm.cpp
src/Exports/AlgorithmObserver.cpp
src/Exports/AlgorithmHistory.cpp
src/Exports/AlgoTimeRegister.cpp
src/Exports/CatalogManager.cpp
src/Exports/CatalogSession.cpp
src/Exports/DeprecatedAlgorithmChecker.cpp
Expand Down Expand Up @@ -90,10 +91,6 @@ set(EXPORT_FILES
src/Exports/RegionSelectorObserver.cpp
)

if(PROFILE_ALGORITHM_LINUX)
set(EXPORT_FILES "${EXPORT_FILES}" "src/Exports/AlgoTimeRegister.cpp")
endif()

set(MODULE_DEFINITION ${CMAKE_CURRENT_BINARY_DIR}/api.cpp)
create_module(${MODULE_TEMPLATE} ${MODULE_DEFINITION} ${EXPORT_FILES})

Expand Down
11 changes: 2 additions & 9 deletions Framework/PythonInterface/mantid/api/_aliases.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,11 +8,10 @@
Defines a set of aliases to make accessing certain objects easier
"""

import sys

from mantid.api import (
AlgorithmFactoryImpl,
AlgorithmManagerImpl,
AlgoTimeRegisterImpl,
AnalysisDataServiceImpl,
CatalogManagerImpl,
FileFinderImpl,
Expand Down Expand Up @@ -43,12 +42,6 @@
FunctionFactory = lazy_instance_access(FunctionFactoryImpl)
WorkspaceFactory = lazy_instance_access(WorkspaceFactoryImpl)
CatalogManager = lazy_instance_access(CatalogManagerImpl)
if sys.platform.startswith("linux"):
try:
from mantid.api import AlgoTimeRegisterImpl

AlgoTimeRegister = lazy_instance_access(AlgoTimeRegisterImpl)
except:
AlgoTimeRegister = None
AlgoTimeRegister = lazy_instance_access(AlgoTimeRegisterImpl)
# backwards-compatible
mtd = AnalysisDataService
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ using namespace Mantid::Instrumentation;
using namespace boost::python;
using Mantid::Kernel::time_point_ns;

void addTimeWrapper(const std::string &name, long int begin, long int end) {
void addTimeWrapper(const std::string &name, size_t begin, size_t end) {

std::chrono::nanoseconds begin_ns(begin);
std::chrono::nanoseconds end_ns(end);
Expand Down
Loading

0 comments on commit 8529cc9

Please sign in to comment.