-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathrun_federated.ps1
More file actions
25 lines (20 loc) · 846 Bytes
/
run_federated.ps1
File metadata and controls
25 lines (20 loc) · 846 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
# Pornește serverul
Write-Host "Pornesc serverul..."
$server = Start-Process -FilePath "python" -ArgumentList "-m model_side.federated.server --num_rounds 1 --num_clients 3 --local_epochs 2" -PassThru
# Așteaptă ca serverul să se inițializeze
Start-Sleep -Seconds 3
# Pornește cei 3 clienți
$clients = @()
for ($i = 0; $i -lt 3; $i++) {
Write-Host "Pornesc clientul $i..."
$client = Start-Process -FilePath "python" -ArgumentList "-m model_side.federated.client --client_id $i --server_address 127.0.0.1:8080" -PassThru
$clients += $client
}
# Așteaptă ca serverul să termine
Wait-Process -Id $server.Id
# Când serverul se oprește, închide clienții
foreach ($client in $clients) {
Write-Host "Oprire client $($client.Id)..."
Stop-Process -Id $client.Id -Force
}
Write-Host "Toate procesele au fost oprite."