25 #include <graphlab/rpc/dc.hpp>
26 #include <graphlab/serialization/iarchive.hpp>
27 using namespace graphlab;
36 void test_blob(
size_t len, wild_pointer w) {
38 std::cout <<
"split call from : " << *
reinterpret_cast<const procid_t*
>(w.ptr) <<
"\n";
42 std::cout << rmi.procid() <<
": Receiving print with value : " << val << std::endl;
46 if (rmi.procid() == 0) {
47 std::cout <<
"First set of calls... Proc 1 and 3 should receive" << std::endl;
48 std::vector<procid_t> s;
49 s.push_back(1); s.push_back(3);
50 rmi.pod_call(s.begin(), s.end(), &test_struct::print, 1);
54 if (rmi.procid() == 0) {
55 std::cout <<
"Second set of calls... Proc 0 and 2 should receive" << std::endl;
56 std::vector<procid_t> s;
57 s.push_back(2); s.push_back(0);
58 rmi.pod_call(s.begin(), s.end(), &test_struct::print, 1);
62 oarchive* oarc = rmi.split_call_begin(&test_struct::test_blob);
63 (*oarc) << rmi.procid();
64 rmi.split_call_end(1, oarc);
69 int main(
int argc,
char ** argv) {
70 mpi_tools::init(argc, argv);
74 std::cout<<
"RPC Example 8: Basic Broadcast Test\n";
75 std::cout <<
"Run with exactly 4 MPI nodes.\n";
82 mpi_tools::finalize();