waitForClients [<num-clients> [<command>]]
This command is used to synchronize clients and servers at the start or
end of training. It has several different functions. With no
waitForClients acts as a barrier: If called by
a client, the client will wait until the server releases it. If called
by the server, the server will wait until all of the clients are also
waiting and then the server will release itself and all clients. This
is useful for ensuring that the clients and server are ready before
training begins and is also useful at the end of training. A client can
only call this command with no arguments.
waitForClients is called by the server with a single
argument, the command will cause the server to wait until the specified
number of clients have connected. The clients themselves need not make
a wait call.
waitForClients is called by the server with a
number of clients and a command, the command will be executed once
that many clients have connected. If enough clients have already
connected, the command will be executed and then
waitForClients will return. Otherwise,
waitForClients will return immediately and the command will
be executed when enough clients have connected.
To run the script "trainIt.in" once five clients have connected:
lens> waitForClients 5 "source trainIt.in"
To wait for five clients and then continue processing the current script:
waitForClients 5 sendObj learningRate 0.01 ...