Versions Compared

Key

  • This line was added.
  • This line was removed.
  • Formatting was changed.
Comment: Reverted from v. 9(CHIANA CASE)


Section


Column

为应用程序实施自动拦截接口的一般过程如下:

  1. 确保要分配的进程管理工具支持并行执行非依赖进程。
  2. 创建 Profile XML 文件,介绍将远程执行的工具和作为调用程序的工具。
  3. 创建 Profile XML 文件,为需要 IncrediBuild 处理的各个任务指定设置,无论这些任务属于调用程序或需要远程运行。 您需要 IncrediBuild 处理的任务,不必在 XML 配置文件中声明。
对于每个调用程序任务,请设置AllowIntercept=true
应在 Profile XML 中定义软件中的主可执行文件,并将 AllowIntercept 属性设置为“True”。
如果即将远程执行的进程由主可执行文件的子进程生成,则由主可执行文件启动的整个进程架构都应将 AllowIntercept 属性设置为“True”。
例如,如果主项目是“a”,由“a”执行“b”,“b”执行“c”(我们希望分配该进程的执行),则必须通过将 AllowIntercept 属性设置为“True”来指定“a”和“b”。
对于即将分配给远程计算机的每个任务,请设置
AllowRemote=true

4.通过 IBConsole 命令运行使用 IncrediBuild 加速的应用程序或工具,提供 Profile XML 文件名称以及作业的命令行,或是包含运行应用程序的命令的批处理文件名称(请参阅以下详细信息)。 出于测试目的,在运行应用程序时,激活的进程数将超过本地计算机上拥有的核心数量,因此 IncrediBuild 必须在远程计算机上分配某些进程。

如果使用“/COMMAND=”语法运行 IBConsole.exe ,则会对 /COMMAND 参数(或 .bat 文件的 cmd.exe)中指定的应用程序隐式赋予 AllowIntercept 行为。

注意:

  • 通过将 AllowRemote 设置为“True”来指定可执行文件,这会在指定核心(例如,远程核心)中自动执行该分支下的所有进程。 因此,无需为每个子任务指定 AllowRemote。

在自动拦截接口中使用 IBConsole.exe

上述步骤执行完成后,可以使用命令行字符串在并行进程执行模式下运行任何工具。
应将此命令行指定为 IBConsole.exe 的输入参数(请参见以下示例)。
注意,同样在命令行参数中指定了 Profile XML 文件。

该进程应该在本地并行模式下执行,而在 Profile XML 文件中通过“AllowRemote=True”指定的工具则在远程计算机上执行。

通过 XML 接口运行已分配 XML 作业的基础命令行语法为:

The general procedure for implementing Automatic Interception Interface for your application is as follows:

  1. Make sure the tool managing the process to be distributed supports parallel execution of non-dependent processes.
  2. Create a Profile XML file describing the tools which are to be executed remotely and also describes the tools that are invokers.
  3. Create a Profile XML file that specifies the settings for each task that you want IncrediBuild to handle, whether they are tasks that are invokers or tasks that you want to run remotely. Tasks that you do not want IncrediBuild to handle, you do not have to declare in the XML profile file.

    For each invoker task, set
    AllowIntercept=true

    The main executable in your software should be defined in the profile XML with the AllowIntercept attribute set to "True".

    If the process to be executed remotely is spawned by a child process of the main executable, the entire hierarchy of processes starting from the main executable should have the AllowIntercept attribute set to "True".

    For example, if the main project is "a", which executes "b", and "b" executes "c" (the process whose execution we wish to distribute), then both "a" and "b" must be specified with the AllowIntercept attribute set to "True".

    For each task that is to be distributed to a remote machine, set
    AllowRemote=true
  4. Run the application or tool to be accelerated with IncrediBuild, through the IBConsole command, supplying the name of the profile XML file and either a command line for the Job, or the name of the batch file containing the command that executes your application (see below for more details). For testing purposes, run the application in such a way that it will activate more processes than the number of cores that you have on the local machine so that IncrediBuild will have to do distribution for some of the processes on a remote machine.
    If you are running IBConsole.exe with the "/COMMAND=" syntax, the application specified in the /COMMAND argument (or cmd.exe for a .bat file) will be implicitly given the AllowIntercept behavior.

Note:

  • When an executable is specified with AllowRemote set to "True", all the processes under its branch are automatically executed within the designated core (e.g. remote core). Therefore, it is not necessary to specify AllowRemote for each subtask.


Using IBConsole.exe with the Automatic Interception Interface

Once the above steps have been performed, a command line string can be used to run any tool with parallel process execution mode.
This command line should be specified as an input argument to IBConsole.exe (see examples below).
Note that the profile XML file is also specified in the command line arguments.


The process should execute in local parallel mode, with tools specified with "AllowRemote=True" in the Profile XML file executed on remote machines.

The basic command line syntax for running a distributed XML job through the XML Interface is:

IBConsole.exe /command="<TOOL COMMAND>" /profile="<PROFILE XML>" [Other Options]

其中Where:

  • <TOOL COMMAND>
- 在启用并行进程执行模式时用于运行工具的命令行字符串
  •   the command line string used to run the tool with the parallel process execution mode enabled
  • <PROFILE XML>
–  文件
  • 其他选项 - 请参阅 IBConsole 命令参考部分了解更多 IBConsole.exe 命令行选项。
  • 作为使用 Profile XML 文件的替代方法,还可在 IBConsole 命令行中显式指定 AllowIntercept 和 AllowRemote 指令:
    • file
    • Other Options  Refer to the IBConsole Command Reference section for more IBConsole.exe command line options.


      As an alternative to using a Profile XML file, it is possible to specify the AllowIntercept and AllowRemote directives explicitly in the IBConsole command line:

      IBConsole.exe /command="<TOOL COMMAND>" /allowremote="<FILENAME1[,FILENAME2,...]>" /allowintercept="<FILENAME1[,FILENAME2,...]>" [Other Options]

    其中Where:

    • <TOOL COMMAND>
    - 在启用并行进程执行模式时用于运行工具的命令行字符串
    •   the command line string used to run the tool with the parallel process execution mode enabled
    • <FILENAME1[,FILENAME2,...]>
    - 逗号分隔的工具文件名列表
  • 其他选项 - 请参阅 IBConsole 命令参考部分了解更多exe 命令行选项。
  • 示例

    假设您有一个名为 RenderApp.exe 的应用程序,该程序与 RenderTask.exe 的许多任务并行运行,其中每个 RenderTask.exe 都将获取框架并渲染。 如果以正常方式运行此应用程序,即,没有多核心,则您可以按以下方式调用:
    •   a comma-separated list of tool filenames
    • Other Options - Refer to the IBConsole Command Reference section for more IBConsole.exe command line options.

    Example

    Let us say you have an application called RenderApp.exe, which knows to run in parallel many tasks of RenderTask.exe, where each RenderTask.exe gets a frame and renders it. If you run this application in a regular way, i.e. without multiple cores, you can call it as follows:

    RenderApp 1-1000

    这会导致应用程序依次应用

    This causes the application to run sequentially 1000 tasks of RenderTask.exe

    的 1000 个任务,并在每次运行时都会显示帧 (

    , and each time to bring it a frame (from 1-1000)

    并渲染。 这就意味着,完成渲染所有帧的所需时间是处理单个帧的 1000 倍。除此之外,您可以使用此应用程序支持的其他方法。 在此方法中,我们将使用本地计算机上的本地核心。 此时,您可以调用 RenderApp 在四个核心上运行,如下所示:

    and render it. Doing so means that it will take 1000 times the time needed to process one frame, to complete the rendering of all the frames.

    Instead of using this method, you can use another method, also supported by this application. In this method, the local cores on the local machine are used. In this case, you call RenderApp to run on four cores, as follows:

    RenderApp 1-1000 –cores4

    此时,该应用程序会在计算机的四个核心上同时运行四个

    This causes the application to run four RenderTask.exe

    任务,而不是每次运行一个任务。 使用此方法,运行 1000 个任务所需的时间相当于运行 250 个单独任务的时间。

    使用 IncrediBuil,您可按 XML 文件的方式创建 Profile,该文件指定 IncrediBuild 如何在应用程序中处理其他任务(进程)。 由于主应用程序 RenderApp 在本地计算机上运行,并且是子进程的调用程序,您可以通过 AllowIntercept=true 在 Profile XML 中定义。而且,由于 RenderTask 将在远程计算机上运行,您可以将其定义为远程任务。

    注意:

    您不需要在远程计算机上安装任何程序,也无需向其上传任何文件。 IncrediBuild 在处理这些任务时,就像远程计算机上的核心位于本地计算机一样。

    tasks on the machine's four cores at once, instead of running one task at a time. Using this method, 1000 tasks will run in the time that it takes to run 250 single tasks.

    Using IncrediBuild, you can create a Profile, in the form of an XML file, which specifies to IncrediBuild how to process the different tasks (processes) in the application. As RenderApp, the main application, runs on the local machine, and is the invoker of sub-processes, you can define it in the Profile XML with AllowIntercept=true. Also, as RenderTask is to be run on a remote machine, you can define it as a remote task.

    Note:

    • You are not required to install anything on the remote machine, and also do have to upload any files to it. IncrediBuild processes the tasks as if the cores on the remote machine are on on the local machine.

    RenderApp.exe AllowIntercept=true
    RenderTask.exe AllowRemote=true


    <?xml version="1.0" encoding="UTF-8" standalone="no" ?>
    <Profile FormatVersion="1">
        <Tools>
            <Tool Filename=" RenderApp" AllowIntercept="true" />
            <Tool Filename=" RenderTask" AllowRemote="true" />
                </Tools>
    </Profile>

    在此示例中,IncrediBuild 的工作流程如下:

    1. IncrediBuild 执行主进程exe。
    2. IncrediBuild 将会拦截与exe 即将执行的流程调用相关的所有调用,并将这些调用与 profile.xml 文件中标记为“AllowRemote=true”的进程列表进行比较。
    3. 当 IncrediBuild 遇到在进程中标记为 AllowRemote=true 的进程调用,则 IncrediBuild 引擎不会本地执行此进程,而是将其分配给远程计算机。
    4. 远程执行进程生成的任何输出都会转发至本地计算机(发起程序),就像在其中一个本地核心上执行一样。
    要进一步加速 RenderApp 执行,建议不要运行 RenderApp 1-1000 –cores4,而是运行命令

    IncrediBuild’s work flow for this example is as follows:

    1. IncrediBuild executes the main process RenderApp.exe.
    2. IncrediBuild intercepts all calls, which relate to process invocation that RenderApp.exe is to perform, and compares them to the list of processes that are marked in the profile.xml file as “AllowRemote=true”.
    3. When IncrediBuild encounters a process invocation that is marked in the process as AllowRemote=true, the IncrediBuild engine distributes this process to a remote machine instead of executing it locally.
    4. Any output generated by the remotely executed process is forwarded to the local machine (Initiator) as though it was executed on one of the local cores.

    To further accelerate execution of RenderApp, it is recommended that instead of running RenderApp 1-1000 –cores4, to run the command

    IBConsole RenderApp.exe 1-1000 -cores1000 /profile=profile.xml

    这会导致 1000 个任务进入 IncrediBuild 队列,且 IncrediBuild 会根据可用核心数量管理任务执行。例如,如果 200 个核心可用,则会每次运行 200 个任务,从而运行 1000 个任务的时间只相当于运行 5 个任务的时间。

    欢迎您在 IncrediBuild 安装文件夹下

    This causes 1000 tasks to enter the IncrediBuild queue, with IncrediBuild managing the execution of the tasks according to the number of available cores. For example, if 200 cores are available, it runs 200 tasks at a time, thus finishing to run all 1000 tasks in the amount of time it takes to run five tasks.


    此示例需要以下参数:

    要运行的 exe 文件

    You are welcome to look at our sample projects under the IncrediBuild installation folder in Samples\Dev Tools Interfaces Usage Samples\Interception Interface

    中查看我们的示例项目。其中一个示例 Sample Project 展示了简单的自动化拦截示例。

    . One such sample is Sample Project, which demonstrates a simple automatic interception sample.

    This sample requires the following parameters:

    自动拦截接口示例项目:

    以下示例进行了作业演示,其中名为 MainProcess 的进程执行多个名为 Dummy 的子进程。

    以下示例中的 XML 文件另存为 Profile.xml
    • The exe to run (DummyProcess.exe)
  • 执行进程的次数
  • 终止进程前的休眠时间
  • [可选]子进程自行终止前的时间
    • The number of times to execute the process
    • The sleep time before killing the processes
    • [optional] The time until the sub-process kills itself

    Automatic Interception Interface Sample Project:

    The following sample demonstrates a job in which a process having the name MainProcess executes many sub-processes having the name Dummy.

    The XML file in the following sample is saved as Profile.xml.

    • IBConsole /command="MainProcess.exe DummySubProcess.exe 10 2000 2000" /profile="profile.xml" /openmonitor /title="Automatic Interception Sample"
    在此示例中,MainProcess

    In this example, MainProcess.exe

    并行加速

    accelerates in parallel 10 instances of DummySubProcess.exe

    的 10 个实例,每个实例运行两秒钟。 由于这些流程在配置文件中定义为 AllowRemote=true,因此将在本地和远程计算机上运行。

    , each running for two seconds. As the processes are defined in the profile as AllowRemote=true, they run on both the local and remote machines.


    Column
    width15


    Div
    alignleft

    集成接口Integration Interfaces:

    Child pages (Children Display)
    styleh4
    pageIntegration Interfaces

    IncrediBuild Solutions 简介:

    Child pages (Children Display)
    styleh4
    pageIncrediBuild Solutions

    用户手册User Manual:

    Child pages (Children Display)
    styleh4
    pageIncrediBuild Windows User Manual





    ...