Skip to content

monarch_env: use main_function for -allocator target #32

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 3 additions & 4 deletions python/monarch/bootstrap_main.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,17 +15,17 @@


async def main():
from monarch._rust_bindings.monarch_hyperactor.bootstrap import bootstrap_main

await bootstrap_main()


def invoke_main() -> None:
def invoke_main():
# if this is invoked with the stdout piped somewhere, then print
# changes its buffering behavior. So we default to the standard
# behavior of std out as if it were a terminal.
sys.stdout.reconfigure(line_buffering=True)
global bootstrap_main
# TODO: figure out what from worker_main.py we should reproduce here.
from monarch._rust_bindings.monarch_hyperactor.bootstrap import bootstrap_main

with (
importlib.resources.path("monarch", "py-spy") as pyspy,
Expand All @@ -39,5 +39,4 @@ def invoke_main() -> None:


if __name__ == "__main__":
# Do not add code here, it won't be run. Add them to the function called below.
invoke_main() # pragma: no cover