【发布时间】:2012-04-22 02:40:58
【问题描述】:
基本上我想实现这样的目标:
Process 1
Thread 1
Receive X from process 2
Thread 2
Receive Y from process 2
Process 2
Thread 1
Send X to process 1
Thread 2
Send Y to process 1
在用于 C 语言的 MPI 中,带有 pthreads 库。
我已经在 PVM 中做过了,这是源代码:
master.c : http://pastebin.com/wwEie7gn ,
slave.c : http://pastebin.com/gfeCkcss .
我想做什么:
prog.c : http://pastebin.com/tCVKN3fe
不知何故,接收者线程没有收到任何东西。我不知道问题是什么。我希望有人能告诉我正确的方法。
我正在运行没有线程支持的 MPI。
【问题讨论】:
-
为什么不只产生 4 个进程?
-
@suszterpatt 稍后我希望这些线程使用 pthread 共享内存空间。
标签: c pthreads mpi distributed-computing pvm