简体   繁体   English

Boost - Odeint:使用 VexCL 的并发意味着什么以及如何改进它?

[英]Boost - Odeint: What means concurrency using VexCL and how to improve it?

My question is related to the tutorial which explains how to implement boost::odeint with VexCL in order to achieve concurrency (the complete code can be found here ).我的问题与教程有关,该教程解释了如何使用 VexCL 实现 boost::odeint 以实现并发(完整代码可以在这里找到)。

The following figure shows how I think of the iterations of ODEINT:下图展示了我对ODEINT迭代的看法: 在此处输入图片说明

Now I ask myself, what exactly / or which part of it is parallelised in VexCL?现在我问自己,在 VexCL 中究竟是什么/或它的哪一部分是并行化的?

My impression is, the ODE part is one single task, as all equations of ODE are within one block in the given example.我的印象是,ODE 部分是一项单独的任务,因为在给定的示例中,ODE 的所有方程都在一个块内。 Maybe the integration part runs in three parallel tasks.也许集成部分在三个并行任务中运行。 This results in four tasks, where (I think) the ODE task is a bottle neck (because the equations can become very large).这导致了四个任务,其中(我认为)ODE 任务是一个瓶颈(因为方程可能变得非常大)。

If this is right I would like to know, how to improve this concurrency .如果这是正确的,我想知道如何改进这种并发性 I think it make sense to combine ODE and INT horizontally.我认为横向结合 ODE 和 INT 是有意义的。 This results in 3 tasks, each of which cannot be further reduced at this level.这导致 3 个任务,每个任务都不能在这个级别进一步减少。

The example you linked to is doing a parameter study of the Lorenz system.您链接到的示例正在对洛伦兹系统进行参数研究。 That is, it solves a big number of the same equations with different parameters.也就是说,它解决了大量具有不同参数的相同方程。 The state type is vex::multivector<double,3> , which packs together states (3D coordinates) of many Lorenz systems.状态类型是vex::multivector<double,3> ,它将许多 Lorenz 系统的状态(3D 坐标)打包在一起。 This is an embarrassingly parallel problem and one can apply the odeint algorithm to the state types in lock-step.这是一个令人尴尬的并行问题,可以将 odeint 算法应用于锁步中的状态类型。 That is, operations like x += tau * dt where x and dt are large vectors, are performed on a GPU.也就是说,像x += tau * dt这样的操作在 GPU 上执行,其中xdt是大向量。

More details about odeint/vexcl implementation may be found in [1].关于 odeint/vexcl 实现的更多细节可以在 [1] 中找到。 [2] is an interesting paper about how to extract parallelism in the case of coupled systems. [2] 是一篇关于如何在耦合系统的情况下提取并行性的有趣论文。

[1] Ahnert, Karsten, Denis Demidov, and Mario Mulansky. [1] Ahnert、Karsten、Denis Demidov 和 Mario Mulansky。 "Solving ordinary differential equations on GPUs." “在 GPU 上求解常微分方程。” Numerical Computations with GPUs.使用 GPU 进行数值计算。 Springer, Cham, 2014. 125-157. Springer, Cham,2014 年。125-157。 https://doi.org/10.1007/978-3-319-06548-9_7 ( pdf ) https://doi.org/10.1007/978-3-319-06548-9_7 ( pdf )

[2] Mulansky, Mario. [2] 木兰斯基,马里奥。 "Optimizing Large-Scale ODE Simulations." “优化大规模 ODE 模拟。” arXiv preprint arXiv:1412.0544 (2014). arXiv 预印本arXiv:1412.0544 (2014)。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM