This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
UnigineEditor
界面概述
资产工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
Setting Up Properties
照明
Landscape Tool
使用编辑器工具执行特定任务
Extending Editor Functionality
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
Usage Examples
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Rebuilding the Engine Tools
GUI
双精度坐标
应用程序接口
Containers
Common Functionality
Controls-Related Classes
Engine-Related Classes
Filesystem Functionality
GUI-Related Classes
Math Functionality
Node-Related Classes
Objects-Related Classes
Networking Functionality
Pathfinding-Related Classes
Physics-Related Classes
Plugins-Related Classes
IG Plugin
CIGIConnector Plugin
Rendering-Related Classes
创建内容
Content Optimization
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

Distributed Generation

Warning
The functionality described in this article is not available in the Community SDK edition.
You should upgrade to Engineering / Sim SDK edition to use it.

Terrain generation is a complex task and may require substantial time depending on the area size and data resolution. Sandworm allows using distributed computing to generate terrain.

Notice
Distributed computing makes sense when used for speeding up terrain generation that takes more than an hour. Applying distributed computing to generate a small terrain area with low-detail data (10 meters or more per pixel) may be unprofitable at all.

The concept is to use several computers united into a network, one of which is Master and assigns tasks, and the other are Workers that perform portions of work (processing of source data) assigned to them. UNIGINE Editor with the Sandworm tool and a terrain project should be open on Master, while Workers run the console application. Source files (geodata) and common cache shall be stored in a shared folder. If a Worker still has available resources, additional processes may be run on it and participate in terrain generation immediately, i.e., without restarting the generation process. Master creates the asset based on the result.

Notice
All workstations performing computations for a certain terrain generation job must be running on the same operating system (Windows or Linux). UNIGINE SDK version should also be the same.

Participants of the process:

Master

Computer that manages the whole generation process, forms the task pool, and distributes tasks between Workers. Master tracks all connected Workers and assigns tasks to them. Master itself also performs calculations. Master is run via Sandworm.

Worker

Computer connected over the network to Master and performing specific tasks assigned by Master. Worker is enabled by running bin/SandwormNode_x64.exe.

Notice
The number of Workers connected to one Master is not limited (as long as the network bandwidth allows that).

Launching Order#

Warning

Before launching any of the network participants, disable Microprofile for it — in \data\configs\default.user, set:

Source code
<microprofile_enabled>0</microprofile_enabled>

Otherwise, every instance would run Microprofile, causing memory waste.

You can launch Master and Workers in any sequence.

You can run additional Workers after the terrain generation process has started, and Master will distribute jobs for them.

One machine can have several Workers running. A Worker can have several processes (forks) that are activated via the menu on Master.

Using Distributed Generation#

Workflow:

  1. Prepare your environment.

    Connect all computers to the network. It is recommended to use a network with at least 1 Gb bandwidth. Otherwise, you may experience network lags (see the Troubleshooting section). Check that your network doesn't block broadcasting, otherwise distributed computation will be unavailable.

    Notice
    It is recommended to use an SSD drive to store the generation cache and output files. If an HDD is used, the generation performance is significantly lower due to multiple read/write and head positioning operations.
  2. On each Worker computer, run the Worker console application.

    Notice
    The versions of binary executable files must be the same on all computers.
  3. On the Master computer:

    • Run UnigineEditor and open the Sandworm tool (Tools -> Sandworm).
    • Open the *.sworm asset you are going to generate and configure the output settings.
    • Click the Distributed option and specify the Master's settings. Save the project configuration.
    • Click the Generate button. The window with the list of available Workers will open:

      Distributed Generation Window

      As soon as this window is open, Workers start parsing the shared source data and generating cache. In the end of this process, the console message Worker: Ready To Import is displayed.

    • Clicking the right mouse button on a Worker makes the following options available:

      Worker Options

      Worker Options
      Create Fork Creates one more process on the same Worker.
      Best Practice
      We estimate a reasonable number of forks as 4 to 6. Higher values reduce the Worker's performance.
      Shutdown Removes the fork or Worker from the list.
      Clear Cache Clears the Worker's local cache.

      Set the number of forks you need and click Generate.

  4. During the generation process, you can connect more Workers, if necessary: run the console application on a Worker (even if this Worker is already running one or several). This console application will automatically connect to Master, and Master will assign a process to this Worker.

  5. When the terrain generation is completed, disable all Worker processes.

Setting Up the Master#

To set up Master, select the Distributed option in the Generation section. In the Parameters, toggle on the Enabled option.

Master settings:

Enabled If toggled on, distributed computing is enabled for the terrain generation, and the machine running the Editor with Sandworm is Master.
Broadcast Port Port for listening to Sandworm by Workers.
Server Port Port used for information exchange.
Workload on Master Percentage of terrain generation performed by Master.
Notice
All sources and project cache should be stored in a shared location accessible by both Master and all Workers. The path to this location should be identical on Master and Workers.

Setting Up a Worker#

Notice
Worker should have the same version of OS and UNIGINE SDK as Master.

To set up a Worker:

  1. Create a new UNIGINE project on a Worker computer with the corresponding project feature enabled:

    Enabling a Worker application

  2. Run the SandwormNode_x64.exe console application stored in the bin/ folder of your project. The message that Worker is ready should appear in console:

    Worker is ready for generation

  3. Set the path for storing the local cache using the --sw_local_cache_path console command.
  4. Use --sw_broadcast_port, if you want to change the default broadcast port.
  5. Worker detects Master on the network, connects to it, downloads the scene, prepares all layers (checks their accessibility), and is ready for terrain generation.

Worker application is running and ready for terrain generation

Worker application is running and ready for terrain generation

You can run multiple console applications on one machine and/or fork one Worker via Master to create more processes.

Notice
  • Operating System versions on Master and Workers should be identical.
  • The SDK version of the Editor run on Master should be the same as the version of the console app (including precision).
  • Development/Release version of SDK does not matter.

When the terrain generation is completed and you don't need Workers anymore, close the console application on Workers or shut down processes via Master.

Troubleshooting#

If the network latency is too large despite 1Gb bandwidth or higher, this can be caused by a 100 Mb or 10 Mb device connected to the network. Data exchange rate drops down to the maximum rate supported by such device, slowing down the generation speed.

  • Some 100 Mb or 10 Mb devices can have a working network interface when they are turned off.
  • Some 1 Gb devices, when turned off, have a network interface working at 100 Mb rate, which slows down connection on LAN.

Other recommendations:

  • Check that your projects on Master and Workers use the same precision (double or float), the same engine versions, and the same GDAL versions, otherwise the Workers would display the Different Builds error.
  • Use SSD to store shared source data and cache.
  • Add the application to the antivirus exceptions, as it may reduce performance.
  • Check that network ports used by Master and Workers are allowed by the firewall.
Last update: 2021-12-13
Build: ()