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,22 @@
#!/usr/bin/python
"""
demo python script of rabit
"""
import os
import sys
# add path to wrapper
# for normal run without tracker script, add following line
# sys.path.append(os.path.dirname(__file__) + '/../wrapper')
import rabit
rabit.init()
n = 3
rank = rabit.get_rank()
s = None
if rank == 0:
s = {'hello world':100, 2:3}
print '@node[%d] before-broadcast: s=\"%s\"' % (rank, str(s))
s = rabit.broadcast(s, 0)
print '@node[%d] after-broadcast: s=\"%s\"' % (rank, str(s))
rabit.finalize()