1 #ifndef FWCore_Framework_streamTransitionAsync_h
2 #define FWCore_Framework_streamTransitionAsync_h
51 bool cleaningUpAfterException) {
59 bool cleaningUpAfterException) {
63 template <
typename Traits>
66 unsigned int iStreamIndex,
67 typename Traits::TransitionInfoType& transitionInfo,
69 std::vector<SubProcess>& iSubProcesses) {
73 using namespace edm::waiting_task;
78 [&iSubProcesses, iStreamIndex,
info = transitionInfo](std::exception_ptr
const* iPtr,
auto nextTask) {
82 chain::first([&](std::exception_ptr
const*,
auto nextTask) {
83 for (
auto& subProcess : iSubProcesses) {
86 }) |
chain::then([excpt](std::exception_ptr
const*,
auto nextTask) { nextTask.doneWaiting(excpt); }) |
89 for (
auto& subProcess : iSubProcesses) {
97 template <
typename Traits>
100 unsigned int iNStreams,
101 typename Traits::TransitionInfoType& transitionInfo,
103 std::vector<SubProcess>& iSubProcesses) {
104 for (
unsigned int i = 0;
i < iNStreams; ++
i) {
105 beginStreamTransitionAsync<Traits>(iWait, iSchedule,
i, transitionInfo,
token, iSubProcesses);
109 template <
typename Traits>
112 unsigned int iStreamIndex,
113 typename Traits::TransitionInfoType& transitionInfo,
115 std::vector<SubProcess>& iSubProcesses,
116 bool cleaningUpAfterException) {
121 using namespace edm::waiting_task;
125 chain::then([&iSubProcesses, iStreamIndex,
info = transitionInfo, cleaningUpAfterException](
126 std::exception_ptr
const* iPtr,
auto nextTask) {
129 chain::first([&](std::exception_ptr
const*,
auto nextTask) {
130 for (
auto& subProcess : iSubProcesses) {
132 nextTask, subProcess, iStreamIndex,
info, cleaningUpAfterException);
134 }) |
chain::then([excpt](std::exception_ptr
const*,
auto nextTask) { nextTask.doneWaiting(excpt); }) |
137 for (
auto& subProcess : iSubProcesses) {
145 template <
typename Traits>
148 unsigned int iNStreams,
149 typename Traits::TransitionInfoType& transitionInfo,
151 std::vector<SubProcess>& iSubProcesses,
152 bool cleaningUpAfterException) {
153 for (
unsigned int i = 0;
i < iNStreams; ++
i) {
154 endStreamTransitionAsync<Traits>(
155 iWait, iSchedule,
i, transitionInfo, iToken, iSubProcesses, cleaningUpAfterException);
void doStreamEndLuminosityBlockAsync(WaitingTaskHolder iHolder, unsigned int iID, LumiTransitionInfo const &, bool cleaningUpAfterException)
void processOneStreamAsync(WaitingTaskHolder iTask, unsigned int iStreamID, typename T::TransitionInfoType &transitionInfo, ServiceToken const &token, bool cleaningUpAfterException=false)
void doStreamEndRunAsync(WaitingTaskHolder iHolder, unsigned int iID, RunTransitionInfo const &, bool cleaningUpAfterException)
constexpr auto then(O &&iO)
auto runLast(edm::WaitingTaskHolder iTask)
void beginStreamTransitionAsync(WaitingTaskHolder iWait, Schedule &iSchedule, unsigned int iStreamIndex, typename Traits::TransitionInfoType &transitionInfo, ServiceToken const &token, std::vector< SubProcess > &iSubProcesses)
void beginStreamsTransitionAsync(WaitingTaskHolder iWait, Schedule &iSchedule, unsigned int iNStreams, typename Traits::TransitionInfoType &transitionInfo, ServiceToken const &token, std::vector< SubProcess > &iSubProcesses)
void doStreamBeginLuminosityBlockAsync(WaitingTaskHolder iHolder, unsigned int iID, LumiTransitionInfo const &)
void doStreamBeginRunAsync(WaitingTaskHolder iHolder, unsigned int iID, RunTransitionInfo const &)
void endStreamTransitionAsync(WaitingTaskHolder iWait, Schedule &iSchedule, unsigned int iStreamIndex, typename Traits::TransitionInfoType &transitionInfo, ServiceToken const &token, std::vector< SubProcess > &iSubProcesses, bool cleaningUpAfterException)
void endStreamsTransitionAsync(WaitingTaskHolder iWait, Schedule &iSchedule, unsigned int iNStreams, typename Traits::TransitionInfoType &transitionInfo, ServiceToken const &iToken, std::vector< SubProcess > &iSubProcesses, bool cleaningUpAfterException)
void subProcessDoStreamBeginTransitionAsync(WaitingTaskHolder iHolder, SubProcess &iSubProcess, unsigned int i, LumiTransitionInfo const &iTransitionInfo)
void subProcessDoStreamEndTransitionAsync(WaitingTaskHolder iHolder, SubProcess &iSubProcess, unsigned int i, LumiTransitionInfo const &iTransitionInfo, bool cleaningUpAfterException)