在并行处理中,如何使用mathematica让每个处理器执行一个程序块
我想编写一段 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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
我认为是的,但是您需要将您的函数分布在 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 :-).