Skip to content

Commit

Permalink
Global time coordinator (#2329)
Browse files Browse the repository at this point in the history
* add a globalTimeCoordinator mode for the root broker to manage time on a global fashion if desired

* require verification of time request to allow bypass advancement.

* add version to the timerequest

* update the timing

* add send on non-update to trigger

* refactor timecoordinator to better handle iterations in time

* add timing info message that contains some timing info and versioning information.

* add sequencing test to track down out of order bug

* Apply suggestions from code review

Co-authored-by: Ryan Mast <[email protected]>

Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
Co-authored-by: Ryan Mast <[email protected]>
  • Loading branch information
3 people authored Apr 28, 2022
1 parent 3af9dc9 commit 6ba0b6f
Show file tree
Hide file tree
Showing 47 changed files with 2,515 additions and 1,128 deletions.
6 changes: 5 additions & 1 deletion src/helics/core/ActionMessage.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -697,7 +697,7 @@ std::unique_ptr<Message> createMessageFromCommand(ActionMessage&& cmd)
static constexpr char unknownStr[] = "unknown";

// Map to translate the action to a description
static constexpr frozen::unordered_map<action_message_def::action_t, frozen::string, 93>
static constexpr frozen::unordered_map<action_message_def::action_t, frozen::string, 96>
actionStrings = {
// priority commands
{action_message_def::action_t::cmd_priority_disconnect, "priority_disconnect"},
Expand Down Expand Up @@ -742,6 +742,7 @@ static constexpr frozen::unordered_map<action_message_def::action_t, frozen::str
{action_message_def::action_t::cmd_time_check, "time_check"},
{action_message_def::action_t::cmd_time_block, "time_block"},
{action_message_def::action_t::cmd_time_unblock, "time_unblock"},
{action_message_def::action_t::cmd_request_current_time, "request current time"},
{action_message_def::action_t::cmd_pub, "pub"},
{action_message_def::action_t::cmd_bye, "bye"},
{action_message_def::action_t::cmd_log, "log"},
Expand All @@ -763,7 +764,10 @@ static constexpr frozen::unordered_map<action_message_def::action_t, frozen::str
{action_message_def::action_t::cmd_send_for_filter, "send_for_filter"},
{action_message_def::action_t::cmd_filter_result, "result from running a filter"},
{action_message_def::action_t::cmd_send_for_filter_return, "send_for_filter_return"},
{action_message_def::action_t::cmd_send_for_dest_filter_return,
"send_for_dest_filter_return"},
{action_message_def::action_t::cmd_null_message, "null message"},
{action_message_def::action_t::cmd_null_dest_message, "null destination message"},

{action_message_def::action_t::cmd_reg_pub, "reg_pub"},
{action_message_def::action_t::cmd_add_publisher, "add publisher"},
Expand Down
3 changes: 3 additions & 0 deletions src/helics/core/ActionMessage.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -251,6 +251,7 @@ inline bool isTimingCommand(const ActionMessage& command) noexcept
case CMD_ERROR:
case CMD_LOCAL_ERROR:
case CMD_GLOBAL_ERROR:
case CMD_TIMING_INFO:
return true;
default:
return false;
Expand Down Expand Up @@ -325,6 +326,8 @@ inline bool isIgnoreableCommand(const ActionMessage& command) noexcept
case CMD_LOG:
case CMD_WARNING:
case CMD_REMOTE_LOG:
case CMD_TIME_REQUEST:
case CMD_REQUEST_CURRENT_TIME:
return true;
default:
return false;
Expand Down
2 changes: 2 additions & 0 deletions src/helics/core/ActionMessageDefintions.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ across different compilers*/
cmd_exec_grant = 22, //!< grant entry to exec mode or iterate
cmd_exec_check = 24, //!< command to run a check on execution entry
cmd_ack = 254, //!< acknowledge command to for various purposes
cmd_timing_info = 310, //!< send some information to dependents on timing

cmd_stop = 30, //!< halt execution
cmd_terminate_immediately = 31, //!< immediate halt no-disconnect;
Expand Down Expand Up @@ -236,6 +237,7 @@ across different compilers*/
#define CMD_INIT action_message_def::action_t::cmd_init
#define CMD_INIT_NOT_READY action_message_def::action_t::cmd_init_not_ready
#define CMD_INIT_GRANT action_message_def::action_t::cmd_init_grant
#define CMD_TIMING_INFO action_message_def::action_t::cmd_timing_info
#define CMD_EXEC_REQUEST action_message_def::action_t::cmd_exec_request
#define CMD_EXEC_GRANT action_message_def::action_t::cmd_exec_grant
#define CMD_EXEC_CHECK action_message_def::action_t::cmd_exec_check
Expand Down
Loading

0 comments on commit 6ba0b6f

Please sign in to comment.