#include #include #include using namespace std; using namespace boost::mpi; int main(int argc,char *argv[]) { environment env(argc, argv); communicator world; bool test(true); if (world.rank() == 0) test = false; #ifndef LEAK_WORKAROUND broadcast(world,test,0); #else MPI_Datatype type; BOOST_MPI_CHECK_RESULT(MPI_Type_contiguous,(sizeof(bool),MPI_BYTE,&type)); BOOST_MPI_CHECK_RESULT(MPI_Type_commit,(&type)); BOOST_MPI_CHECK_RESULT(MPI_Bcast,(reinterpret_cast(test),1,type,0,world)); BOOST_MPI_CHECK_RESULT(MPI_Type_free,(&type)); #endif cout << "\nrank " << world.rank() << ": test = " << test << endl; return EXIT_SUCCESS; }