Houdini 20.0 PDG/TOPsを使ってタスクを実行する方法

サービスブロック

サービスブロックは、共有サービスプロセスを使用して実行するワークアイテムのセクションを定義することができます。

On this page

概要

Service blocks combine PDG services with feedback loops. A service block creates one or more loops with a fixed number of iterations and assigns a service worker process to that loop. The service process is locked to the loop and won’t be used by other work items in the graph until the loop has completed. Iterations within the loop cook sequentially in depth-first order, starting from the Begin node and cooking down to the End node.

You can configure compatible nodes within the block to execute on the service process assigned to the loop by changing their cook type to Service, and enabling the Run on Service Block parameter. The Command Send TOP node always runs on the containing service block. Other nodes such as Attribute Create or File Pattern executes normally, but their work items still follows the depth-first cook order imposed by the loop.

How to

Create a Service Block

  1. In a TOP network editor, press ⇥ Tab and choose a service block tool, such as Maya Service Block TOP or Houdini Service Block TOP.

The tool puts down a Block Begin node and a Service Block End node

  1. Select the Begin node. In the parameter editor, choose how to specify the number of sessions:

    • The number of sessions determines how many work items each loop in the block should have. The default is to run the number of iterations specified in the Number of sessions parameter. If the Begin node has upstream items, the block creates a loop of size session_count for each incoming work item.

    • You can turn on Session count from upstream items to create a single loop, with one iterations for each upstream items.

    • Multiple sessions from the same loop are cooked serially: the block cooks the first session from top to bottom before starting the second session.

      • Sessions from different loops can run in parallel.

  2. Connect Command Send nodes between the start and end nodes in their input and output to make them part of the loop.

    • The Command Send node is able to send script code to the service process.

  3. Depending on which type of service block, it’s possible to run other service-based nodes in the block.

    • For example, if the block uses the Houdini service you can include an HDA Processor or ROP Fetch inside the block, and configure it to run on the shared service process.

    • Other nodes that can’t run using the service can be included, and uses the normal scheduling workflow.

Houdini draws a border around the nodes in the block to help you visualize it.

Shared Servers (Deprecated)

In Houdini 19.5 and older, Service Blocks used their own custom server system called shared servers. This feature is now deprecated, but it’s still possible to configure a service block to use shared servers for compatibility with old files.

You can switch a service block to use a shared server by changing it’s Server Type parameter to Shared Server instead of Service.

There are several key differences to consider

  1. Unlike services, shared servers can only execute work items created using the Command Send TOP node

    • Other types of nodes can be included in the service block, but they run their work items using the normal scheduling work flow

    • Blocks that use services are able to run any type of work item that’s compatible with the service assigned to the block. For example, the Houdini Service Block can execute work items from a Python Script, HDA Processor, or ROP Fetch in addition to the Command Send.

  2. Shared servers are not suitable for use on the farm

    • The long-running server processes can’t be managed using a farm interface, so it can be hard to debug or terminate those tasks when problems occur

    • Shared server processes also don’t benefit from scheduler settings

Notes

  • The Begin node generates work items that lock a service worker process to the block. This ensures no other work items in the graph can interfere with the operations performed by the block.

  • The service worker is unlocked once the last End node work item for the block evaluates. If the graph is canceled or stops cooking before that point, all locked service processes unlocked.

  • You can set the Reset Service parameter on the Begin node to ensure that the state of the service process is reset at the beginning of each loop iteration.

  • The state of each service process can be inspected using the PDG Services list.

  • You should color the start and end nodes of a block the same to make their relationship clear. The default nodes put down by the built-in service block tools have different colors. You can change the node colors. This is useful to distinguish nested loops.

    The border around the block takes on the color of the end node.

Examples

The following directories contain example HIP files demonstrating how to use Houdini and Maya service blocks.

  • $HFS/houdini/help/files/pdg_examples/top_houdinipipeline

  • $HFS/houdini/help/files/pdg_examples/top_mayapipeline

PDG/TOPsを使ってタスクを実行する方法

基本

初心者向けチュートリアル

次のステップ

リファレンス

  • すべてのTOPsノード

    TOPノードは、データをネットワークに送り込んでワークアイテムに変換し、色々なノードでそれを制御するワークフローを定義します。たいていのノードは、ローカルマシンまたはサーバーファーム上で実行可能な外部プロセスを表現しています。

  • プロセッサ系ノードコールバック

    プロセッサ系ノードはスケジューラで実行可能なワークアイテムを生成します。

  • パーティショナー系ノードコールバック

    パーティショナー系ノードは複数の上流ワークアイテムを単一パーティションにグループ化します。

  • スケジューラ系ノードコールバック

    スケジューラ系ノードはワークアイテムを実行します。

  • 独自のファイルタグとハンドラー

    PDGはファイルタグを使用して出力ファイルのタイプを決めます。

  • Python API

    ディペンデンシーグラフを扱うためのPython PDGパッケージのクラスと関数。

  • Job API

    ジョブスクリプトで使用するPython API

  • ユーティリティAPI

    Python pdgutilsパッケージのクラスと関数は、PDGノードでの使用だけでなく、スクリプトやプロセス外のジョブスクリプトでの使用も想定されています。