并行处理可以在性能方面是一个大问题。现代计算机有多个核心和这些核心的传播过程充分利用可用的计算能力。

FME通过定义多个进程的参数利用。加上平行过程的变换器还具有“输入有序”参数,这是另一个性能增强工具。

Except… we saw support cases and test results that suggested we ought to redesign the parallel processing setup; so for FME 2019 that’s exactly what we did!

平行处理如何在2019年发生变化

In brief, we removed the parallel processing option from all individual transformers in FME 2019:

注意没有并行处理参数(加上输入已订购is nowGroup By Mode)。但别担心!并行处理仍然可用。只有现在它可以单独使用定制变形金刚的选项。

If you’re not that interested in为什么我们做了更改,然后跳到下面的“FME 2019和并行处理”。

But if you want to know the reasons, carry on reading…

并行处理问题

并行处理复杂。也许比我们的界面更复杂。用户需要计划创建多少进程以及每个进程处理多少功能。此外,还有并发症等功能(在并行处理时可以改变)。

简而言之,通过FME2018,我们觉得用户更能减慢工作空间,而不是加快它。有一些原因......

Interface Design

在设计术语中,并行处理的复杂性通过其参数的突出来复杂。我们姗姗来迟地意识到功能应该not出现在每个变压器对话框的顶部!它令人困惑,它与变压器的核心目的无关。

2018平行处理参数

想象一下,如果电视遥控器上最大的纽扣是用于微调图片颜色!因此,这是将并行处理移动到某处的一个原因不太明显。复杂性和突出的混合鼓励不正确使用并行处理。最常见的错误是流程数......

Multiple Parallel Processing

正如您所知,启动和停止FME流程有一个开销。在将数据传递到另一个过程中也是一个开销。所以过量的过程慢了翻译。理想的方案是有更少的流程,致力于更多功能。当有很多小的工作时,额外的开销大于并行处理的增益。整体翻译速度较慢,而不是更快。

Take this example workspace in FME2018:

让我们开始破坏一个神话。您可能会认为,因为所有三个变压器都设置为并行过程数据,它们可能会同时启动多个进程,将计算机带到其膝盖。那不是这种情况。在所有区域Builder进程都完成之前,灾难仪不会启动任何进程。因此,过程的数量不会螺旋地失控。

That’s good.

但是,所有三个变压器由相同的属性组!!

让我们说有8个社区。每个变压器都会创建8个进程。我们知道工作区不会同时运行24个进程。但是,它run 24 processes in total. It doesn’t need to, though, because the groups are going to be the same for each transformer! It could do the same work in just 8 processes.

正如我稍后演示的那样,如果作者已经进入了自定义变压器并应用了并行处理,则流程较少。所以,这是我们改变的另一个原因。新的设计鼓励正确的行为,因此提交人更有可能会做正确的事情,即使他们不知道它!

非平行变压器

用自定义变压器并行处理的加密处理的额外好处是它并行化所有变形金刚,是否是基于组的。例如,让我们将测试仪变换器放入前面的示例:

使用此布局,区域Builder的8个进程然后会聚回测试仪的单个过程。然后,它们划分为8个处理灾难。除了停止/启动过程之外,测试仪效率低下,因为它是单一过程。

如果在自定义变换器中创建了这一点,则并行处理也适用于测试仪,这使其更有效。

输入有序和并行处理

输入已订购parameter is interesting because it was tied directly to parallel processing, both in our code and by virtue of being adjacent in the parameters dialog:

Because it’s in the same block of parameters, it looks like it must be related. In fact it isn’t. At least, it’s related in that they are both performance-related; but there’s no reason your data has to be ordered to use parallel processing, or that ordered data must be processed in parallel.

因此,我们解耦了这两个参数以减少混淆,并防止用户以错误应用它们。特别地,输入有序参数也控制whatis processed in a group, so it’s especially important to not misuse it. It also got renamed and new option names to make it clearer what it is for:

这就是为什么我们做出这些变化。现在让我们看看FME 2019的并行处理是什么样的......

FME 2019 and Parallel Processing

Parallel processing in FME 2019 is now restricted to custom transformers. That’s not a new capability. It was always possible to parallel process data that way. But – for the reasons mentioned above – this is now the只要途中并行过程数据。

Let’s take the previous example, now in 2019:

显然没有不再有并行处理选项。因此,我将其转换为自定义变压器并在其参数中设置并行处理:

Parallel Processing in 2019 Custom Transformer

请注意,打开并行处理会自动添加一个已发布的参数(如果没有组,则无法进行并行处理以划分数据)。因此,我返回主画布,打开“参数”对话框,并将组按参数设置为邻居名称:

Now when the workspace runs, there is a separate process per group. But, importantly, each process covers all three of the transformers, so there are fewer processes starting.

此外,如果我们添加额外的变压器 - 就像这个测试仪......

......它太并行运行,这是一个额外的奖金。

当然,您不需要非常敏锐地注意到邻居名称在变换器对话框中出现两次:

这是为什么?

不必要的用户参数

回想一下FME会自动发布自定义变压器中使用的所有属性。这使得变压器用于多个位置,其中(在此示例中)“邻居名称”可能无法使用。因此,在创建自定义变压器时,FME自动完成了这些已发布的参数中的第一个,并且激活并行处理时的第二个参数。

我们需要两者吗?好吧,这取决于我正在使用邻居姓名的地方。我可以从逐个参数中删除对此的任何引用,因为整个自定义变压器现在是一个大型组。如果我没有在其他任何地方使用邻居名称,则是,我可以删除第一个发布的参数。我不需要使用它。

但是,如果 - 例如 - 我在测试器变压器中使用邻居名称,那么我可能希望保留第一个发布的参数。第一个提示我用于测试属性,第二个提示我为组的属性提示。

Here I’m going to remove the parameter created with the custom transformer.

So first I unset the Group-By parameter in each individual transformer. Then I remove the user parameter; not by deleting the parameter itself, but by unchecking that attribute from the Input port:

This hides the attribute and – it no longer being necessary – also removes the published parameter automatically.

If I do remove an attribute reference this way, then I should definitely check the custom transformer to see if any parameter became flagged as incomplete (turned red). This would indicate that I’d used the attribute somewhere I hadn’t yet dealt with.

FAQ

Q)如果我想将并行处理应用于单个变压器,该怎么办?
一种)To apply parallel processing to a single transformer, you’ll need to wrap it in a custom transformer. It’s a little more inconvenient, but we think the overall set-up is better.
Q)如果我想将并行处理应用于自定义变压器内的单个变压器,该怎么办?
一种)To apply parallel processing to a single transformer inside a custom transformer, you would wrap that in its own custom transformer. Remember that you may nest custom transformers inside one another.
Q)如果多个变压器需要并行处理,但用不同的组?
一种)If multiple transformers need parallel processing, but with different groups, then wrap each section inside a separate custom transformer.
Q)我发现一个具有并行处理参数的个体变压器仍在那里。为什么还在那里?
一种)我们的更新比删除GUI的参数更具更多涉及,并且有一些变形金刚尚未更新。后面的FME版本可以排除参数,因此我们仍然在所有情况下推荐自定义变压器方法。

概要

In short, the important issue here is performance. Workspace authors always look to gain a performance advantage and using parallel processing is an obvious method to do that. Unfortunately, it was a little too obvious. We felt that new users could – in attempting to speed up their translations – actually slow them down.

这就是为什么我们将并行处理参数移动到自然更好地表现的地方。

顺便提一下,您可能注意到以上FME 2019的屏幕截图处于“暗模式”。这只是我们希望在即将发布的释放中享受的其他有用更新之一。

关于fme. 最佳实践 自定义变压器 FME Desktop FME福音师 基于小组 通过...分组 Parallel Processing Performance

马克爱尔兰

Mark,Aka Imark,是FME Evangelist(EST.2004),并对FME培训有热情。他喜欢能够以新的和有趣的方式帮助人们理解和使用技术。他的其他一个激情是足球(又名。足球)。他非常喜欢技术和足球,以至于他在一起写了一篇关于这两者的文章!谁会想到?(答案:imark)

评论

5回应“并行处理和FME:2019年重新设计”

  1. 布拉德·赫克罗斯 说:

    我认为这种变化肯定会重构一些复杂的工作空间,值得努力,也许会给更多管道带来并行处理。

    Also, is there any reference to how parallel processing is achieved in various within the desktop and server architectures? Are you utilizing local CPU cores? Offloading to GPUs? Both? Something else?

    • 马克爱尔兰 说:

      这是本地CPU核心。每个FME进程将在不同的核心上运行,与核心数量,FME许可证和并行处理设置相关的最大流程数(最小,中等,攻击性,极端)。看到the documentationfor more info about those numbers. I’ve asked the developers about GPU processing and I’m told it’s fairly limited right now. We envisage it being applied to graphics-intensive processes (like the Data Inspector) rather than the processing engine. But at this point there are no specific plans for that.

  2. virtualcitymatt 说:

    Hiya Mark,只是想知道是否有计划有类似的实现,就像这里有Workspace Runner:https://blog.safe.com/2018/03/batch-processing-2018-evangelist172/- 您可以在其中指定每个FME进程的数字或工作空间。
    这一想法是,而不是拥有新的工作者进程的每个组,而是对每个组进行相同的fmeworker.exe进程的运行并刚收到下一组数据。我不确定会有什么样的含义,但它将使得大量的群体少一个问题

    • 马克爱尔兰 说:

      是!这绝对是我们的名单。用户不应该真正关心有多少进程和功能开始,只是它在最高效的情况下运行。这就是我们的目标。

  3. 该Doctor 说:

    嗨马克,
    关于服务器,我们期望的性能如何增加?此外,我们可以在服务器端(以及工作区中)做什么,以准备和最佳利用并行性?我们已经关注了1个核心/发动机规则,所以我假设更快的核心,更多的RAM会有所帮助,因为每核只有1个发动机?对于RAM,每个发动机都可以使用的最大值是多少?

    享受博客更新!让他们来!

Leave a Reply toAnonymous取消回复

Your email address will not be published.必需的地方已做标记*

相关文章