diff --git a/src/libraries/JANA/Engine/JExecutionEngine.cc b/src/libraries/JANA/Engine/JExecutionEngine.cc index 584c76831..41bc99f0b 100644 --- a/src/libraries/JANA/Engine/JExecutionEngine.cc +++ b/src/libraries/JANA/Engine/JExecutionEngine.cc @@ -683,16 +683,21 @@ bool JExecutionEngine::IsTimeoutEnabled() const { JArrow::FireResult JExecutionEngine::Fire(size_t arrow_id, size_t location_id) { std::unique_lock lock(m_mutex); + if (arrow_id >= m_topology->arrows.size()) { + LOG_WARN(GetLogger()) << "Firing unsuccessful: No arrow exists with id=" << arrow_id << LOG_END; + return JArrow::FireResult::NotRunYet; + } JArrow* arrow = m_topology->arrows[arrow_id]; - LOG_INFO(GetLogger()) << "Attempting to fire arrow with name=" << arrow->get_name() << ", index=" << arrow_id << LOG_END; + LOG_WARN(GetLogger()) << "Attempting to fire arrow with name=" << arrow->get_name() + << ", index=" << arrow_id << ", location=" << location_id << LOG_END; ArrowState& arrow_state = m_arrow_states[arrow_id]; if (arrow_state.status == ArrowState::Status::Finished) { - LOG_INFO(GetLogger()) << "Firing unsuccessful: Arrow status is Finished." << arrow_id << LOG_END; + LOG_WARN(GetLogger()) << "Firing unsuccessful: Arrow status is Finished." << arrow_id << LOG_END; return JArrow::FireResult::Finished; } if (!arrow_state.is_parallel && arrow_state.active_tasks != 0) { - LOG_INFO(GetLogger()) << "Firing unsuccessful: Arrow is sequential and already has an active task." << arrow_id << LOG_END; + LOG_WARN(GetLogger()) << "Firing unsuccessful: Arrow is sequential and already has an active task." << arrow_id << LOG_END; return JArrow::FireResult::NotRunYet; } arrow_state.active_tasks += 1; @@ -710,20 +715,20 @@ JArrow::FireResult JExecutionEngine::Fire(size_t arrow_id, size_t location_id) { if (event != nullptr || port == -1) { if (event != nullptr) { - LOG_INFO(GetLogger()) << "Input event #" << event->GetEventNumber() << " from port " << port << LOG_END; + LOG_WARN(GetLogger()) << "Input event #" << event->GetEventNumber() << " from port " << port << LOG_END; } else { - LOG_INFO(GetLogger()) << "No input events." << LOG_END; + LOG_WARN(GetLogger()) << "No input events" << LOG_END; } - LOG_INFO(GetLogger()) << "Firing arrow." << LOG_END; + LOG_WARN(GetLogger()) << "Firing arrow" << LOG_END; arrow->fire(event, outputs, output_count, result); - LOG_INFO(GetLogger()) << "Fired arrow." << LOG_END; + LOG_WARN(GetLogger()) << "Fired arrow" << LOG_END; if (output_count == 0) { - LOG_INFO(GetLogger()) << "No output events." << LOG_END; + LOG_WARN(GetLogger()) << "No output events" << LOG_END; } else { for (size_t i=0; iGetEventNumber() << " on port " << outputs.at(i).second << LOG_END; + LOG_WARN(GetLogger()) << "Output event #" << outputs.at(i).first->GetEventNumber() << " on port " << outputs.at(i).second << LOG_END; } } @@ -733,7 +738,7 @@ JArrow::FireResult JExecutionEngine::Fire(size_t arrow_id, size_t location_id) { lock.unlock(); } else { - LOG_INFO(GetLogger()) << "Firing unsuccessful: Arrow needs an input event on port " << port << " but the queue or pool is empty." << LOG_END; + LOG_WARN(GetLogger()) << "Firing unsuccessful: Arrow needs an input event from port " << port << ", but the queue or pool is empty." << LOG_END; } return result; diff --git a/src/libraries/JANA/Utils/JApplicationInspector.cc b/src/libraries/JANA/Utils/JApplicationInspector.cc index 26a520f71..368a0f516 100644 --- a/src/libraries/JANA/Utils/JApplicationInspector.cc +++ b/src/libraries/JANA/Utils/JApplicationInspector.cc @@ -32,8 +32,7 @@ void InspectTopology(JApplication* app) { void Fire(JApplication* app, int arrow_id) { auto engine = app->GetService(); - auto result = engine->Fire(arrow_id, 0); - std::cout << to_string(result); + engine->Fire(arrow_id, 0); } void InspectComponents(JApplication* app) {