Example 4: Running a distributed simulation with GUI

In this example, we run a simple distributed simulation with two workers. To run the example, you need to download the distributed version of SMARTS. The distributed version includes two binary files, one is server.jar, another is worker.jar.

To run a distributed simulation, you should first run server.jar. By default, the program shows the same GUI as in the standalone version. Note that the server listens on port 50000. Make sure this port is available.

Click Computing Resource in the control panel. Set Number of workers required to 2. Click the Apply button.

Now you need to launch two worker instances. The workers and the server can run on the same computer. They can also run on different computers. If a worker runs on the same computer as the server, you can launch worker.jar directly without specifying the IP address of the server. If the worker runs on a different computer, you need to specify the IP address of the server. For example, the command for launching a worker can be “java -jar worker.jar 192.168.1.10”, assuming the server runs on 192.168.1.10.

The Number of connected workers will be updated on server’s GUI. When this value equals the number of workers required, you can set up simulations as in a standalone version.