File indexing completed on 2026-10-09 08:30:26
0001
0002
0003
0004
0005
0006
0007
0008
0009 #include "RunSolverProcess.hpp"
0010
0011 #include "Acts/Utilities/Logger.hpp"
0012
0013 #include <filesystem>
0014
0015 #include "WrappedFileHandle.hpp"
0016
0017
0018
0019
0020 #ifdef ACTS_MILLE_USE_BOOST_PROCESS_V2
0021 #include "SolverProcessCall_BoostV2.hpp"
0022 #else
0023 #include "SolverProcessCall_BoostV1.hpp"
0024 #endif
0025
0026 namespace ActsPlugins::detail {
0027 MpSolverStatus runSolverProcess(
0028 const std::string& program, const std::vector<std::string>& args,
0029 const std::filesystem::path& runDir, const Acts::Logger& logger,
0030 const std::optional<std::filesystem::path>& redirectOutput) {
0031
0032 if (!std::filesystem::exists(runDir)) {
0033 ACTS_ERROR("Run directory '" << runDir
0034 << "' does not exist, will not run solver");
0035 return MpSolverStatus::FailedWorkDir;
0036 }
0037
0038 WrappedFileHandle outputHandle;
0039
0040 if (redirectOutput.has_value()) {
0041 outputHandle = WrappedFileHandle(*redirectOutput);
0042 if (!outputHandle.isRedirected()) {
0043 ACTS_ERROR("Failed to redirect output to '" << *redirectOutput << "'");
0044 return MpSolverStatus::FailedRedirectStdout;
0045 }
0046 }
0047 return runChildProcessBoost(program, args, runDir, outputHandle, logger);
0048 }
0049 }