nvflare.recipe.sim_env module¶
- class SimEnv(*, num_clients: int = 0, clients: list[str] | None = None, num_threads: int | None = None, gpu_config: str | None = None, log_config: str | None = None, workspace_root: str = '/tmp/nvflare/simulation', extra: dict | None = None)[source]¶
Bases:
ExecEnvInitialize simulation execution environment.
- Parameters:
num_clients (int, optional) – Number of simulated clients. Defaults to 0.
clients (list[str], optional) – List of client names. Defaults to None.
num_threads (int, optional) – Number of threads to run simulator. Defaults to None. If not provided, the number of threads will be set to the number of clients.
gpu_config (str, optional) – GPU configuration string. Defaults to None.
log_config (str, optional) – Log configuration string. Defaults to None.
workspace_root (str, optional) – Root directory for simulation workspace. Defaults to WORKSPACE_ROOT.
extra – extra env config info
- deploy(job: FedJob)[source]¶
Deploy a FedJob and return an execution response.
- Parameters:
job – The FedJob to deploy.
- Returns:
The job ID.
- Return type:
str