Merge commit 'd87691ec603db325d5b1c5db1186295a748df7cc' as 'subtree/rabit'

This commit is contained in:
tqchen
2015-01-18 21:08:17 -08:00
68 changed files with 9081 additions and 0 deletions

View File

@@ -0,0 +1,16 @@
#include <rabit.h>
using namespace rabit;
const int N = 3;
int main(int argc, char *argv[]) {
rabit::Init(argc, argv);
std::string s;
if (rabit::GetRank() == 0) s = "hello world";
printf("@node[%d] before-broadcast: s=\"%s\"\n",
rabit::GetRank(), s.c_str());
// broadcast s from node 0 to all other nodes
rabit::Broadcast(&s, 0);
printf("@node[%d] after-broadcast: s=\"%s\"\n",
rabit::GetRank(), s.c_str());
rabit::Finalize();
return 0;
}