From: Brian G. <ge...@ro...> - 2003-12-02 17:17:48
|
On Tue, 2 Dec 2003, Reed Hedges wrote: > On Tuesday, December 2, 2003, at 04:22 AM, yye...@ds... wrote: > > I would like to run 2 copies of Player/Stage on my dual-CPU machine to > > make > > better use of the computational power. When I started the 2nd copy, I > > got this > > error: > ... > > ** Player v1.3.1 ** [Stage /tmp/stageIO.cluster.0] > > create_and_bind_socket():bind() failed; socket not created.: Address > > already in use create_and_bind_socket() failed; quitting > > The robots in the second stage need to use different ports, you can set > this in the "world" file: > > position ( > port 6665 > ... > ) > > position ( > port 6666 > ... > ) > > ... > > But since stage runs a player process for each robot, and each player > instance uses several kernel threads (I believe), it should be using > both of your CPUs anyway, right? Actually, there are a couple of problems here. First of all, you're running Stage 1.3.2 with Player 1.3.1, which isn't a good idea; you should use Player 1.3.2. Secondly, when Stage starts up, it grabs a couple of system resources: a port, and a "device directory" into which memory-mapped files are put for communication with Player. You can change the port used by Stage with the '-p <port>' command line arg. But there's currently no way to change the name of the device directory; it will always be '/tmp/stageIO.$USER.0'. So one user can't run two copies of Stage on the same machine; a workaround is to start the second copy as a different user. Yes, ugly, but what can I say. This constraint will go away in Stage 1.4. Also, as Reed says, you need to specify different ports for *all* of your robots, in *all* of your simulations running on a given machine. Finally, a minor clarification: each instance of Stage spawns one instance of Player, which listens on and services all ports for the robots in that simulation. In practice, Player uses rather little of your computational power; Stage and the client programs tend to use more, so you'll likely see Stage running on one CPU and your client(s) running on the other. brian. |