Ticket #10669: test.cpp
File test.cpp, 415 bytes (added by , 8 years ago) |
---|
Line | |
---|---|
1 | #include <boost/mpi.hpp> |
2 | #include <boost/serialization/map.hpp> |
3 | #include <iostream> |
4 | #include <map> |
5 | |
6 | using namespace std; |
7 | using namespace boost; |
8 | |
9 | int main(int argc, char** argv) |
10 | { |
11 | mpi::environment env(argc, argv); |
12 | mpi::communicator comm; |
13 | |
14 | map<int, int> data; |
15 | data[0] = 1; |
16 | |
17 | cout << comm.rank() << ": broadcasting data" << endl; |
18 | mpi::broadcast(comm, data, 0); |
19 | cout << comm.rank() << ": done!" << endl; |
20 | } |