This page has been translated automatically.
视频教程
界面
要领
高级
实用建议
专业(SIM)
UnigineEditor
界面概述
资产工作流程
设置和首选项
项目开发
调整节点参数
Setting Up Materials
设置属性
照明
Landscape Tool
使用编辑器工具执行特定任务
如何擴展編輯器功能
嵌入式节点类型
Nodes
Objects
Effects
Decals
光源
Geodetics
World Nodes
Sound Objects
Pathfinding Objects
Players
编程
基本原理
搭建开发环境
使用范例
C++
C#
UnigineScript
UUSL (Unified UNIGINE Shader Language)
Plugins
File Formats
Materials and Shaders
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
创建内容
内容优化
Materials
Material Nodes Library
Miscellaneous
Input
Math
Matrix
Textures
Art Samples
Tutorials
注意! 这个版本的文档是过时的,因为它描述了一个较老的SDK版本!请切换到最新SDK版本的文档。
注意! 这个版本的文档描述了一个不再受支持的旧SDK版本!请升级到最新的SDK版本。

分布式发电

警告
本文介绍的功能在 Community SDK 版本中不可用。
您应该升级到 Engineering / Sim SDK版本才能使用它。

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.地形生成是一项复杂的任务,可能需要大量时间,具体取决于区域大小和数据分辨率。 Sandworm 允许使用分布式计算来生成地形。

注意
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.当用于加速需要一个多小时的地形生成时,分布式计算是有意义的。应用分布式计算生成具有低细节数据(每像素 10 米或更多)的小地形区域可能根本无利可图。

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. UnigineEditor 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.这个概念是使用多台计算机联合成一个网络,其中一台是 Master 并分配任务,另一台是 Workers 执行分配给它们的部分工作(处理源数据)。带有 Sandworm 工具和地形项目的 UNIGINE 编辑器应该在 Master 上打开,而 Workers 运行控制台应用程序。源文件(地理数据)和公共缓存应存储在共享文件夹中。如果 Worker 仍有可用资源,则可以在其上运行其他进程并立即参与地形生成,即无需重新启动生成进程。 Master 根据结果创建资产。

注意
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.为特定地形生成作业执行计算的所有工作站必须在相同的操作系统(Windows 或 Linux)上运行。 UNIGINE SDK 版本也应该相同。

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.管理整个生成过程的计算机,形成任务池,并在 Workers 之间分配任务。 Master 跟踪所有连接的 Workers 并将任务分配给它们 。 Master 本身也执行计算。 Master 通过 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.通过网络连接到 Master 并执行 Master 分配的特定任务的计算机。通过运行 bin/SandwormNode_x64.exe 启用 Worker。

注意
The number of Workers connected to one Master is not limited (as long as the network bandwidth allows that).连接到一个 MasterWorkers 的数量不受限制(只要网络带宽允许)。

Launching Order发射令#

警告

Before launching any of the network participants, disable Microprofile for it — in \data\configs\default.user, set:在启动任何网络参与者之前,禁用微轮廓为此——在 \data\configs\default.user 中,设置:

源代码
<microprofile_enabled>0</microprofile_enabled>

Otherwise, every instance would run Microprofile, causing memory waste.否则,每个实例都会运行 Microprofile,造成内存浪费。

You can launch Master and Workers in any sequence.您可以按任何顺序启动 Master 和 Workers

You can run additional Workers after the terrain generation process has started, and Master will distribute jobs for them.您可以在地形生成过程开始后运行额外的 Workers,而 Master 将为它们分配作业。

One machine can have several Workers running. A Worker can have several processes (forks) that are activated via the menu on Master.一台机器可以运行多个 Workers。一个 Worker 可以有多个通过 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.将所有计算机连接到网络。建议使用带宽至少为1 Gb的网络。否则,您可能会遇到网络延迟(请参阅故障排除部分)。检查您的网络是否阻止广播,否则分布式计算将不可用。

    注意
    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.建议使用 SSD 驱动器来存储生成缓存和输出文件。如果使用 HDD,由于多次读/写和磁头定位操作,生成性能显着降低。
  2. On each Worker computer, run the Worker console application.在每台 Worker 计算机上运行 Worker 控制台应用程序.

    注意
    The versions of binary executable files must be the same on all computers.所有计算机上的二进制可执行文件的版本必须相同。
  3. On the Master computer:Master 计算机上

    • Run UnigineEditor and open the Sandworm tool (Tools -> Sandworm).跑步UnigineEditor并打开 Sandworm 工具 (Tools -> Sandworm)。
    • Open the *.sworm asset you are going to generate and configure the output settings.打开要生成的 *.sworm 资产并配置输出设置.
    • Click the Distributed option and specify the Master's settings. Save the project configuration.单击 Distributed 选项并指定 Master 的设置.保存项目配置。
    • Click the Generate button. The window with the list of available Workers will open:单击 Generate 按钮。包含可用 Workers 列表的窗口将打开:

      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.此窗口一打开,Workers 就开始解析共享源数据并生成缓存。在此过程结束时,将显示控制台消息 Worker: Ready To Import

    • Clicking the right mouse button on a Worker makes the following options available:Worker 上单击鼠标右键可以使用以下选项:

      Worker Options

      Worker Options工人选项
      Create Fork Creates one more process on the same Worker.
      最佳实践
      We estimate a reasonable number of forks as 4 to 6. Higher values reduce the Worker's performance.We estimate a reasonable number of forks as 4 to 6. Higher values reduce the Worker's performance.
      We estimate a reasonable number of forks as 4 to 6. Higher values reduce the Worker's performance.
      在同一个 Worker 上再创建一个进程。
      最佳实践
      We estimate a reasonable number of forks as 4 to 6. Higher values reduce the Worker's performance.我们估计合理数量的分叉为 4 到 6。较高的值会降低 Worker的性能。
      Shutdown Removes the fork or Worker from the list.从列表中删除 fork 或 Worker
      Clear Cache Clears the Worker's local cache.清除 Worker 的本地缓存。

      Set the number of forks you need and click Generate.设置所需的分叉数,然后单击 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.在生成过程中,您可以连接更多的 Workers,如有必要:在 Worker 上运行控制台应用程序(即使这个 Worker 已经在运行一个或多个)。这个控制台应用程序会自动连接到 MasterMaster 会给这个 Worker 分配一个进程。

  5. When the terrain generation is completed, disable all Worker processes.地形生成完成后,禁用所有 Worker 进程。

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,请在 Generation 部分中选择 Distributed 选项。在 Parameters 中,打开 Enabled 选项。

Master settings:Master 设置:

Enabled If toggled on, distributed computing is enabled for the terrain generation, and the machine running the Editor with Sandworm is Master.如果打开,则为地形生成启用分布式计算,运行编辑器的机器为 SandwormMaster
Broadcast Port Port for listening to Sandworm by Workers.通过 Workers 监听 Sandworm 的端口。
Server Port Port used for information exchange.用于信息交换的端口。
Workload on Master Percentage of terrain generation performed by Master.Master 执行的地形生成百分比。
注意
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.所有源和项目缓存都应存储在 Master 和所有 Workers 都可以访问的共享位置。此位置的路径在 MasterWorkers 上应相同。

Setting Up a Worker设置工人#

注意
Worker should have the same version of OS and UNIGINE SDK as Master.Worker 应该与 Master 具有相同版本的 OS 和 UNIGINE SDK。

To set up a Worker:要设置 Worker

  1. Create a new UNIGINE project on a Worker computer with the corresponding project feature enabled:创建具有相应项目的 Worker 计算机上的新 UNIGINE 项目特征启用:

    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:运行存储在项目的 bin/ 文件夹中的 SandwormNode_x64.exe 控制台应用程序。 Worker 准备就绪的消息应该出现在控制台中:

    Worker is ready for generation

  3. Set the path for storing the local cache using the --sw_local_cache_path console command.使用 --sw_local_cache_path 控制台命令设置存储本地缓存的路径。
  4. Use --sw_broadcast_port, if you want to change the default broadcast port.如果要更改默认广播端口,请使用 --sw_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 在网络上检测到 Master,连接到它,下载场景,准备所有图层(检查它们的可访问性),并准备好生成地形。

Worker application is running and ready for terrain generation

Worker application is running and ready for terrain generationWorker 应用程序正在运行并准备好生成地形

You can run multiple console applications on one machine and/or fork one Worker via Master to create more processes.您可以在一台机器上运行多个控制台应用程序和/或通过 Master 分叉一个 Worker 以创建更多进程。

注意
  • Operating System versions on Master and Workers should be identical.MasterWorkers 上的操作系统版本应该相同。
  • The SDK version of the Editor run on Master should be the same as the version of the console app (including precision).Master 上运行的编辑器的 SDK 版本应与控制台应用程序的版本相同(包括精度)。
  • Development/Release version of SDK does not matter.SDK 的 Development/Release 版本无关紧要。

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.当地形生成完成并且您不再需要 Workers 时,关闭 Workers 上的控制台应用程序或通过 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.如果网络延迟过大,尽管带宽为 1Gb 或更高,这可能是由连接到网络的 100 Mb 或 10 Mb 设备引起的。数据交换率下降到该设备支持的最大速率,降低了生成速度。

  • Some 100 Mb or 10 Mb devices can have a working network interface when they are turned off.某些 100 Mb 或 10 Mb 设备在关闭时可以具有工作网络接口。
  • Some 1 Gb devices, when turned off, have a network interface working at 100 Mb rate, which slows down connection on LAN.某些 1 Gb 设备在关闭时具有以 100 Mb 速率工作的网络接口,这会减慢 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.检查您在 MasterWorkers 上的项目是否使用相同的精度(doublefloat)、相同的引擎版本和相同的 GDAL 版本,否则 Workers 会显示不同的构建错误。
  • Use SSD to store shared source data and cache.使用SSD存储共享源数据和cache.
  • Add the application to the antivirus exclusions, as it may reduce performance.将应用程序添加到防病毒例外中,因为它可能会降低性能。
  • Check that network ports used by Master and Workers are allowed by the firewall.检查防火墙是否允许 MasterWorkers 使用的网络端口。
最新更新: 2022-05-21
Build: ()