2013-09-30 78 views
0

我運行boost mpi的isend教程。但它給了我以下錯誤。boost mpi isend tutorial does not work

#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 

能否請您給我這個錯誤的信息。我可以正確運行所有其他教程。 Regards

+0

這是MPICH發佈的一個錯誤,告訴您您的程序存在分段錯誤。它可能來自任何事物。通常,這是應用程序的問題,但也可能是您的MPICH/Boost安裝有問題。你有沒有檢查是否有核心轉儲,你可以用來看看事情? –

+1

在教程中看起來像是一個錯誤。文檔很少,但可能它應該是'mpi :: wait_all(reqs,reqs + 1);' –

回答

0

我改變字符串類型爲double或int,它的工作原理。但似乎字符串類型的數據不起作用。購買方式,應該採取Hristo lliev的訴求。