在并行处理中,如何使用mathematica让每个处理器执行一个程序块

发布于 2024-11-19 18:40:48 字数 120 浏览 4 评论 0原文

我想编写一段 C 代码并将其发送到每个处理器来执行它,

使用 mathematica 可以吗?

使用网关将 C 与 mathematica 或其他东西链接起来,

谢谢大家..:)

I want to write a block of C code and send it to every processor to execute it

Is that possible using mathematica?

using gateway to link C with mathematica or what ever

thank you all .. :)

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

吃素的狼 2024-11-26 18:40:48

我认为是的,但是您需要将您的函数分布在 c 代码中的 CPU 上。默认情况下,Mathematica 无法检测您的函数是否是原子函数。

您是否查看过 http://reference.wolfram.com/mathematica/tutorial/MathLinkDeveloperGuide -Unix.html

编辑:如果您非常确定要执行此操作,请查看 http://reference.wolfram .com/mathematica/ref/ParallelTable.html 。它与我的 c++ 配合得不太好,这就是为什么我不推荐它:-)。

I think it is, but you will need to distribute your function over the CPUs in the c code. By default, Mathematica isn't able to detect that your functions are atomic.

Have you checked out http://reference.wolfram.com/mathematica/tutorial/MathLinkDeveloperGuide-Unix.html ?

EDIT: If you are very certain you want to do this check out http://reference.wolfram.com/mathematica/ref/ParallelTable.html . It doesn't work particularly well with my c++, thats why I didn't recommend it :-).

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文