Skip to content

Commit

Permalink
refactor(framework) Remove delayed start for Simulation Engine (#4688)
Browse files Browse the repository at this point in the history
  • Loading branch information
jafermarq authored Dec 16, 2024
1 parent 8f1bf1b commit 86825e5
Showing 1 changed file with 0 additions and 15 deletions.
15 changes: 0 additions & 15 deletions src/py/flwr/simulation/run_simulation.py
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,6 @@
import traceback
from logging import DEBUG, ERROR, INFO, WARNING
from pathlib import Path
from time import sleep
from typing import Any, Optional

from flwr.cli.config_utils import load_and_validate
Expand Down Expand Up @@ -136,7 +135,6 @@ def run_simulation_from_cli() -> None:
app_dir=args.app,
run=run,
enable_tf_gpu_growth=args.enable_tf_gpu_growth,
delay_start=args.delay_start,
verbose_logging=args.verbose,
server_app_run_config=fused_config,
is_app=True,
Expand Down Expand Up @@ -309,7 +307,6 @@ def _main_loop(
enable_tf_gpu_growth: bool,
run: Run,
exit_event: EventType,
delay_start: int,
flwr_dir: Optional[str] = None,
client_app: Optional[ClientApp] = None,
client_app_attr: Optional[str] = None,
Expand Down Expand Up @@ -354,9 +351,6 @@ def _main_loop(
run_id=run.run_id,
)

# Buffer time so the `ServerApp` in separate thread is ready
log(DEBUG, "Buffer time delay: %ds", delay_start)
sleep(delay_start)
# Start Simulation Engine
vce.start_vce(
num_supernodes=num_supernodes,
Expand Down Expand Up @@ -405,7 +399,6 @@ def _run_simulation(
flwr_dir: Optional[str] = None,
run: Optional[Run] = None,
enable_tf_gpu_growth: bool = False,
delay_start: int = 5,
verbose_logging: bool = False,
is_app: bool = False,
) -> None:
Expand Down Expand Up @@ -460,7 +453,6 @@ def _run_simulation(
enable_tf_gpu_growth,
run,
exit_event,
delay_start,
flwr_dir,
client_app,
client_app_attr,
Expand Down Expand Up @@ -538,13 +530,6 @@ def _parse_args_run_simulation() -> argparse.ArgumentParser:
"Read more about how `tf.config.experimental.set_memory_growth()` works in "
"the TensorFlow documentation: https://www.tensorflow.org/api/stable.",
)
parser.add_argument(
"--delay-start",
type=int,
default=3,
help="Buffer time (in seconds) to delay the start the simulation engine after "
"the `ServerApp`, which runs in a separate thread, has been launched.",
)
parser.add_argument(
"--verbose",
action="store_true",
Expand Down

0 comments on commit 86825e5

Please sign in to comment.