Skip to content

Commit

Permalink
Client bug fix
Browse files Browse the repository at this point in the history
  • Loading branch information
munrojm committed Jan 25, 2022
1 parent b800d24 commit b234f07
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/maggma/cli/__init__.py
Expand Up @@ -57,6 +57,7 @@
" mrun will find an open port if None is provided to the manager",
)
@click.option("-N", "--num-chunks", "num_chunks", default=0, type=int)
@click.option("-w", "--num-workers", "num_workers", default=0, type=int)
@click.option(
"--no_bars", is_flag=True, help="Turns of Progress Bars for headless operations"
)
Expand Down Expand Up @@ -100,7 +101,7 @@ def run(
root.critical(f"Using random port for mrun manager: {port}")
loop.run_until_complete(
manager(
url=url, port=port, builders=builder_objects, num_chunks=num_chunks
url=url, port=port, builders=builder_objects, num_chunks=num_chunks, num_workers=num_workers
)
)
else:
Expand Down
4 changes: 4 additions & 0 deletions src/maggma/cli/distributed.py
Expand Up @@ -32,6 +32,10 @@ async def manager(
"""
logger = getLogger("Manager")

if not num_chunks and num_workers:
raise ValueError("Both num_chunks and num_workers must be non-zero")


logger.info(f"Binding to Manager URL {url}:{port}")
context = zmq.Context()
socket = context.socket(REP)
Expand Down

0 comments on commit b234f07

Please sign in to comment.