【发布时间】:2013-10-05 22:08:58
【问题描述】:
我运行 boost mpi 的 isend 教程。但它给了我以下错误。
#include <boost/mpi.hpp>
#include <iostream>
#include <string>
#include <boost/serialization/string.hpp>
namespace mpi = boost::mpi;
int main(int argc, char* argv[])
{
mpi::environment env(argc, argv);
mpi::communicator world;
if (world.rank() == 0) {
mpi::request reqs[2];
std::string msg, out_msg = "Hello";
reqs[0] = world.isend(1, 0, out_msg);
reqs[1] = world.irecv(1, 1, msg);
mpi::wait_all(reqs, reqs + 2);
std::cout << msg << "!" << std::endl;
} else {
mpi::request reqs[2];
std::string msg, out_msg = "world";
reqs[0] = world.isend(0, 1, out_msg);
reqs[1] = world.irecv(0, 0, msg);
mpi::wait_all(reqs, reqs + 2);
std::cout << msg << ", ";
}
return 0;
}
错误:
> ==================================================================================
= BAD TERMINATION OF ONE OF YOUR APPLICATION PROCESSES
= EXIT CODE: 11
= CLEANING UP REMAINING PROCESSES
= YOU CAN IGNORE THE BELOW CLEANUP MESSAGES
===================================================================================
YOUR APPLICATION TERMINATED WITH THE EXIT STRING: Segmentation fault (signal 11)
This typically refers to a problem with your application.
Please see the FAQ page for debugging suggestions
能否请您给我一些有关此错误的信息。我可以正确运行所有其他教程。 问候
【问题讨论】:
-
这是一个来自 MPICH 的错误,告诉您您的程序存在分段错误。它可能来自任何数量的事物。通常,这是应用程序的问题,但也可能是您的 MPICH/Boost 安装有问题。您是否检查过是否有可用于查看内容的核心转储?
-
在我看来教程中的错误。文档很少,但可能应该是
mpi::wait_all(reqs, reqs + 1);